26 Commits

Author SHA1 Message Date
Nuno Cruces
00ab012234 fix: double quoted string literals in migrator (#183) 2024-03-09 17:29:55 +08: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
Samuel N Cui
139bd307e5 fix: AUTOINCREMENT flag cannot apply with PRIMARY KEY (#167)
* fix: AUTOINCREMENT flag cannot apply with PRIMARY KEY

* fix: migrator use ddl parser instead of regexp
2023-10-08 10:47:18 +08:00
black-06
9ac07d2974 fix: RenameIndex should drop old index (#151) 2023-06-07 15:07:57 +08:00
black-06
96a6beea7a fix: migrator run with nil schema (#147) 2023-05-19 18:48:11 +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
Jinzhu
1d1e772386 Fix look up field from DDL 2022-06-08 21:42:52 +08:00
Jinzhu
e61d1dd7d1 Fix alter column with custom creating table SQL, fix github.com/go-gorm/gorm/issues/4960 2022-06-08 20:17:48 +08:00
Jinzhu
ce06e3ba04 Improve Smart AutoMigrate 2022-02-19 21:56:09 +08:00
Jinzhu
3b89559a03 Fix sql IS NULL for some indexes 2022-02-18 16:54:59 +08:00
Jinzhu
1eac63ca6d Update Migrator ColumnType interface 2022-02-18 15:41:04 +08:00
glebarez
13fc63f18e patch for https://github.com/go-gorm/sqlite/issues/7 (#70)
Co-authored-by: Сахнов Глеб Андреевич <Sakhnov.G.An@sberbank.ru>
2021-12-16 10:43:34 +08:00
Jinzhu
55a60eb3a1 Support more separator, close #7 2021-11-30 10:19:46 +08:00
Jinzhu
105ba3aab7 Fix pass invalid arguments to recreate table 2021-11-23 13:59:08 +08:00
Jinzhu
568e7c693d Fix get tables 2021-11-12 17:54:32 +08:00
dino.ma
a07b7ec523 feat(migrator.go) : add GetTables method. (#65) 2021-11-12 17:51:37 +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
Jinzhu
250624840b Add stmt.Schema check 2021-07-13 21:07:39 +08:00
Florent Clairambault
459b36b583 Proper use of transaction in the sqlite migrator. (#9)
* Proper use of transaction in the sqlite migrator.

* Second part of the fix
2020-09-15 19:43:26 +08:00
Jinzhu
9cfe3353b1 Fix alter column 2020-09-01 20:52:38 +08:00
Manfred Touron
7ae6e7d479 fix: more explicit error when using sqlite driver with at least one constraint
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
2020-07-15 00:12:33 +02:00
Jinzhu
9cbff050ba Fix HasConstraint checker 2020-06-21 13:49:30 +08:00
Jinzhu
9f8fcade00 Add RunWithoutForeignKey 2020-06-21 10:39:25 +08:00
Jinzhu
ec93d563fe Fix HasColumn, HasIndex check 2020-06-05 17:06:49 +08:00
Jinzhu
558bcfb948 Fix HasColumn, HasIndex check 2020-06-05 17:00:59 +08:00
Jinzhu
284b563f81 Initalize 2020-06-02 09:53:23 +08:00