feat: Add migration scripts for users and auth_tokens tables, including up and down operations
This commit is contained in:
@@ -275,16 +275,6 @@ func initDatabase(cfg *config.Config) (*gorm.DB, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Auto-migrate database tables
|
||||
err = db.AutoMigrate(
|
||||
&types.User{},
|
||||
&types.AuthToken{},
|
||||
&types.KnowledgeBase{},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to auto-migrate database tables: %v", err)
|
||||
}
|
||||
|
||||
// Run database migrations automatically (optional, can be disabled via env var)
|
||||
// To disable auto-migration, set AUTO_MIGRATE=false
|
||||
if os.Getenv("AUTO_MIGRATE") != "false" {
|
||||
|
||||
Reference in New Issue
Block a user