Download this file
| 1 | package todo |
| 2 | |
| 3 | import ( |
| 4 | "embed" |
| 5 | |
| 6 | "amadan.net/rastrillo/rastrillo/migrate" |
| 7 | "amadan.net/rastrillo/rastrillo/sessions" |
| 8 | ) |
| 9 | |
| 10 | //go:embed migrations/*.sql |
| 11 | var 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. |
| 17 | var 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. |
| 22 | var BootSchema = migrate.Merge(sessions.Schema, Schema) |
| 23 | |