MCPcopy Create free account
hub / github.com/TruthHun/BookStack / RollbackMigration

Method RollbackMigration

commands/migrate/migrate_v03.go:109–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107}
108
109func (m *MigrationVersion03) RollbackMigration() error {
110 if !m.isValid {
111 return errors.New("The current version failed to verify.")
112 }
113 o := orm.NewOrm()
114 _, err := o.Raw("ALTER TABLE md_members DROP COLUMN auth_method").Exec()
115 if err != nil {
116 return err
117 }
118
119 _, err = o.Raw("DROP TABLE md_document_history").Exec()
120 if err != nil {
121 return err
122 }
123 _, err = o.Raw("DELETE md_options WHERE option_name = 'ENABLE_DOCUMENT_HISTORY'").Exec()
124
125 if err != nil {
126 return err
127 }
128
129 return nil
130}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected