Fix bugs, improve schema gen
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@ import MariaDBQuoteGen from "./mariadb-quote-gen";
|
||||
import resolveTable from "./resolve-table";
|
||||
import runSchemaQuery, { querySchemaRows } from "./run-schema-query";
|
||||
import schemaCondition from "./schema-condition";
|
||||
import { dropObsoleteForeignKeys, ensureForeignKeys, } from "./sync-foreign-keys";
|
||||
import { dropObsoleteForeignKeys } from "./sync-foreign-keys";
|
||||
import syncIndexes from "./sync-indexes";
|
||||
import syncPrimaryKey from "./sync-primary-key";
|
||||
import syncTableOptions from "./sync-table-options";
|
||||
@@ -64,11 +64,11 @@ export default async function handleDBSchemaTable({ db_schema, config, table, db
|
||||
// 2. Drop obsolete/changed FKs (unlocks index cleanup)
|
||||
// 3. Primary key
|
||||
// 4. Indexes / uniques (FK columns need supporting indexes)
|
||||
// 5. Ensure foreign keys exist
|
||||
// Foreign keys are ensured by `handleDBSchemaTables` after every table
|
||||
// has been created/updated.
|
||||
await syncTableOptions({ table: resolvedTable, config });
|
||||
await dropObsoleteForeignKeys({ table: resolvedTable, config });
|
||||
await syncPrimaryKey({ table: resolvedTable, config });
|
||||
await syncIndexes({ table: resolvedTable, config });
|
||||
await syncUniqueConstraints({ table: resolvedTable, config });
|
||||
await ensureForeignKeys({ table: resolvedTable, config });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user