package updates import ( "github.com/go-gormigrate/gormigrate/v2" "gorm.io/gorm" ) // Folds PHP updates/v3.2.0/create_organisations_table.php. // // Phase 5 does not ALTER the users table — deferred to Phase 7's AUTH-02 per // 05-CONTEXT.md user-confirmed decision; this migration only creates the FK // target golem15_user_organisations table that Fonoteka's org credential // tables reference. var organisationsMigrations = []*gormigrate.Migration{ { ID: "202609180002_create_organisations", Migrate: func(tx *gorm.DB) error { return tx.Exec(` CREATE TABLE golem15_user_organisations ( id SERIAL PRIMARY KEY, slug TEXT NOT NULL UNIQUE, name TEXT NOT NULL, description TEXT, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() )`).Error }, Rollback: func(tx *gorm.DB) error { return tx.Exec("DROP TABLE IF EXISTS golem15_user_organisations").Error }, }, } func init() { Register(organisationsMigrations...) }