-
Notifications
You must be signed in to change notification settings - Fork 17
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 #2416 from marklise/nobug-lf
NOBUG: Update line endings.
- Loading branch information
Showing
101 changed files
with
10,422 additions
and
10,421 deletions.
There are no files selected for viewing
1,394 changes: 697 additions & 697 deletions
1,394
epictrack-api/migrations/data/002-work_types.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,416 changes: 708 additions & 708 deletions
1,416
epictrack-api/migrations/data/002-work_types_update.json
Large diffs are not rendered by default.
Oops, something went wrong.
108 changes: 54 additions & 54 deletions
108
epictrack-api/migrations/versions/09a79ca8e8fd_add_none_ministry.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 |
---|---|---|
@@ -1,54 +1,54 @@ | ||
"""Add Not applicable ministry in ministries table | ||
Revision ID: 09a79ca8e8fd | ||
Revises: 65cb91595d6a | ||
Create Date: 2024-01-11 13:19:49.744798 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy import text | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '09a79ca8e8fd' | ||
down_revision = '65cb91595d6a' | ||
branch_labels = None | ||
depends_on = None | ||
na_ministry_name = "Not Applicable" | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
# check if not applicable ministry exists | ||
result = op.get_bind().execute(text(f"select * from ministries where name='{na_ministry_name}'")).fetchone() | ||
|
||
if not result: | ||
ministries = sa.table( | ||
'ministries', | ||
sa.Column('name', sa.String), | ||
sa.column('abbreviation', sa.String), | ||
sa.Column('is_active', sa.Boolean), | ||
sa.Column('is_deleted', sa.Boolean), | ||
sa.Column('sort_order', sa.Integer), | ||
) | ||
|
||
op.execute( | ||
ministries.insert().values( | ||
name=na_ministry_name, | ||
abbreviation='NA', | ||
is_active=True, | ||
is_deleted=False, | ||
sort_order=-1, | ||
) | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
op.execute(f"delete from ministries where name='{na_ministry_name}'") | ||
|
||
# ### end Alembic commands ### | ||
"""Add Not applicable ministry in ministries table | ||
Revision ID: 09a79ca8e8fd | ||
Revises: 65cb91595d6a | ||
Create Date: 2024-01-11 13:19:49.744798 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy import text | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '09a79ca8e8fd' | ||
down_revision = '65cb91595d6a' | ||
branch_labels = None | ||
depends_on = None | ||
na_ministry_name = "Not Applicable" | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
# check if not applicable ministry exists | ||
result = op.get_bind().execute(text(f"select * from ministries where name='{na_ministry_name}'")).fetchone() | ||
|
||
if not result: | ||
ministries = sa.table( | ||
'ministries', | ||
sa.Column('name', sa.String), | ||
sa.column('abbreviation', sa.String), | ||
sa.Column('is_active', sa.Boolean), | ||
sa.Column('is_deleted', sa.Boolean), | ||
sa.Column('sort_order', sa.Integer), | ||
) | ||
|
||
op.execute( | ||
ministries.insert().values( | ||
name=na_ministry_name, | ||
abbreviation='NA', | ||
is_active=True, | ||
is_deleted=False, | ||
sort_order=-1, | ||
) | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
op.execute(f"delete from ministries where name='{na_ministry_name}'") | ||
|
||
# ### end Alembic commands ### |
60 changes: 30 additions & 30 deletions
60
epictrack-api/migrations/versions/88b0bbb53b72_unique_abbreviation.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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
"""Add unique constraint to projects abbreviation | ||
Revision ID: 88b0bbb53b72 | ||
Revises: 03791c319e2b | ||
Create Date: 2023-12-05 11:34:09.723702 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '88b0bbb53b72' | ||
down_revision = '03791c319e2b' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('projects', schema=None) as batch_op: | ||
batch_op.create_unique_constraint('uq_projects_abbreviation', ['abbreviation']) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('projects', schema=None) as batch_op: | ||
batch_op.drop_constraint('uq_projects_abbreviation', type_='unique') | ||
# ### end Alembic commands ### | ||
"""Add unique constraint to projects abbreviation | ||
Revision ID: 88b0bbb53b72 | ||
Revises: 03791c319e2b | ||
Create Date: 2023-12-05 11:34:09.723702 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '88b0bbb53b72' | ||
down_revision = '03791c319e2b' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('projects', schema=None) as batch_op: | ||
batch_op.create_unique_constraint('uq_projects_abbreviation', ['abbreviation']) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('projects', schema=None) as batch_op: | ||
batch_op.drop_constraint('uq_projects_abbreviation', type_='unique') | ||
# ### end Alembic commands ### |
48 changes: 24 additions & 24 deletions
48
epictrack-api/migrations/versions/94d5aec71e37_staff_id_foreign_key_correction.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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
"""staff_id foreign key correction | ||
Revision ID: 94d5aec71e37 | ||
Revises: bc5314531502 | ||
Create Date: 2022-06-10 16:25:20.942697 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '94d5aec71e37' | ||
down_revision = 'bc5314531502' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
"""staff_id foreign key correction | ||
Revision ID: 94d5aec71e37 | ||
Revises: bc5314531502 | ||
Create Date: 2022-06-10 16:25:20.942697 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '94d5aec71e37' | ||
down_revision = 'bc5314531502' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint('engagements_staff_id_fkey', 'engagements', type_='foreignkey') | ||
op.create_foreign_key(None, 'engagements', 'staffs', ['staff_id'], ['id']) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'engagements', type_='foreignkey') | ||
op.create_foreign_key('engagements_staff_id_fkey', 'engagements', 'staff_work_roles', ['staff_id'], ['id']) | ||
# ### end Alembic commands ### | ||
# ### end Alembic commands ### |
48 changes: 24 additions & 24 deletions
48
epictrack-api/migrations/versions/a85a39851cab_staff_id_removed_from_engagement.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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
"""staff_id removed from engagement | ||
Revision ID: a85a39851cab | ||
Revises: 99dd99e4dbbc | ||
Create Date: 2022-07-21 21:01:30.719175 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'a85a39851cab' | ||
down_revision = '99dd99e4dbbc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
"""staff_id removed from engagement | ||
Revision ID: a85a39851cab | ||
Revises: 99dd99e4dbbc | ||
Create Date: 2022-07-21 21:01:30.719175 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'a85a39851cab' | ||
down_revision = '99dd99e4dbbc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint('engagements_staff_id_fkey', 'engagements', type_='foreignkey') | ||
op.drop_column('engagements', 'staff_id') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('engagements', sa.Column('staff_id', sa.INTEGER(), autoincrement=False, nullable=True)) | ||
op.create_foreign_key('engagements_staff_id_fkey', 'engagements', 'staffs', ['staff_id'], ['id']) | ||
# ### end Alembic commands ### | ||
# ### end Alembic commands ### |
Oops, something went wrong.