ente/server/migrations/60_add_columns_cf.up.sql
2024-03-01 13:37:01 +05:30

13 lines
539 B
SQL

ALTER TABLE collection_files
ADD COLUMN IF NOT EXISTS c_owner_id bigint,
ADD COLUMN IF NOT EXISTS f_owner_id bigint,
ADD COLUMN IF NOT EXISTS created_at bigint;
-- set default after adding a colum otherwise for all existing rows we will end up setting wrong created_at time
ALTER TABLE collection_files
ALTER created_at SET DEFAULT now_utc_micro_seconds();
CREATE TYPE role_enum AS ENUM ('VIEWER', 'COLLABORATOR', 'OWNER');
ALTER TABLE collection_shares
ADD COLUMN IF NOT EXISTS role_type role_enum DEFAULT 'VIEWER';