import { CollectionConfig } from "@rebasepro/types"; /** * Notice a generated Drizzle schema that a *library upgrade* invalidated. * * `rebase dev` already watches `config/collections` and warns when a collection * file changes. That covers drift the developer caused. It cannot cover this one, * because nothing the developer owns changed: 0.13 derives `category_id` where * 0.12 derived `categorie_id`, from the same unedited collection. The watcher * never fires, and `backend/src/schema.generated.ts` quietly stops describing the * schema the runtime expects. * * The consequence is not cosmetic. Boot-ensure renames the column in the * database, then relation validation reads the stale module and refuses to * start — on that boot and every boot after it, because the rename is already * applied and will not be attempted again. * * Deliberately narrow: this answers "does the generated schema name a foreign key * the way the previous rule did", not "is this file what we would generate now". * The wide question would report every whitespace change in the generator as a * fatal staleness, and a check that cries wolf gets switched off. */ /** One column the generated schema names under the pre-0.13 rule. */ export interface LegacyForeignKeyName { /** Table whose column declaration is stale. */ table: string; /** The name the generated schema declares. */ legacy: string; /** The name this release derives, and which the database now carries. */ current: string; /** `.` that derives it, for the message. */ relation: string; } /** * @param generatedSource contents of `backend/src/schema.generated.ts` * @param collections the project's collections, as this release reads them */ export declare function findLegacyForeignKeyNames(generatedSource: string, collections: CollectionConfig[]): LegacyForeignKeyName[]; /** One-line summary for a log or a CLI notice. */ export declare function describeLegacyForeignKeyNames(found: LegacyForeignKeyName[]): string;