Skip to content

Commit

Permalink
build: remove default columns from previous migration
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jul 4, 2024
1 parent 5f13494 commit 53e3412
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
22 changes: 1 addition & 21 deletions src/backend/migrations/004-update-default-values.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,27 @@
-- Start a transaction
BEGIN;

-- Update mapping_issue_categories table
ALTER TABLE public.mapping_issue_categories
ALTER COLUMN archived SET DEFAULT false;

-- Update mbtiles_path table
ALTER TABLE public.mbtiles_path
ALTER COLUMN created_at SET DEFAULT now();

-- Update project_chat table
ALTER TABLE public.project_chat
ALTER COLUMN time_stamp SET DEFAULT now();

-- Update projects table
ALTER TABLE public.projects
ALTER COLUMN created SET DEFAULT now(),
ALTER COLUMN last_updated SET DEFAULT now(),
ALTER COLUMN status SET DEFAULT 'DRAFT',
ALTER COLUMN mapper_level SET DEFAULT 'INTERMEDIATE',
ALTER COLUMN priority SET DEFAULT 'MEDIUM',
ALTER COLUMN featured SET DEFAULT false,
ALTER COLUMN mapping_permission SET DEFAULT 'ANY',
ALTER COLUMN validation_permission SET DEFAULT 'LEVEL';
ALTER COLUMN featured SET DEFAULT false;

-- Update task_history table
ALTER TABLE public.task_history
ALTER COLUMN action_date SET DEFAULT now();

-- Update task_invalidation_history table
ALTER TABLE public.task_invalidation_history
ALTER COLUMN is_closed SET DEFAULT false,
ALTER COLUMN updated_date SET DEFAULT now();

-- Update tasks table
ALTER TABLE public.tasks
ALTER COLUMN task_status SET DEFAULT 'READY';

-- Update teams table
ALTER TABLE public.teams
ALTER COLUMN invite_only SET DEFAULT false,
ALTER COLUMN visibility SET DEFAULT 'PUBLIC';

-- Update user_roles table
ALTER TABLE public.user_roles
ALTER COLUMN role SET DEFAULT 'MAPPER';
Expand Down
22 changes: 1 addition & 21 deletions src/backend/migrations/revert/004-update-default-values.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,27 @@
-- Start a transaction
BEGIN;

-- Revert changes in mapping_issue_categories table
ALTER TABLE public.mapping_issue_categories
ALTER COLUMN archived DROP DEFAULT;

-- Revert changes in mbtiles_path table
ALTER TABLE public.mbtiles_path
ALTER COLUMN created_at DROP DEFAULT;

-- Revert changes in project_chat table
ALTER TABLE public.project_chat
ALTER COLUMN time_stamp DROP DEFAULT;

-- Revert changes in projects table
ALTER TABLE public.projects
ALTER COLUMN created DROP DEFAULT,
ALTER COLUMN last_updated DROP DEFAULT,
ALTER COLUMN status DROP DEFAULT,
ALTER COLUMN mapper_level DROP DEFAULT,
ALTER COLUMN priority DROP DEFAULT,
ALTER COLUMN featured DROP DEFAULT,
ALTER COLUMN mapping_permission DROP DEFAULT,
ALTER COLUMN validation_permission DROP DEFAULT;
ALTER COLUMN featured DROP DEFAULT;

-- Revert changes in task_history table
ALTER TABLE public.task_history
ALTER COLUMN action_date DROP DEFAULT;

-- Revert changes in task_invalidation_history table
ALTER TABLE public.task_invalidation_history
ALTER COLUMN is_closed DROP DEFAULT,
ALTER COLUMN updated_date DROP DEFAULT;

-- Revert changes in task_invalidation_history_id_seq table
ALTER TABLE public.task_invalidation_history_id_seq
ALTER COLUMN task_status DROP DEFAULT;

-- Revert changes in teams table
ALTER TABLE public.teams
ALTER COLUMN invite_only DROP DEFAULT,
ALTER COLUMN visibility DROP DEFAULT;

-- Revert changes in user_roles table
ALTER TABLE public.user_roles
ALTER COLUMN role DROP DEFAULT;
Expand Down

0 comments on commit 53e3412

Please sign in to comment.