Commit Graph

20 Commits

Author SHA1 Message Date
glebarez
a871805cb6 Merge upstream 2024-03-14 09:36:01 +03:00
black-06
87158cf45d refactor: distinguish between Unique and UniqueIndex (#156)
* refactor: distinguish between Unique and UniqueIndex

* take care of unique created by old version

* update gorm to master latest (for https://github.com/go-gorm/gorm/pull/6386)

* merge
2024-02-06 11:39:22 +08:00
yx179971
869dd96541 fix ddl from exists table (#172) 2023-12-06 22:51:33 +03:00
yx179971
e64f7a5816 fix ddl from exists table (#172) 2023-11-22 11:14:29 +08:00
ChrisPortman
74475fc966 Issue #158 SQLite fields are nullible unless NOT NULL (#159)
This change sets the default value of ColumnType.Nullable() to true.  If
the column is explicitly `MOT NULL` then it will be set false.

This is consistent with the SQLite documentation:
https://www.sqlitetutorial.net/sqlite-not-null-constraint/

Co-authored-by: Chris Carter <chris.carter@spinlocksecurity.com>
2023-10-08 10:52:14 +08:00
Jeff Ortel
397ec6fa8c Fix columnType.Unique() returns true for non-unique index DDL. (#154)
Signed-off-by: Jeff Ortel <jortel@redhat.com>
2023-06-09 10:20:12 +08:00
Rico
5acf810258 Fix two regexes related to SQL create statement parsing (#140)
* fix: use \s in tableRegexp to match multiline create statements

* fix: improve tableReg regex to correctly match table name

* tests: add test cases for different spacing cases
2023-04-21 22:26:43 +08:00
black-06
07da3b307c fix parse unique index (#138) 2023-04-11 11:22:16 +08:00
Jinzhu
c86933bc77 Fix parse ddl with newline, close #94 2022-10-09 11:03:43 +08:00
zakaria chahboun
2573b11112 ignore generated columns when [recreateTable] (#109)
* ignore generated columns when recreateTable

Co-authored-by: Jinzhu <wosmvp@gmail.com>
2022-10-08 11:09:38 +08:00
Jinzhu
7c8ddeee3d Fix tests 2022-07-06 13:58:11 +08:00
Cr
bfea836753 fix(parseDDL): default value valid should be false if not set (#105) 2022-07-06 11:07:42 +08:00
cncal
fd0b69072c bugfix: parseDDL cannot recognize the table name with dash (#104) 2022-07-06 11:03:16 +08:00
Jinzhu
64917553e8 Remove unnecessary requirements 2022-06-29 09:53:23 +08:00
Cr
02ecc06a65 fix(parseDDL): columntype differentiate datatype and lengthvalue (#101)
* fix(parseDDL): columntype differentiate datatype and lengthvalue

* test: fix test
2022-06-29 09:47:09 +08:00
Trock
d34fe2a768 fix: parseDDL index out of range when characters take up more than one byte (#91) 2022-04-26 10:31:35 +08:00
duc
0a99da578e fix parseDDL bug with escaped quote (#89) 2022-04-24 12:48:18 +08:00
Jinzhu
83d4b5438a Improve support for AutoMigrate 2022-02-19 23:51:13 +08:00
Jinzhu
1eac63ca6d Update Migrator ColumnType interface 2022-02-18 15:41:04 +08:00
ThetaDev
2a8115147a Implemented adding/removing constraints (#55)
* Add CreateConstraint function

* Refactored to recreateTable function

* fix determining constraint name
2021-10-08 17:29:27 +08:00