Files
blogflare/migrations/0001_add_series.sql
T

17 lines
610 B
SQL

-- Compatibility migration for installations that already used schema.sql.
-- The baseline now contains the final posts shape, so this migration must not
-- issue non-idempotent ALTER TABLE statements.
CREATE TABLE IF NOT EXISTS series (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE COLLATE NOCASE,
slug TEXT NOT NULL UNIQUE,
description TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_posts_series_order
ON posts(series_id, series_weight, published_at, id);
INSERT OR IGNORE INTO settings (key, value) VALUES ('alias.series', '系列');