Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): support mysql 8 (#2961)
- Loading branch information
Showing
30 changed files
with
228 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
tests/features/schema-generator/__snapshots__/check-constraint.mysql.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`check constraint [mysql8] check constraint diff [mysql8]: mysql8-check-constraint-diff-1 1`] = ` | ||
"create table \`new_table\` (\`id\` int unsigned not null auto_increment primary key, \`priceColumn\` int not null, constraint foo check (priceColumn >= 0)) default character set utf8mb4 engine = InnoDB; | ||
" | ||
`; | ||
|
||
exports[`check constraint [mysql8] check constraint diff [mysql8]: mysql8-check-constraint-diff-2 1`] = ` | ||
"alter table \`new_table\` drop constraint foo; | ||
alter table \`new_table\` add constraint foo check(priceColumn > 0); | ||
" | ||
`; | ||
|
||
exports[`check constraint [mysql8] check constraint diff [mysql8]: mysql8-check-constraint-diff-3 1`] = ` | ||
"alter table \`new_table\` drop constraint foo; | ||
" | ||
`; | ||
|
||
exports[`check constraint [mysql8] check constraint diff [mysql8]: mysql8-check-constraint-diff-4 1`] = ` | ||
"alter table \`new_table\` add constraint bar check(priceColumn > 0); | ||
" | ||
`; | ||
|
||
exports[`check constraint [mysql8] check constraint diff [mysql8]: mysql8-check-constraint-diff-5 1`] = `""`; | ||
|
||
exports[`check constraint [mysql8] check constraint is generated for decorator [mysql8]: mysql8-check-constraint-decorator 1`] = ` | ||
"create table \`foo_entity\` (\`id\` int unsigned not null auto_increment primary key, \`price\` int not null, \`price2\` int not null, \`price3\` int not null, constraint foo_entity_price2_check check (price2 >= 0), constraint foo_entity_price3_check check (price3 >= 0), constraint foo_entity_check check (price >= 0)) default character set utf8mb4 engine = InnoDB; | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.