Skip to content

Commit

Permalink
fix: fix reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Nov 7, 2024
1 parent edcb243 commit 2004b57
Show file tree
Hide file tree
Showing 6 changed files with 2,027 additions and 25 deletions.
24 changes: 24 additions & 0 deletions apps/backend/drizzle/0013_lovely_mordo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_undb_reference_id_mapping` (
`field_id` text NOT NULL,
`table_id` text NOT NULL,
`symmetric_field_id` text,
`foreign_table_id` text NOT NULL
);
--> statement-breakpoint
INSERT INTO `__new_undb_reference_id_mapping`("field_id", "table_id", "symmetric_field_id", "foreign_table_id") SELECT "field_id", "table_id", "symmetric_field_id", "foreign_table_id" FROM `undb_reference_id_mapping`;--> statement-breakpoint
DROP TABLE `undb_reference_id_mapping`;--> statement-breakpoint
ALTER TABLE `__new_undb_reference_id_mapping` RENAME TO `undb_reference_id_mapping`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
CREATE UNIQUE INDEX `reference_id_mapping_unique_idx` ON `undb_reference_id_mapping` (`field_id`,`table_id`,`symmetric_field_id`,`foreign_table_id`);--> statement-breakpoint
CREATE TABLE `__new_undb_rollup_id_mapping` (
`field_id` text NOT NULL,
`table_id` text NOT NULL,
`rollup_id` text NOT NULL,
`rollup_table_id` text NOT NULL,
PRIMARY KEY(`field_id`, `rollup_id`)
);
--> statement-breakpoint
INSERT INTO `__new_undb_rollup_id_mapping`("field_id", "table_id", "rollup_id", "rollup_table_id") SELECT "field_id", "table_id", "rollup_id", "rollup_table_id" FROM `undb_rollup_id_mapping`;--> statement-breakpoint
DROP TABLE `undb_rollup_id_mapping`;--> statement-breakpoint
ALTER TABLE `__new_undb_rollup_id_mapping` RENAME TO `undb_rollup_id_mapping`;
Loading

0 comments on commit 2004b57

Please sign in to comment.