Skip to content

Commit

Permalink
Include a db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzrrGit committed Jul 8, 2024
1 parent b133efa commit e2dbb8d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deployment/hasura/migrations/Aerie/8_span_event_linkage/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- event table revert
alter table merlin.event
drop column span_index;

-- span table revert
alter table merlin.span
drop constraint dataset_span_index_unique;

alter table merlin.span
drop column span_index;

15 changes: 15 additions & 0 deletions deployment/hasura/migrations/Aerie/8_span_event_linkage/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- Span Table update
alter table merlin.span
add column span_index integer;

update merlin.span
set span_index = id;

alter table merlin.span
alter column span_index set not null,
add constraint dataset_span_index_unique
unique (dataset_id, span_index);

-- event table update
alter table merlin.event
add column span_index integer not null;

0 comments on commit e2dbb8d

Please sign in to comment.