feat(03-01): initialize fonoteka workspace with user and genre migrations

Add compiled golem15.user and golem15.fonoteka plugins, squash schema
to the genre slice tables, and seed the 15 canonical genres on ICU pl-PL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-09-17 19:55:36 +02:00
commit f975ad94bb
5 changed files with 166 additions and 0 deletions

29
migrations.go Normal file
View File

@@ -0,0 +1,29 @@
package user
import (
"github.com/go-gormigrate/gormigrate/v2"
"gorm.io/gorm"
)
// Folds PHP updates/v1.0.1/create_users_table.php and
// updates/v3.2.1/add_must_change_password_to_users.php into the minimal
// columns the first vertical slice reads.
var migrations = []*gormigrate.Migration{
{
ID: "202609170001_create_users",
Migrate: func(tx *gorm.DB) error {
return tx.Exec(`
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL DEFAULT '',
must_change_password BOOLEAN NOT NULL DEFAULT FALSE,
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 users`).Error
},
},
}