package db import ( mcdsldb "git.wntrmute.dev/mc/mcdsl/db" ) // Migrations is the ordered list of MCQ schema migrations. var Migrations = []mcdsldb.Migration{ { Version: 1, Name: "documents", SQL: ` CREATE TABLE IF NOT EXISTS documents ( id INTEGER PRIMARY KEY, slug TEXT NOT NULL UNIQUE, title TEXT NOT NULL, body TEXT NOT NULL, pushed_by TEXT NOT NULL, pushed_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), read INTEGER NOT NULL DEFAULT 0 );`, }, } // Migrate applies all pending migrations. func (d *DB) Migrate() error { return mcdsldb.Migrate(d.DB, Migrations) }