Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat non-constant UUID defaults as no default.
If the database has a default which is not a constant value, Slick is not able to represent the fact that the default for a column is a computed value. In the case of UUIDs, this change will mean that if the UUID default is given as an SQL function (for example, to generate a UUID), Slick will instead treat the column as not having a default.
- Loading branch information
Showing
6 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
...estkit/src/codegen/resources/dbs/uuid.sql → ...kit/src/codegen/resources/dbs/uuid-h2.sql
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
create table "person" ("id" INTEGER NOT NULL PRIMARY KEY, | ||
"uuid" UUID NOT NULL, | ||
"uuid_def" UUID DEFAULT('2f3f866c-d8e6-11e2-bb56-50e549c9b654')); | ||
"uuid_def" UUID DEFAULT('2f3f866c-d8e6-11e2-bb56-50e549c9b654'), | ||
"uuid_func" UUID DEFAULT random_uuid() | ||
); |
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,5 @@ | ||
create table "person" ("id" INTEGER NOT NULL PRIMARY KEY, | ||
"uuid" UUID NOT NULL, | ||
"uuid_def" UUID DEFAULT('2f3f866c-d8e6-11e2-bb56-50e549c9b654'), | ||
"uuid_func" UUID DEFAULT uuid_generate_v4() | ||
); |
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