Skip to content

Commit 4ba613a

Browse files
authored
Project libraries: Migrate to hack dao (#13)
1 parent 9e45762 commit 4ba613a

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/20200422-145650.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
alter table project_libraries add organization_id text default 'tmp' not null;
2+
update project_libraries set organization_id = (Select organization_id from projects where projects.id = project_id);
3+
delete from project_libraries where organization_id = 'tmp';
4+
alter table project_libraries alter column organization_id drop default;

scripts/20200422-150038.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
alter table project_libraries add updated_at timestamptz not null default now();
2+
alter table project_libraries add hash_code bigint default 0 not null;
3+
alter table project_libraries alter column hash_code drop default;
4+
5+
select schema_evolution_manager.create_updated_at_trigger('public', 'project_libraries');

0 commit comments

Comments
 (0)