Squash the remaining golem15_journal_* tables plus the backend_users author slug so a host migrate matches the frozen PHP schema. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
547 B
Go
23 lines
547 B
Go
package updates
|
|
|
|
import (
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var addAuthorSlug = []*gormigrate.Migration{
|
|
{
|
|
ID: "202610060007_add_author_slug_to_backend_users",
|
|
Migrate: func(tx *gorm.DB) error {
|
|
return tx.Exec(`ALTER TABLE backend_users ADD COLUMN IF NOT EXISTS golem15_bloghub_author_slug TEXT UNIQUE`).Error
|
|
},
|
|
Rollback: func(tx *gorm.DB) error {
|
|
return tx.Exec(`ALTER TABLE backend_users DROP COLUMN IF EXISTS golem15_bloghub_author_slug`).Error
|
|
},
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
Register(addAuthorSlug...)
|
|
}
|