Kit: Handle optional DB aliases and casing #2719
Triggered via pull request
September 27, 2024 16:02
Status
Failure
Total duration
4m 12s
Artifacts
–
Annotations
7 errors
tests/mysql.test.ts > optional db aliases (camel case):
drizzle-kit/tests/mysql.test.ts#L750
AssertionError: expected [ …(6) ] to strictly equal [ …(6) ]
- Expected
+ Received
Array [
"CREATE TABLE `t1` (
- `t1Id1` int NOT NULL,
- `t1Col2` int NOT NULL,
- `t1Col3` int NOT NULL,
- `t2Ref` int NOT NULL,
- `t1Uni` int NOT NULL,
- `t1UniIdx` int NOT NULL,
- `t1Idx` int NOT NULL,
- CONSTRAINT `t1_t1Id1` PRIMARY KEY(`t1Id1`),
- CONSTRAINT `t1Uni` UNIQUE(`t1Uni`),
- CONSTRAINT `t1UniIdx` UNIQUE(`t1UniIdx`)
+ `t1_id1` int NOT NULL,
+ `t1_col2` int NOT NULL,
+ `t1_col3` int NOT NULL,
+ `t2_ref` int NOT NULL,
+ `t1_uni` int NOT NULL,
+ `t1_uni_idx` int NOT NULL,
+ `t1_idx` int NOT NULL,
+ CONSTRAINT `t1_t1_id1` PRIMARY KEY(`t1_id1`),
+ CONSTRAINT `t1Uni` UNIQUE(`t1_uni`),
+ CONSTRAINT `t1UniIdx` UNIQUE(`t1_uni_idx`)
);
",
"CREATE TABLE `t2` (
- `t2Id` serial AUTO_INCREMENT NOT NULL,
- CONSTRAINT `t2_t2Id` PRIMARY KEY(`t2Id`)
+ `t2_id` serial AUTO_INCREMENT NOT NULL,
+ CONSTRAINT `t2_t2_id` PRIMARY KEY(`t2_id`)
);
",
"CREATE TABLE `t3` (
- `t3Id1` int NOT NULL,
- `t3Id2` int NOT NULL,
- CONSTRAINT `t3_t3Id1_t3Id2_pk` PRIMARY KEY(`t3Id1`,`t3Id2`)
+ `t3_id1` int NOT NULL,
+ `t3_id2` int NOT NULL,
+ CONSTRAINT `t3_t3_id1_t3_id2_pk` PRIMARY KEY(`t3_id1`,`t3_id2`)
);
",
- "ALTER TABLE `t1` ADD CONSTRAINT `t1_t2Ref_t2_t2Id_fk` FOREIGN KEY (`t2Ref`) REFERENCES `t2`(`t2Id`) ON DELETE no action ON UPDATE no action;",
- "ALTER TABLE `t1` ADD CONSTRAINT `t1_t1Col2_t1Col3_t3_t3Id1_t3Id2_fk` FOREIGN KEY (`t1Col2`,`t1Col3`) REFERENCES `t3`(`t3Id1`,`t3Id2`) ON DELETE no action ON UPDATE no action;",
- "CREATE INDEX `t1Idx` ON `t1` (`t1Idx`);",
+ "ALTER TABLE `t1` ADD CONSTRAINT `t1_t2_ref_t2_t2_id_fk` FOREIGN KEY (`t2_ref`) REFERENCES `t2`(`t2_id`) ON DELETE no action ON UPDATE no action;",
+ "ALTER TABLE `t1` ADD CONSTRAINT `t1_t1_col2_t1_col3_t3_t3_id1_t3_id2_fk` FOREIGN KEY (`t1_col2`,`t1_col3`) REFERENCES `t3`(`t3_id1`,`t3_id2`) ON DELETE no action ON UPDATE no action;",
+ "CREATE INDEX `t1Idx` ON `t1` (`t1_idx`);",
]
❯ tests/mysql.test.ts:750:24
|
tests/pg-tables.test.ts > optional db aliases (snake case):
drizzle-kit/tests/pg-tables.test.ts#L741
AssertionError: expected [ …(7) ] to strictly equal [ …(7) ]
- Expected
+ Received
Array [
"CREATE TABLE IF NOT EXISTS \"t1\" (
\"t1_id1\" integer PRIMARY KEY NOT NULL,
\"t1_col2\" integer NOT NULL,
\"t1_col3\" integer NOT NULL,
\"t2_ref\" integer NOT NULL,
\"t1_uni\" integer NOT NULL,
\"t1_uni_idx\" integer NOT NULL,
\"t1_idx\" integer NOT NULL,
CONSTRAINT \"t1_uni\" UNIQUE(\"t1_uni\")
);
",
"CREATE TABLE IF NOT EXISTS \"t2\" (
\"t2_id\" serial PRIMARY KEY NOT NULL
);
",
"CREATE TABLE IF NOT EXISTS \"t3\" (
\"t3_id1\" integer,
\"t3_id2\" integer,
CONSTRAINT \"t3_t3_id1_t3_id2_pk\" PRIMARY KEY(\"t3_id1\",\"t3_id2\")
);
",
"DO $$ BEGIN
ALTER TABLE \"t1\" ADD CONSTRAINT \"t1_t2_ref_t2_t2_id_fk\" FOREIGN KEY (\"t2_ref\") REFERENCES \"public\".\"t2\"(\"t2_id\") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
",
"DO $$ BEGIN
ALTER TABLE \"t1\" ADD CONSTRAINT \"t1_t1_col2_t1_col3_t3_t3_id1_t3_id2_fk\" FOREIGN KEY (\"t1_col2\",\"t1_col3\") REFERENCES \"public\".\"t3\"(\"t3_id1\",\"t3_id2\") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
",
"CREATE UNIQUE INDEX IF NOT EXISTS \"t1_uni_idx\" ON \"t1\" USING btree (\"t1_uni_idx\");",
- "CREATE INDEX IF NOT EXISTS \"t1_idx\" ON \"t1\" USING btree (\"t1_idx\") WHERE \"t1\".\"t1_idx\" > 0;",
+ "CREATE INDEX IF NOT EXISTS \"t1_idx\" ON \"t1\" USING btree (\"t1_idx\") WHERE \"t1\".\"t1Idx\" > 0;",
]
❯ tests/pg-tables.test.ts:741:24
|
tests/pg-tables.test.ts > optional db aliases (camel case):
drizzle-kit/tests/pg-tables.test.ts#L839
AssertionError: expected [ …(7) ] to strictly equal [ …(7) ]
- Expected
+ Received
Array [
"CREATE TABLE IF NOT EXISTS \"t1\" (
- \"t1Id1\" integer PRIMARY KEY NOT NULL,
- \"t1Col2\" integer NOT NULL,
- \"t1Col3\" integer NOT NULL,
- \"t2Ref\" integer NOT NULL,
- \"t1Uni\" integer NOT NULL,
- \"t1UniIdx\" integer NOT NULL,
- \"t1Idx\" integer NOT NULL,
- CONSTRAINT \"t1Uni\" UNIQUE(\"t1Uni\")
+ \"t1_id1\" integer PRIMARY KEY NOT NULL,
+ \"t1_col2\" integer NOT NULL,
+ \"t1_col3\" integer NOT NULL,
+ \"t2_ref\" integer NOT NULL,
+ \"t1_uni\" integer NOT NULL,
+ \"t1_uni_idx\" integer NOT NULL,
+ \"t1_idx\" integer NOT NULL,
+ CONSTRAINT \"t1Uni\" UNIQUE(\"t1_uni\")
);
",
"CREATE TABLE IF NOT EXISTS \"t2\" (
- \"t2Id\" serial PRIMARY KEY NOT NULL
+ \"t2_id\" serial PRIMARY KEY NOT NULL
);
",
"CREATE TABLE IF NOT EXISTS \"t3\" (
- \"t3Id1\" integer,
- \"t3Id2\" integer,
- CONSTRAINT \"t3_t3Id1_t3Id2_pk\" PRIMARY KEY(\"t3Id1\",\"t3Id2\")
+ \"t3_id1\" integer,
+ \"t3_id2\" integer,
+ CONSTRAINT \"t3_t3_id1_t3_id2_pk\" PRIMARY KEY(\"t3_id1\",\"t3_id2\")
);
",
"DO $$ BEGIN
- ALTER TABLE \"t1\" ADD CONSTRAINT \"t1_t2Ref_t2_t2Id_fk\" FOREIGN KEY (\"t2Ref\") REFERENCES \"public\".\"t2\"(\"t2Id\") ON DELETE no action ON UPDATE no action;
+ ALTER TABLE \"t1\" ADD CONSTRAINT \"t1_t2_ref_t2_t2_id_fk\" FOREIGN KEY (\"t2_ref\") REFERENCES \"public\".\"t2\"(\"t2_id\") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
",
"DO $$ BEGIN
- ALTER TABLE \"t1\" ADD CONSTRAINT \"t1_t1Col2_t1Col3_t3_t3Id1_t3Id2_fk\" FOREIGN KEY (\"t1Col2\",\"t1Col3\") REFERENCES \"public\".\"t3\"(\"t3Id1\",\"t3Id2\") ON DELETE no action ON UPDATE no action;
+ ALTER TABLE \"t1\" ADD CONSTRAINT \"t1_t1_col2_t1_col3_t3_t3_id1_t3_id2_fk\" FOREIGN KEY (\"t1_col2\",\"t1_col3\") REFERENCES \"public\".\"t3\"(\"t3_id1\",\"t3_id2\") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
",
- "CREATE UNIQUE INDEX IF NOT EXISTS \"t1UniIdx\" ON \"t1\" USING btree (\"t1UniIdx\");",
- "CREATE INDEX IF NOT EXISTS \"t1Idx\" ON \"t1\" USING btree (\"t1Idx\") WHERE \"t1\".\"t1Idx\" > 0;",
+ "CREATE UNIQUE INDEX IF NOT EXISTS \"t1UniIdx\" ON \"t1\" USING btree (\"t1_uni_idx\");",
+ "CREATE INDEX IF NOT EXISTS \"t1Idx\" ON \"t1\" USING btree (\"t1_idx\") WHERE \"t1\".\"t1_idx\" > 0;",
]
❯ tests/pg-tables.test.ts:839:24
|
tests/sqlite-tables.test.ts > optional db aliases (camel case):
drizzle-kit/tests/sqlite-tables.test.ts#L582
AssertionError: expected [ …(6) ] to strictly equal [ …(6) ]
- Expected
+ Received
Array [
"CREATE TABLE `t1` (
- `t1Id1` integer PRIMARY KEY NOT NULL,
- `t1Col2` integer NOT NULL,
- `t1Col3` integer NOT NULL,
- `t2Ref` integer NOT NULL,
- `t1Uni` integer NOT NULL,
- `t1UniIdx` integer NOT NULL,
- `t1Idx` integer NOT NULL,
- FOREIGN KEY (`t2Ref`) REFERENCES `t2`(`t2Id`) ON UPDATE no action ON DELETE no action,
- FOREIGN KEY (`t1Col2`,`t1Col3`) REFERENCES `t3`(`t3Id1`,`t3Id2`) ON UPDATE no action ON DELETE no action
+ `t1_id1` integer PRIMARY KEY NOT NULL,
+ `t1_col2` integer NOT NULL,
+ `t1_col3` integer NOT NULL,
+ `t2_ref` integer NOT NULL,
+ `t1_uni` integer NOT NULL,
+ `t1_uni_idx` integer NOT NULL,
+ `t1_idx` integer NOT NULL,
+ FOREIGN KEY (`t2_ref`) REFERENCES `t2`(`t2_id`) ON UPDATE no action ON DELETE no action,
+ FOREIGN KEY (`t1_col2`,`t1_col3`) REFERENCES `t3`(`t3_id1`,`t3_id2`) ON UPDATE no action ON DELETE no action
);
",
- "CREATE UNIQUE INDEX `t1UniIdx` ON `t1` (`t1UniIdx`);",
- "CREATE INDEX `t1Idx` ON `t1` (`t1Idx`);",
- "CREATE UNIQUE INDEX `t1Uni` ON `t1` (`t1Uni`);",
+ "CREATE UNIQUE INDEX `t1UniIdx` ON `t1` (`t1_uni_idx`);",
+ "CREATE INDEX `t1Idx` ON `t1` (`t1_idx`);",
+ "CREATE UNIQUE INDEX `t1Uni` ON `t1` (`t1_uni`);",
"CREATE TABLE `t2` (
- `t2Id` integer PRIMARY KEY AUTOINCREMENT NOT NULL
+ `t2_id` integer PRIMARY KEY AUTOINCREMENT NOT NULL
);
",
"CREATE TABLE `t3` (
- `t3Id1` integer,
- `t3Id2` integer,
- PRIMARY KEY(`t3Id1`, `t3Id2`)
+ `t3_id1` integer,
+ `t3_id2` integer,
+ PRIMARY KEY(`t3_id1`, `t3_id2`)
);
",
]
❯ tests/sqlite-tables.test.ts:582:24
|
release (drizzle-kit)
Process completed with exit code 1.
|
release (drizzle-orm)
The job was canceled because "drizzle-kit" failed.
|
release (drizzle-orm)
The operation was canceled.
|