Skip to content

Commit 53be622

Browse files
authored
Merge pull request #1469 from NASA-AMMOS/feature/sequence-adaptation-names
Added sequence adaptation names
2 parents 7a2ad4b + 4777eb6 commit 53be622

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

deployment/hasura/metadata/databases/tables/sequencing/sequence_adaptation.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ table:
22
name: sequence_adaptation
33
schema: sequencing
44
configuration:
5-
custom_name: "sequence_adaptation"
5+
custom_name: "sequence_adaptation"
66
select_permissions:
77
- role: aerie_admin
88
permission:
@@ -22,15 +22,15 @@ select_permissions:
2222
insert_permissions:
2323
- role: aerie_admin
2424
permission:
25-
columns: [adaptation]
25+
columns: [adaptation, name]
2626
check: {}
2727
set:
2828
owner: "x-hasura-user-id"
2929
updated_by: "x-hasura-user-id"
3030
update_permissions:
3131
- role: aerie_admin
3232
permission:
33-
columns: [adaptation, owner]
33+
columns: [adaptation, name, owner]
3434
filter: {}
3535
set:
3636
updated_by: "x-hasura-user-id"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
alter table sequencing.sequence_adaptation
2+
drop constraint sequence_adaptation_natural_key,
3+
drop column name;
4+
5+
call migrations.mark_migration_rolled_back('5');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
alter table sequencing.sequence_adaptation
2+
add column name text not null,
3+
add constraint sequence_adaptation_natural_key
4+
unique (name);
5+
6+
comment on column sequencing.sequence_adaptation.name is e''
7+
'The name of the sequence adaptation.';
8+
9+
call migrations.mark_migration_applied('5');

deployment/postgres-init-db/sql/applied_migrations.sql

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ call migrations.mark_migration_applied('1');
77
call migrations.mark_migration_applied('2');
88
call migrations.mark_migration_applied('3');
99
call migrations.mark_migration_applied('4');
10+
call migrations.mark_migration_applied('5');

deployment/postgres-init-db/sql/tables/sequencing/sequence_adaptation.sql

+5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
create table sequencing.sequence_adaptation (
22
id integer generated always as identity,
33
adaptation text not null,
4+
name text not null,
45
created_at timestamptz not null default now(),
56
owner text,
67
updated_at timestamptz not null default now(),
78
updated_by text,
89

910
constraint sequence_adaptation_synthetic_key
1011
primary key (id),
12+
constraint sequence_adaptation_natural_key
13+
unique (name),
1114
foreign key (owner)
1215
references permissions.users
1316
on update cascade
@@ -22,6 +25,8 @@ comment on table sequencing.sequence_adaptation is e''
2225
'A custom adaptation used to overwrite variable and linting rules for the sequence editor';
2326
comment on column sequencing.sequence_adaptation.adaptation is e''
2427
'The sequencing adaptation code.';
28+
comment on column sequencing.sequence_adaptation.name is e''
29+
'The name of the sequence adaptation.';
2530

2631
create trigger set_timestamp
2732
before update on sequencing.sequence_adaptation

0 commit comments

Comments
 (0)