aboutsummaryrefslogtreecommitdiffstats
path: root/migration
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-06-30 21:41:41 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-06-30 21:41:41 -0400
commitc13dd9addbf89f716e4ef5cfdf1d673139ffcb68 (patch)
treebc09646ce1d6d3a402abb4694e19da51b57204f6 /migration
downloaddonetick-c13dd9addbf89f716e4ef5cfdf1d673139ffcb68.tar.gz
donetick-c13dd9addbf89f716e4ef5cfdf1d673139ffcb68.tar.bz2
donetick-c13dd9addbf89f716e4ef5cfdf1d673139ffcb68.zip
Move to Donetick Org, first commit
Diffstat (limited to '')
-rw-r--r--migration/migration.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/migration/migration.go b/migration/migration.go
new file mode 100644
index 0000000..ee829a8
--- /dev/null
+++ b/migration/migration.go
@@ -0,0 +1,29 @@
+package migration
+
+import (
+ chModel "donetick.com/core/internal/chore/model"
+ cModel "donetick.com/core/internal/circle/model"
+ nModel "donetick.com/core/internal/notifier/model"
+ tModel "donetick.com/core/internal/thing/model"
+ uModel "donetick.com/core/internal/user/model"
+ "gorm.io/gorm"
+)
+
+func Migration(db *gorm.DB) error {
+ if err := db.AutoMigrate(uModel.User{}, chModel.Chore{},
+ chModel.ChoreHistory{},
+ cModel.Circle{},
+ cModel.UserCircle{},
+ chModel.ChoreAssignees{},
+ nModel.Notification{},
+ uModel.UserPasswordReset{},
+ tModel.Thing{},
+ tModel.ThingChore{},
+ tModel.ThingHistory{},
+ uModel.APIToken{},
+ ); err != nil {
+ return err
+ }
+
+ return nil
+}