The tables of Tayori, in a migration of the app.
$ mix tayori.gen.migration
writes a migration that pins the latest version:
defmodule MyApp.Repo.Migrations.AddTayori do
use Ecto.Migration
def up, do: Tayori.Migrations.up(version: 1)
def down, do: Tayori.Migrations.down(to: 0)
endThe versions are PhoenixMountable.Migrations: tracked in the app's
database (per prefix), checked when the admin is first used, and run on
PostgreSQL and on SQLite. A later version of Tayori that changes the
tables has a version 2; mix tayori.gen.migration then writes the
migration that upgrades.
The tables (version 1):
tayori_entries- an entry of the news: its slug, categories, the segments of readers it is for, and when it is published (nil while it is a draft);tayori_translations- the title, summary and body of an entry, one row for each language;tayori_reads- for each reader, when they last saw the news;tayori_settings- the settings of the admin, such as the AI model and its key, encrypted.
up/1 takes :version and :prefix (the schema of the tables, in
PostgreSQL); down/1 takes :to and :prefix.
Summary
Functions
:ok, {:pending, message} or {:outdated, message}. Takes :repo and :prefix.
Rolls the library's tables back to :to (default 0). Call it from a host migration.
The latest version of the library's schema.
The version the database is at (0 when not installed).
Runs deferred backfills to completion. Takes :repo and :prefix.
The version, compatibility and backfills of a database. Takes :repo and :prefix.
Migrates the library's tables up. Call it from a host migration.
Checks the tables against the library's schema. Takes :repo and :prefix.
Functions
:ok, {:pending, message} or {:outdated, message}. Takes :repo and :prefix.
Rolls the library's tables back to :to (default 0). Call it from a host migration.
The latest version of the library's schema.
The version the database is at (0 when not installed).
Runs deferred backfills to completion. Takes :repo and :prefix.
The version, compatibility and backfills of a database. Takes :repo and :prefix.
Migrates the library's tables up. Call it from a host migration.
Checks the tables against the library's schema. Takes :repo and :prefix.