Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DB Migrations #1158

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deployment/hasura/migrations/AerieMerlin/19_users/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ comment on column merge_request.requester_username is e''
comment on column merge_request.reviewer_username is e''
'The user who reviews this merge request. Is empty until the request enters review.';

-- REMOVE SYSTEM USERS IF THEY WERE MISTAKENLY ADDED ABOVE
delete from metadata.users
where username = 'Aerie Legacy' or username = 'Mission Model';

-- UPDATE USERS ALLOWED ROLES
insert into metadata.users_allowed_roles(username, allowed_role)
select u.username, roles.role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ comment on function create_snapshot(integer, text, text) is e''
' - The tags on those activities'
' - When the snapshot was taken'
' - Optionally: who took the snapshot and a name';

call migrations.mark_migration_rolled_back('26');
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
alter table scheduling_goal
alter column description set default '',
alter column description set default '';
update scheduling_goal
set description = default
where description is null;
alter table scheduling_goal
alter column description set not null;

alter table scheduling_condition
alter column description set default '',
alter column description set default '';
update scheduling_condition
set description = default
where description is null;
alter table scheduling_condition
alter column description set not null;

call migrations.mark_migration_applied('7');
Loading