1 create table custom_emoji (
3 local_site_id int references local_site on update cascade on delete cascade not null,
4 shortcode varchar(128) not null UNIQUE,
5 image_url text not null UNIQUE,
6 alt_text text not null,
7 category text not null,
8 published timestamp without time zone default now() not null,
9 updated timestamp without time zone
12 create table custom_emoji_keyword (
13 id serial primary key,
14 custom_emoji_id int references custom_emoji on update cascade on delete cascade not null,
15 keyword varchar(128) not null,
16 UNIQUE (custom_emoji_id, keyword)
19 create index idx_custom_emoji_category on custom_emoji (id,category);