full adjustment
This commit is contained in:
54
migrations/versions/876421e4eea2_adjustmen_of_bds.py
Normal file
54
migrations/versions/876421e4eea2_adjustmen_of_bds.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""adjustmen of BDs
|
||||
|
||||
Revision ID: 876421e4eea2
|
||||
Revises: c01f58ebc7d4
|
||||
Create Date: 2026-04-09 20:28:03.853032
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '876421e4eea2'
|
||||
down_revision: Union[str, None] = 'c01f58ebc7d4'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('edos', 'numero',
|
||||
existing_type=sa.INTEGER(),
|
||||
type_=sa.String(length=25),
|
||||
existing_nullable=False)
|
||||
op.alter_column('edos', 'fecha_definitivo',
|
||||
existing_type=sa.DATE(),
|
||||
nullable=True)
|
||||
op.alter_column('license', 'deleted_at',
|
||||
existing_type=postgresql.TIMESTAMP(timezone=True),
|
||||
nullable=True)
|
||||
op.drop_column('location', 'country_id')
|
||||
op.drop_column('location', 'city_id')
|
||||
op.drop_column('location', 'state_id')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('location', sa.Column('state_id', sa.INTEGER(), autoincrement=False, nullable=False))
|
||||
op.add_column('location', sa.Column('city_id', sa.INTEGER(), autoincrement=False, nullable=False))
|
||||
op.add_column('location', sa.Column('country_id', sa.INTEGER(), autoincrement=False, nullable=False))
|
||||
op.alter_column('license', 'deleted_at',
|
||||
existing_type=postgresql.TIMESTAMP(timezone=True),
|
||||
nullable=False)
|
||||
op.alter_column('edos', 'fecha_definitivo',
|
||||
existing_type=sa.DATE(),
|
||||
nullable=False)
|
||||
op.alter_column('edos', 'numero',
|
||||
existing_type=sa.String(length=25),
|
||||
type_=sa.INTEGER(),
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user