Files
lilacbot/data/schema.sql
conatum f103dcf4d4 Update to new HoloTech core framework.
Functionally this adds the 'profiles' plugin, replaces the psqlmapper
with the submodule, and changes how data version checks are performed,
which is now the responsibility of the client.

The version history schema has changed, and the module schemas have been
removed from the schema initialisation file.
2026-07-22 15:23:35 +03:00

43 lines
880 B
PL/PgSQL

BEGIN;
-- Metadata {{{
CREATE TABLE version_history(
component TEXT NOT NULL,
from_version INTEGER NOT NULL,
to_version INTEGER NOT NULL,
author TEXT NOT NULL,
_timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
INSERT INTO version_history (component, from_version, to_version, author) VALUES ('ROOT', 0, 1, 'Initial Creation');
CREATE OR REPLACE FUNCTION update_timestamp_column()
RETURNS TRIGGER AS $$
BEGIN
NEW._timestamp = (now() at time zone 'utc');
RETURN NEW;
END;
$$ language 'plpgsql';
-- }}}
-- App metadata {{{
CREATE TABLE app_config(
appname TEXT PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE TABLE bot_config(
appname TEXT PRIMARY KEY REFERENCES app_config(appname) ON DELETE CASCADE,
sponsor_prompt TEXT,
sponsor_message TEXT,
default_skin TEXT
);
-- }}}
-- TODO: Profile data
COMMIT;
-- vim: set fdm=marker: