Debug: wtf
Some checks failed
Some checks failed
This commit is contained in:
@@ -22,6 +22,22 @@ func InitDB(ctx context.Context, db *bun.DB) error {
|
||||
(*models.Image)(nil),
|
||||
(*models.Session)(nil),
|
||||
)
|
||||
} else {
|
||||
modls := []any{
|
||||
(*models.AliasImage)(nil),
|
||||
(*models.Alias)(nil),
|
||||
(*models.Image)(nil),
|
||||
(*models.Session)(nil),
|
||||
}
|
||||
for _, model := range modls {
|
||||
_, err := db.NewCreateTable().
|
||||
Model(model).
|
||||
IfNotExists().
|
||||
Exec(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user