Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def db_engine(monkeymodule) -> Engine:
:returns Engine: Engine for use in other setup fixtures
"""
# SQLite doesnt support schemas, so remove pixl schema from engine options
execution_options = {"schema_translate_map": {"pipeline": None}}
execution_options = {"schema_translate_map": {"pixl_pipeline": None}}
engine = create_engine(
"sqlite:///:memory:",
execution_options=execution_options,
Expand Down
2 changes: 1 addition & 1 deletion pixl_core/src/core/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class Base(DeclarativeBase):
"""sqlalchemy base class"""

metadata = MetaData(schema="pipeline")
metadata = MetaData(schema="pixl_pipeline")


class Extract(Base):
Expand Down
2 changes: 1 addition & 1 deletion pixl_core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def db_engine(monkeymodule) -> Generator[Engine, None, None]:
:returns Engine: Engine for use in other setup fixtures
"""
# SQLite doesnt support schemas, so remove pixl schema from engine options
execution_options = {"schema_translate_map": {"pipeline": None}}
execution_options = {"schema_translate_map": {"pixl_pipeline": None}}
engine = create_engine(
"sqlite:///:memory:",
execution_options=execution_options,
Expand Down
2 changes: 1 addition & 1 deletion pixl_dcmd/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def db_engine(monkeymodule) -> Generator[Engine, None, None]:
:returns Engine: Engine for use in other setup fixtures
"""
# SQLite doesnt support schemas, so remove pixl schema from engine options
execution_options = {"schema_translate_map": {"pipeline": None}}
execution_options = {"schema_translate_map": {"pixl_pipeline": None}}
engine = create_engine(
"sqlite:///:memory:",
execution_options=execution_options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@

def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("image", sa.Column("study_uid", sa.String(), nullable=True), schema="pipeline")
op.add_column(
"image", sa.Column("study_uid", sa.String(), nullable=True), schema="pixl_pipeline"
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("image", "study_uid", schema="pipeline")
op.drop_column("image", "study_uid", schema="pixl_pipeline")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def upgrade() -> None:
sa.Column("extract_id", sa.Integer(), nullable=False),
sa.Column("slug", sa.String(), nullable=False),
sa.PrimaryKeyConstraint("extract_id"),
schema="pipeline",
schema="pixl_pipeline",
)
op.create_table(
"image",
Expand All @@ -52,13 +52,13 @@ def upgrade() -> None:
sa.Column("extract_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["extract_id"],
["pipeline.extract.extract_id"],
["pixl_pipeline.extract.extract_id"],
),
sa.PrimaryKeyConstraint("image_id"),
schema="pipeline",
schema="pixl_pipeline",
)


def downgrade() -> None:
op.drop_table("image", schema="pipeline")
op.drop_table("extract", schema="pipeline")
op.drop_table("image", schema="pixl_pipeline")
op.drop_table("extract", schema="pixl_pipeline")
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@

def upgrade() -> None:
op.alter_column(
"image", "hashed_identifier", new_column_name="pseudo_study_uid", schema="pipeline"
"image", "hashed_identifier", new_column_name="pseudo_study_uid", schema="pixl_pipeline"
)


def downgrade() -> None:
op.alter_column(
"image", "pseudo_study_uid", new_column_name="hashed_identifier", schema="pipeline"
"image", "pseudo_study_uid", new_column_name="hashed_identifier", schema="pixl_pipeline"
)
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def upgrade() -> None:
op.add_column(
"image",
sa.Column("pseudo_patient_id", sa.String(length=255), nullable=True),
schema="pipeline",
schema="pixl_pipeline",
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("image", "pseudo_patient_id", schema="pipeline")
op.drop_column("image", "pseudo_patient_id", schema="pixl_pipeline")
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion postgres/pixl-db_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
set -euxo pipefail

# Create the pipeline schema for keeping track of images and extracts
psql -U "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" -c "CREATE SCHEMA pipeline AUTHORIZATION ${POSTGRES_USER}"
psql -U "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" -c "CREATE SCHEMA pixl_pipeline AUTHORIZATION ${POSTGRES_USER}"
Loading