-
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.
Merge pull request #15 from Maxcutex/modify-employment-data
modify employment data with migration
- Loading branch information
Showing
8 changed files
with
233 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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
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
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,72 @@ | ||
"""empty message | ||
Revision ID: d893d7e95bd5 | ||
Revises: 4e41bd179702 | ||
Create Date: 2021-01-16 15:55:18.974323 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
from sqlalchemy.dialects import postgresql | ||
|
||
revision = "d893d7e95bd5" | ||
down_revision = "4e41bd179702" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
employment_type_enum = postgresql.ENUM( | ||
"full", "part", "contract", name="employment_type_enum" | ||
) | ||
employment_type_enum.create(op.get_bind()) | ||
|
||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"user_employments", sa.Column("accomplishments", sa.Text(), nullable=False) | ||
) | ||
op.add_column( | ||
"user_employments", | ||
sa.Column( | ||
"employment_type", | ||
sa.Enum("full", "part", "contract", name="employment_type_enum"), | ||
nullable=True, | ||
), | ||
) | ||
op.add_column( | ||
"user_employments", sa.Column("institution_city", sa.String(), nullable=False) | ||
) | ||
op.add_column( | ||
"user_employments", | ||
sa.Column("institution_country", sa.String(), nullable=False), | ||
) | ||
op.add_column( | ||
"user_employments", sa.Column("institution_size", sa.String(), nullable=False) | ||
) | ||
op.add_column( | ||
"user_employments", sa.Column("institution_url", sa.String(), nullable=False) | ||
) | ||
op.add_column( | ||
"user_employments", sa.Column("work_summary", sa.Text(), nullable=False) | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("user_employments", "work_summary") | ||
op.drop_column("user_employments", "institution_url") | ||
op.drop_column("user_employments", "institution_size") | ||
op.drop_column("user_employments", "institution_country") | ||
op.drop_column("user_employments", "institution_city") | ||
op.drop_column("user_employments", "employment_type") | ||
op.drop_column("user_employments", "accomplishments") | ||
|
||
employment_type_enum = postgresql.ENUM( | ||
"full", "part", "contract", name="employment_type_enum" | ||
) | ||
employment_type_enum.drop(op.get_bind()) | ||
# ### 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
Oops, something went wrong.