Single-binary service: push raw markdown via REST/gRPC API, read rendered HTML through mobile-friendly web UI. MCIAS auth on all endpoints, SQLite storage, goldmark rendering with GFM and syntax highlighting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
657 B
Go
29 lines
657 B
Go
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)
|
|
}
|