pohja/schema/_schema.sql

31 lines
892 B
MySQL
Raw Normal View History

2024-02-03 14:08:03 +01:00
CREATE TABLE IF NOT EXISTS `migrations` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`table` TEXT NOT NULL,
`version` INTEGER NOT NULL,
`schemafile` TEXT NOT NULL,
`created` TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS `migrations_table` ON `migrations` (`table`, `version`);
CREATE INDEX IF NOT EXISTS `migrations_created` ON `migrations` (`created`);
CREATE TABLE IF NOT EXISTS `logs` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`level` TEXT NOT NULL,
`message` TEXT NOT NULL,
`context` TEXT,
`created` TEXT
);
CREATE INDEX IF NOT EXISTS `logs_level` ON `logs` (`level`, `created`);
CREATE TABLE IF NOT EXISTS `keyvalue` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`key` TEXT NOT NULL,
`channel` TEXT DEFAULT NULL,
`value` TEXT NOT NULL,
`created` TEXT NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS `keyvalue_key` ON `keyvalue` (`key`, `channel`);