Files
sm-journal-plugin/updates/202610060007_add_author_slug_to_backend_users.go
Jakub Zych 9ae4b9141e feat(15-01): add journal categories, tags, settings, and author slug
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>
2026-10-06 18:28:17 +02:00

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...)
}