]> Untitled Git - lemmy.git/blob - migrations/2023-02-11-173347_custom_emojis/up.sql
Split activity table into sent and received parts (fixes #3103) (#3583)
[lemmy.git] / migrations / 2023-02-11-173347_custom_emojis / up.sql
1 create table custom_emoji (
2   id serial primary key,
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
10 );
11
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)
17 );
18
19 create index idx_custom_emoji_category on custom_emoji (id,category);