MCPcopy Index your code
hub / github.com/TruthHun/BookStack / AddMigrationRecord

Method AddMigrationRecord

commands/migrate/migrate_v03.go:85–102  ·  view source on GitHub ↗
(version int64)

Source from the content-addressed store, hash-verified

83}
84
85func (m *MigrationVersion03) AddMigrationRecord(version int64) error {
86 o := orm.NewOrm()
87 tables, err := ExportDatabaseTable()
88
89 if err != nil {
90 return err
91 }
92 migration := models.NewMigration()
93 migration.Version = version
94 migration.Status = "update"
95 migration.CreateTime = time.Now()
96 migration.Name = fmt.Sprintf("update_%d", version)
97 migration.Statements = strings.Join(tables, "\r\n")
98
99 _, err = o.Insert(migration)
100
101 return err
102}
103
104func (m *MigrationVersion03) MigrationCleanup() error {
105

Callers

nothing calls this directly

Calls 3

NewMigrationFunction · 0.92
ExportDatabaseTableFunction · 0.85
InsertMethod · 0.45

Tested by

no test coverage detected