mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
🎨 — Restructure alembic migration generated code
This commit is contained in:
parent
49f64b0054
commit
5703fb3341
1 changed files with 10 additions and 6 deletions
|
@ -7,8 +7,8 @@ Create Date: 2024-02-28 14:14:22.519918
|
|||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
@ -19,15 +19,19 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.execute("ALTER TYPE severity ADD VALUE 'unknown'")
|
||||
op.add_column('tasks', sa.Column('severity', sa.Enum('ok', 'warning', 'critical', 'unknown', name='severity'), nullable=False))
|
||||
op.add_column('tasks',
|
||||
sa.Column('severity',
|
||||
sa.Enum(
|
||||
'ok',
|
||||
'warning',
|
||||
'critical',
|
||||
'unknown',
|
||||
name='severity'),
|
||||
nullable=False))
|
||||
op.add_column('tasks', sa.Column('last_severity_update', sa.DateTime(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('tasks', 'last_severity_update')
|
||||
op.drop_column('tasks', 'severity')
|
||||
# ### end Alembic commands ###
|
||||
|
|
Loading…
Reference in a new issue