rDrama/migrations/20221213-convert-shadowbann...

5 lines
409 B
MySQL
Raw Normal View History

2022-12-13 19:03:14 +00:00
update users u set shadowbanned=(select id from users f where username=u.shadowbanned) where shadowbanned is not null;
2022-12-13 18:50:38 +00:00
alter table users alter column shadowbanned type int using shadowbanned::integer;
create index fki_user_shadowbanned_fkey on public.users using btree (shadowbanned);
alter table only public.users add constraint user_shadowbanned_fkey foreign key (shadowbanned) references public.users(id);