-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New migration script for Metric value not nullable
- Loading branch information
1 parent
31bc16f
commit 536d3a1
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
migration/alembic/versions/943ea08a8a82_making_value_from_metric_nullable.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |