Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Aug 22, 2024
1 parent c6dcf2b commit 46b60e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions drizzle-kit/tests/mysql-generated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test('generated as callback: add generated constraint to an exisiting column as
},
]);
expect(sqlStatements).toStrictEqual([
"ALTER TABLE `users` MODIFY COLUMN `gen_name` text NOT NULL GENERATED ALWAYS AS (`users`.`name` || 'to add') STORED;",
"ALTER TABLE `users` MODIFY COLUMN `gen_name` text GENERATED ALWAYS AS (`users`.`name` || 'to add') STORED NOT NULL;",
]);
});

Expand Down Expand Up @@ -151,7 +151,7 @@ test('generated as callback: add generated constraint to an exisiting column as
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE `users` DROP COLUMN `gen_name`;',
"ALTER TABLE `users` ADD `gen_name` text NOT NULL GENERATED ALWAYS AS (`users`.`name` || 'to add') VIRTUAL;",
"ALTER TABLE `users` ADD `gen_name` text GENERATED ALWAYS AS (`users`.`name` || 'to add') VIRTUAL NOT NULL;",
]);
});

Expand Down Expand Up @@ -530,7 +530,7 @@ test('generated as sql: add generated constraint to an exisiting column as store
},
]);
expect(sqlStatements).toStrictEqual([
"ALTER TABLE `users` MODIFY COLUMN `gen_name` text NOT NULL GENERATED ALWAYS AS (`users`.`name` || 'to add') STORED;",
"ALTER TABLE `users` MODIFY COLUMN `gen_name` text GENERATED ALWAYS AS (`users`.`name` || 'to add') STORED NOT NULL;",
]);
});

Expand Down Expand Up @@ -582,7 +582,7 @@ test('generated as sql: add generated constraint to an exisiting column as virtu
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE `users` DROP COLUMN `gen_name`;',
"ALTER TABLE `users` ADD `gen_name` text NOT NULL GENERATED ALWAYS AS (`users`.`name` || 'to add') VIRTUAL;",
"ALTER TABLE `users` ADD `gen_name` text GENERATED ALWAYS AS (`users`.`name` || 'to add') VIRTUAL NOT NULL;",
]);
});

Expand Down Expand Up @@ -961,7 +961,7 @@ test('generated as string: add generated constraint to an exisiting column as st
},
]);
expect(sqlStatements).toStrictEqual([
"ALTER TABLE `users` MODIFY COLUMN `gen_name` text NOT NULL GENERATED ALWAYS AS (`users`.`name` || 'to add') STORED;",
"ALTER TABLE `users` MODIFY COLUMN `gen_name` text GENERATED ALWAYS AS (`users`.`name` || 'to add') STORED NOT NULL;",
]);
});

Expand Down Expand Up @@ -1013,7 +1013,7 @@ test('generated as string: add generated constraint to an exisiting column as vi
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE `users` DROP COLUMN `gen_name`;',
"ALTER TABLE `users` ADD `gen_name` text NOT NULL GENERATED ALWAYS AS (`users`.`name` || 'to add') VIRTUAL;",
"ALTER TABLE `users` ADD `gen_name` text GENERATED ALWAYS AS (`users`.`name` || 'to add') VIRTUAL NOT NULL;",
]);
});

Expand Down
6 changes: 3 additions & 3 deletions drizzle-kit/tests/pg-generated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test('generated as callback: add generated constraint to an exisiting column', a
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE "users" drop column "gen_name";',
'ALTER TABLE "users" ADD COLUMN "gen_name" text NOT NULL GENERATED ALWAYS AS ("users"."name" || \'to add\') STORED;',
'ALTER TABLE "users" ADD COLUMN "gen_name" text GENERATED ALWAYS AS ("users"."name" || \'to add\') STORED NOT NULL;',
]);
});

Expand Down Expand Up @@ -262,7 +262,7 @@ test('generated as sql: add generated constraint to an exisiting column', async
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE "users" drop column "gen_name";',
'ALTER TABLE "users" ADD COLUMN "gen_name" text NOT NULL GENERATED ALWAYS AS ("users"."name" || \'to add\') STORED;',
'ALTER TABLE "users" ADD COLUMN "gen_name" text GENERATED ALWAYS AS ("users"."name" || \'to add\') STORED NOT NULL;',
]);
});

Expand Down Expand Up @@ -437,7 +437,7 @@ test('generated as string: add generated constraint to an exisiting column', asy
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE "users" drop column "gen_name";',
'ALTER TABLE "users" ADD COLUMN "gen_name" text NOT NULL GENERATED ALWAYS AS ("users"."name" || \'to add\') STORED;',
'ALTER TABLE "users" ADD COLUMN "gen_name" text GENERATED ALWAYS AS ("users"."name" || \'to add\') STORED NOT NULL;',
]);
});

Expand Down
6 changes: 3 additions & 3 deletions drizzle-kit/tests/sqlite-generated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ test('generated as callback: add generated constraint to an exisiting column as
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE `users` DROP COLUMN `gen_name`;',
'ALTER TABLE `users` ADD `gen_name` text NOT NULL GENERATED ALWAYS AS ("name" || \'to add\') VIRTUAL;',
'ALTER TABLE `users` ADD `gen_name` text GENERATED ALWAYS AS ("name" || \'to add\') VIRTUAL NOT NULL;',
]);
});

Expand Down Expand Up @@ -744,7 +744,7 @@ test('generated as sql: add generated constraint to an exisiting column as virtu
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE `users` DROP COLUMN `gen_name`;',
'ALTER TABLE `users` ADD `gen_name` text NOT NULL GENERATED ALWAYS AS ("users"."name" || \'to add\') VIRTUAL;',
'ALTER TABLE `users` ADD `gen_name` text GENERATED ALWAYS AS ("users"."name" || \'to add\') VIRTUAL NOT NULL;',
]);
});

Expand Down Expand Up @@ -1312,7 +1312,7 @@ test('generated as string: add generated constraint to an exisiting column as vi
]);
expect(sqlStatements).toStrictEqual([
'ALTER TABLE `users` DROP COLUMN `gen_name`;',
'ALTER TABLE `users` ADD `gen_name` text NOT NULL GENERATED ALWAYS AS ("users"."name" || \'to add\') VIRTUAL;',
'ALTER TABLE `users` ADD `gen_name` text GENERATED ALWAYS AS ("users"."name" || \'to add\') VIRTUAL NOT NULL;',
]);
});

Expand Down

0 comments on commit 46b60e6

Please sign in to comment.