Skip to content

Commit

Permalink
adding modified alembic script
Browse files Browse the repository at this point in the history
  • Loading branch information
Nargis Sultani committed Dec 4, 2023
1 parent 13b10c6 commit 0bd961c
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from alembic import op
import sqlalchemy as sa

from db_revisions.utils import table_exists


# revision identifiers, used by Alembic.
revision: str = "549c612bf1c9"
Expand All @@ -19,14 +21,15 @@


def upgrade() -> None:
op.create_table(
"federal_regulator",
sa.Column("id", sa.String(length=4), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("event_time", sa.DateTime(), server_default=sa.text("now()"), nullable=False),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
if not table_exists("federal_regulator"):
op.create_table(
"federal_regulator",
sa.Column("id", sa.String(length=4), nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("event_time", sa.DateTime(), server_default=sa.func.now(), nullable=False),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)


def downgrade() -> None:
Expand Down

0 comments on commit 0bd961c

Please sign in to comment.