]> Untitled Git - lemmy.git/blob - migrations/2023-06-06-104440_index_post_url/up.sql
Adding hot_rank columns in place of function sorting. (#2952)
[lemmy.git] / migrations / 2023-06-06-104440_index_post_url / up.sql
1 -- Make a hard limit of 512 for the post.url column
2 -- Truncate existing long rows.
3 update post set url = left(url, 512) where length(url) > 512;
4
5 -- Enforce the limit
6 alter table post alter column url type varchar (512);
7
8 -- Add the index
9 create index idx_post_url on post(url);