Skip to content

Commit

Permalink
New migration script for Metric value not nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstretenowich committed Nov 19, 2024
1 parent 31bc16f commit 536d3a1
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Making value from Metric nullable
Revision ID: 943ea08a8a82
Revises: d1dc98f61aee
Create Date: 2024-11-19 14:53:47.781164
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from alembic_utils.pg_grant_table import PGGrantTable
from sqlalchemy import text as sql_text

# revision identifiers, used by Alembic.
revision: str = '943ea08a8a82'
down_revision: Union[str, None] = 'd1dc98f61aee'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.alter_column('metric', 'value',
existing_type=sa.VARCHAR(),
nullable=True)


def downgrade() -> None:
op.alter_column('metric', 'value',
existing_type=sa.VARCHAR(),
nullable=False)

0 comments on commit 536d3a1

Please sign in to comment.