68_add_locker_changes.down.sql 534 B

1234567891011121314151617181920
  1. -- Drop the new unique index
  2. DROP INDEX IF EXISTS collections_uncategorized_constraint_index_v2;
  3. -- Re-create the old unique index
  4. CREATE UNIQUE INDEX IF NOT EXISTS collections_uncategorized_constraint_index ON collections (owner_id, app)
  5. WHERE (type = 'uncategorized');
  6. -- Remove NOT NULL constraints
  7. ALTER TABLE collections ALTER COLUMN app DROP NOT NULL;
  8. -- Remove default values
  9. ALTER TABLE collections ALTER COLUMN app DROP DEFAULT;
  10. -- Update columns back to NULL
  11. UPDATE collections SET app = NULL WHERE app = 'photos';