Skip to content

Commit

Permalink
Merge pull request #242 from GispoCoding/237-lhttieto-pvm-puuttuu-tie…
Browse files Browse the repository at this point in the history
…tomallista

Add detachment_date field to source_data table
  • Loading branch information
Rikuoja authored Mar 7, 2024
2 parents 0bac436 + 7db5ba7 commit 931a067
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""add_detachment_date_field_to_source_data_table
Revision ID: 0a8a2fecda2a
Revises: f085148de65d
Create Date: 2024-03-07 09:14:40.622499
"""
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

# import geoalchemy2


# revision identifiers, used by Alembic.
revision: str = "0a8a2fecda2a"
down_revision: Union[str, None] = "4ec52508acf1"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"source_data",
sa.Column("detachment_date", sa.DateTime(), nullable=False),
schema="hame",
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("source_data", "detachment_date", schema="hame")
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class SourceData(VersionedBase):
type_of_source_data = relationship("TypeOfSourceData", backref="source_data")
name: Mapped[language_str]
additional_information_uri: Mapped[str]
detachment_date: Mapped[datetime]


class Organisation(VersionedBase):
Expand Down

0 comments on commit 931a067

Please sign in to comment.