ente/server/migrations/60_add_columns_cf.up.sql

13 lines
539 B
MySQL
Raw Normal View History

2024-03-01 08:07:01 +00:00
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';