lemmy/migrations/2023-02-11-173347_custom_emojis/up.sql
Anon 6bc49bdd70
Add Custom Emojis Support (#2616)
* Add Custom Emojis

* Modify index
2023-03-20 17:32:31 -04:00

19 lines
671 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);