mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-14 16:34:01 +00:00
be1389420b
* SQL format checking, 1. * SQL format checking, 2. * SQL format checking, 3. * SQL format checking, 4. * SQL format checking, 5. * Running pg_format * Getting rid of comment. * Upping pg_format version. * Using git ls-files for sql format check. * Fixing sql lints. * Addressing PR comments.
20 lines
697 B
SQL
20 lines
697 B
SQL
CREATE TABLE custom_emoji (
|
|
id serial PRIMARY KEY,
|
|
local_site_id int REFERENCES local_site ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
|
shortcode varchar(128) NOT NULL UNIQUE,
|
|
image_url text NOT NULL UNIQUE,
|
|
alt_text text NOT NULL,
|
|
category text NOT NULL,
|
|
published timestamp without time zone DEFAULT now() NOT NULL,
|
|
updated timestamp without time zone
|
|
);
|
|
|
|
CREATE TABLE custom_emoji_keyword (
|
|
id serial PRIMARY KEY,
|
|
custom_emoji_id int REFERENCES custom_emoji ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
|
keyword varchar(128) NOT NULL,
|
|
UNIQUE (custom_emoji_id, keyword)
|
|
);
|
|
|
|
CREATE INDEX idx_custom_emoji_category ON custom_emoji (id, category);
|
|
|