Fix bugs, improve schema gen
This commit is contained in:
Vendored
+11
@@ -1,2 +1,13 @@
|
||||
import type { BUN_MARIADB_DatabaseSchemaType, CreateDBSchemaParams } from "../../types";
|
||||
/**
|
||||
* Topologically order tables so referenced (parent) tables come before the
|
||||
* tables that reference them. Declaration order is kept wherever the FK
|
||||
* graph allows it.
|
||||
*
|
||||
* - Self references (e.g. `comments.parent_comment_id`) are ignored.
|
||||
* - References to tables outside the schema are ignored.
|
||||
* - Cycles do not throw: a table already on the current path is skipped,
|
||||
* so every table is still emitted exactly once. Foreign keys are created
|
||||
* after all tables exist, so cycles are safe to sync.
|
||||
*/
|
||||
export default function orderDBSchema({ db_schema, }: CreateDBSchemaParams): Promise<BUN_MARIADB_DatabaseSchemaType>;
|
||||
|
||||
Reference in New Issue
Block a user