carlos / todomvc-bakeoff Public

Clone
git clone https://amadan.net/carlos/todomvc-bakeoff

Plain git — no account needed to clone.

Download

Download this file

1package todo
2
3import (
4 "embed"
5
6 "amadan.net/rastrillo/rastrillo/migrate"
7 "amadan.net/rastrillo/rastrillo/sessions"
8)
9
10//go:embed migrations/*.sql
11var migrationFS embed.FS
12
13// Schema is this app's own migrations, in order, and nothing else: it is
14// what `rastrillo migration generate` and `rastrillo migration check`
15// diff against Models. Migrations apply once at boot and are never
16// re-run or reversed; never edit one that has shipped, add a new one.
17var Schema = migrate.MustFromFS(migrationFS, "todo")
18
19// BootSchema is everything applied at boot: the sessions table first,
20// then the app's own. Subsystems go here, never in Schema, or check
21// would propose dropping their tables.
22var BootSchema = migrate.Merge(sessions.Schema, Schema)
23