mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-09 01:18:04 +02:00
Add topics for Gists (#413)
This commit is contained in:
@ -144,7 +144,7 @@ func Setup(dbUri string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = db.AutoMigrate(&User{}, &Gist{}, &SSHKey{}, &AdminSetting{}, &Invitation{}, &WebAuthnCredential{}, &TOTP{}); err != nil {
|
||||
if err = db.AutoMigrate(&User{}, &Gist{}, &SSHKey{}, &AdminSetting{}, &Invitation{}, &WebAuthnCredential{}, &TOTP{}, &GistTopic{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ func setupSQLite(dbInfo databaseInfo) error {
|
||||
|
||||
u.Scheme = "file"
|
||||
q := u.Query()
|
||||
q.Set("_fk", "true")
|
||||
q.Set("_pragma", "foreign_keys(1)")
|
||||
q.Set("_journal_mode", journalMode)
|
||||
u.RawQuery = q.Encode()
|
||||
dsn = u.String()
|
||||
@ -258,5 +258,5 @@ func DeprecationDBFilename() {
|
||||
}
|
||||
|
||||
func TruncateDatabase() error {
|
||||
return db.Migrator().DropTable("likes", &User{}, "gists", &SSHKey{}, &AdminSetting{}, &Invitation{}, &WebAuthnCredential{}, &TOTP{})
|
||||
return db.Migrator().DropTable("likes", &User{}, "gists", &SSHKey{}, &AdminSetting{}, &Invitation{}, &WebAuthnCredential{}, &TOTP{}, &GistTopic{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user