-
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.
- Loading branch information
Showing
2 changed files
with
237 additions
and
61 deletions.
There are no files selected for viewing
182 changes: 182 additions & 0 deletions
182
gestao/db/migrations/versions/2023-11-30-03-32_dd095623222c.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,182 @@ | ||
"""empty message | ||
Revision ID: dd095623222c | ||
Revises: 89f33fa986f8 | ||
Create Date: 2023-11-30 03:32:28.929786 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'dd095623222c' | ||
down_revision = '89f33fa986f8' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('dependent', 'user_id', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=True) | ||
op.alter_column('dependent', 'cpf', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=False) | ||
op.alter_column('dependent', 'gender', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=False) | ||
op.alter_column('dependent', 'phone', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=False) | ||
op.alter_column('dependent', 'created_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=True, | ||
existing_server_default=sa.text('now()')) | ||
op.alter_column('dependent', 'updated_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=True, | ||
existing_server_default=sa.text('now()')) | ||
op.add_column('user', sa.Column('fullName', sa.String(length=200), nullable=False)) | ||
op.add_column('user', sa.Column('warName', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('birthDate', sa.Date(), nullable=False)) | ||
op.add_column('user', sa.Column('placeOfBirth', sa.String(length=200), nullable=False)) | ||
op.add_column('user', sa.Column('ufNatural', sa.String(length=100), nullable=False)) | ||
op.add_column('user', sa.Column('civilState', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('cep', sa.String(length=100), nullable=False)) | ||
op.add_column('user', sa.Column('number', sa.String(length=100), nullable=True)) | ||
op.add_column('user', sa.Column('complement', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('uf', sa.String(length=100), nullable=False)) | ||
op.add_column('user', sa.Column('cellphone', sa.String(length=200), nullable=False)) | ||
op.add_column('user', sa.Column('motherName', sa.String(length=200), nullable=False)) | ||
op.add_column('user', sa.Column('fatherName', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('scolarity', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('bloodType', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('actualWorkSituation', sa.String(length=200), nullable=False)) | ||
op.add_column('user', sa.Column('admissionDate', sa.Date(), nullable=False)) | ||
op.add_column('user', sa.Column('jobRole', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('bodyOfLaw', sa.String(length=200), nullable=False)) | ||
op.add_column('user', sa.Column('lotation', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('workPost', sa.String(length=200), nullable=True)) | ||
op.add_column('user', sa.Column('systemRole', sa.String(length=200), nullable=True)) | ||
op.alter_column('user', 'neighborhood', | ||
existing_type=sa.VARCHAR(length=200), | ||
type_=sa.String(length=100), | ||
nullable=True) | ||
op.alter_column('user', 'phone', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=True) | ||
op.alter_column('user', 'created_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=True, | ||
existing_server_default=sa.text('now()')) | ||
op.alter_column('user', 'updated_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=True, | ||
existing_server_default=sa.text('now()')) | ||
op.drop_column('user', 'dispatched_date') | ||
op.drop_column('user', 'marital_status') | ||
op.drop_column('user', 'state') | ||
op.drop_column('user', 'name') | ||
op.drop_column('user', 'blood_type') | ||
op.drop_column('user', 'father_name') | ||
op.drop_column('user', 'category') | ||
op.drop_column('user', 'mother_name') | ||
op.drop_column('user', 'pattern') | ||
op.drop_column('user', 'position') | ||
op.drop_column('user', 'zipcode') | ||
op.drop_column('user', 'place_of_birth') | ||
op.drop_column('user', 'role') | ||
op.drop_column('user', 'dispatcher') | ||
op.drop_column('user', 'education') | ||
op.drop_column('user', 'birth_date') | ||
op.drop_column('user', 'situation') | ||
op.drop_column('user', 'occupancy') | ||
op.drop_column('user', 'admission_date') | ||
op.drop_column('user', 'workstation') | ||
op.drop_column('user', 'nickname') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('user', sa.Column('nickname', sa.VARCHAR(length=200), autoincrement=False, nullable=True)) | ||
op.add_column('user', sa.Column('workstation', sa.VARCHAR(length=200), autoincrement=False, nullable=True)) | ||
op.add_column('user', sa.Column('admission_date', sa.DATE(), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('occupancy', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('situation', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('birth_date', sa.DATE(), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('education', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('dispatcher', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('role', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('place_of_birth', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('zipcode', sa.VARCHAR(length=100), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('position', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('pattern', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('mother_name', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('category', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('father_name', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('blood_type', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('name', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('state', sa.VARCHAR(length=100), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('marital_status', sa.VARCHAR(length=200), autoincrement=False, nullable=False)) | ||
op.add_column('user', sa.Column('dispatched_date', sa.DATE(), autoincrement=False, nullable=False)) | ||
op.alter_column('user', 'updated_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=False, | ||
existing_server_default=sa.text('now()')) | ||
op.alter_column('user', 'created_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=False, | ||
existing_server_default=sa.text('now()')) | ||
op.alter_column('user', 'phone', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=False) | ||
op.alter_column('user', 'neighborhood', | ||
existing_type=sa.String(length=100), | ||
type_=sa.VARCHAR(length=200), | ||
nullable=False) | ||
op.drop_column('user', 'systemRole') | ||
op.drop_column('user', 'workPost') | ||
op.drop_column('user', 'lotation') | ||
op.drop_column('user', 'bodyOfLaw') | ||
op.drop_column('user', 'jobRole') | ||
op.drop_column('user', 'admissionDate') | ||
op.drop_column('user', 'actualWorkSituation') | ||
op.drop_column('user', 'bloodType') | ||
op.drop_column('user', 'scolarity') | ||
op.drop_column('user', 'fatherName') | ||
op.drop_column('user', 'motherName') | ||
op.drop_column('user', 'cellphone') | ||
op.drop_column('user', 'uf') | ||
op.drop_column('user', 'complement') | ||
op.drop_column('user', 'number') | ||
op.drop_column('user', 'cep') | ||
op.drop_column('user', 'civilState') | ||
op.drop_column('user', 'ufNatural') | ||
op.drop_column('user', 'placeOfBirth') | ||
op.drop_column('user', 'birthDate') | ||
op.drop_column('user', 'warName') | ||
op.drop_column('user', 'fullName') | ||
op.alter_column('dependent', 'updated_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=False, | ||
existing_server_default=sa.text('now()')) | ||
op.alter_column('dependent', 'created_at', | ||
existing_type=postgresql.TIMESTAMP(timezone=True), | ||
nullable=False, | ||
existing_server_default=sa.text('now()')) | ||
op.alter_column('dependent', 'phone', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=True) | ||
op.alter_column('dependent', 'gender', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=True) | ||
op.alter_column('dependent', 'cpf', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=True) | ||
op.alter_column('dependent', 'user_id', | ||
existing_type=sa.VARCHAR(length=200), | ||
nullable=False) | ||
# ### end Alembic commands ### |
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