Skip to content

Commit

Permalink
alembic revision docstring and pylint ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpbc committed Feb 5, 2025
1 parent b36655a commit 45948cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions alembic/script.py.mako
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""${message}
# pylint: disable=invalid-name
"""${message if message.endswith(".") else message + "."}

Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Expand All @@ -9,16 +10,20 @@ from alembic import op
import sqlalchemy as sa
${imports if imports else ""}

# pylint: disable=no-member

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}


def upgrade():
def upgrade() -> None:
"""Upgrade the database."""
${upgrades if upgrades else "pass"}


def downgrade():
def downgrade() -> None:
"""Downgrade the database."""
${downgrades if downgrades else "pass"}
11 changes: 8 additions & 3 deletions alembic/versions/9f4b6184b2f8_drop_usage_pkey.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""drop_usage_pkey
# pylint: disable=invalid-name
"""Drop the primary key of the usage table.
Revision ID: 9f4b6184b2f8
Revises: b65796c99771
Expand All @@ -8,20 +9,24 @@

from alembic import op

# pylint: disable=no-member

# revision identifiers, used by Alembic.
revision = "9f4b6184b2f8"
down_revision = "b65796c99771"
branch_labels = None
depends_on = None


def upgrade():
def upgrade() -> None:
"""Upgrade the database."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint("usage_pkey", "usage", type_="primary", schema="accounting")
# ### end Alembic commands ###


def downgrade():
def downgrade() -> None:
"""Downgrade the database."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_primary_key("usage_pkey", "usage", ["id"], schema="accounting")
# ### end Alembic commands ###

0 comments on commit 45948cb

Please sign in to comment.