Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dataset_contributor' into datase…
Browse files Browse the repository at this point in the history
…t_contributor
  • Loading branch information
Aydawka committed Feb 21, 2024
2 parents 80c9e71 + 8c64c8d commit 1b5821f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 6 additions & 3 deletions alembic/versions/31703d707dfb_contributor_name_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@
Create Date: 2024-02-20 08:25:11.511833
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '31703d707dfb'
down_revision: Union[str, None] = '0defbfc71c59'
revision: str = "31703d707dfb"
down_revision: Union[str, None] = "0defbfc71c59"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.drop_column("dataset_contributor", "name")
op.add_column("dataset_contributor", sa.Column("family_name", sa.String, nullable=True))
op.add_column(
"dataset_contributor", sa.Column("family_name", sa.String, nullable=True)
)
op.add_column("dataset_contributor", sa.Column("given_name", sa.String))
op.execute("UPDATE dataset_contributor SET given_name = 'name'")
with op.batch_alter_table("dataset_contributor") as batch_op:
Expand Down
10 changes: 2 additions & 8 deletions apis/dataset_metadata/dataset_contributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def post(self, study_id: int, dataset_id: int):
"type": "string",
"minLength": 1,
},
"family_name": {
"type":
["string", "null"]
},
"family_name": {"type": ["string", "null"]},
"name_identifier": {
"type": "string",
"minLength": 1,
Expand Down Expand Up @@ -202,10 +199,7 @@ def post(self, study_id: int, dataset_id: int):
"type": "string",
"minLength": 1,
},
"family_name": {
"type":
["string", "null"]
},
"family_name": {"type": ["string", "null"]},
"name_identifier": {
"type": "string",
"minLength": 1,
Expand Down

0 comments on commit 1b5821f

Please sign in to comment.