feat(backend): use jsonb instead of composite type arrays
This commit is contained in:
parent
f358a56053
commit
b8a7e7443d
14 changed files with 161 additions and 1467 deletions
24
scripts/migrate/006_jsonb_arrays.sql
Normal file
24
scripts/migrate/006_jsonb_arrays.sql
Normal file
|
@ -0,0 +1,24 @@
|
|||
-- +migrate Up
|
||||
|
||||
-- 2023-03-11: Change composite type arrays to use jsonb columns
|
||||
-- Composite types aren't actually supported by pgx and this allows us to drop pggen as a dev dependency.
|
||||
|
||||
-- Delete old columns
|
||||
alter table users drop column names;
|
||||
alter table users drop column pronouns;
|
||||
|
||||
alter table members drop column names;
|
||||
alter table members drop column pronouns;
|
||||
|
||||
alter table user_fields drop column entries;
|
||||
alter table member_fields drop column entries;
|
||||
|
||||
-- Create new columns
|
||||
alter table users add column names jsonb not null default '[]';
|
||||
alter table users add column pronouns jsonb not null default '[]';
|
||||
|
||||
alter table members add column names jsonb not null default '[]';
|
||||
alter table members add column pronouns jsonb not null default '[]';
|
||||
|
||||
alter table user_fields add column entries jsonb not null default '[]';
|
||||
alter table member_fields add column entries jsonb not null default '[]';
|
Loading…
Add table
Add a link
Reference in a new issue