Skip to content

Commit

Permalink
Merge pull request #2416 from marklise/nobug-lf
Browse files Browse the repository at this point in the history
NOBUG: Update line endings.
  • Loading branch information
marklise authored Oct 22, 2024
2 parents a637559 + 4c201c6 commit 42971bb
Show file tree
Hide file tree
Showing 101 changed files with 10,422 additions and 10,421 deletions.
1,394 changes: 697 additions & 697 deletions epictrack-api/migrations/data/002-work_types.json

Large diffs are not rendered by default.

1,416 changes: 708 additions & 708 deletions epictrack-api/migrations/data/002-work_types_update.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions epictrack-api/migrations/versions/09a79ca8e8fd_add_none_ministry.py
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 ###
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 ###
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 ###
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 ###
Loading

0 comments on commit 42971bb

Please sign in to comment.