diff --git a/packages/postgres-database/src/simcore_postgres_database/migration/versions/10729e07000d_improve_foreign_key_dependencies.py b/packages/postgres-database/src/simcore_postgres_database/migration/versions/10729e07000d_improve_foreign_key_dependencies.py new file mode 100644 index 00000000000..16bfc82acd8 --- /dev/null +++ b/packages/postgres-database/src/simcore_postgres_database/migration/versions/10729e07000d_improve_foreign_key_dependencies.py @@ -0,0 +1,110 @@ +"""improve foreign key dependencies + +Revision ID: 10729e07000d +Revises: 47ca7335e146 +Create Date: 2024-09-24 07:52:20.253076+00:00 + +""" +from alembic import op + +# revision identifiers, used by Alembic. +revision = "10729e07000d" +down_revision = "47ca7335e146" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_foreign_key( + "fk_rut_pricing_plan_to_service_key_and_version", + "resource_tracker_pricing_plan_to_service", + "services_meta_data", + ["service_key", "service_version"], + ["key", "version"], + onupdate="CASCADE", + ondelete="CASCADE", + ) + op.drop_index( + "ix_resource_tracker_pricing_plans_product_name", + table_name="resource_tracker_pricing_plans", + ) + op.create_foreign_key( + "fk_rut_pricing_plans_product_name", + "resource_tracker_pricing_plans", + "products", + ["product_name"], + ["name"], + onupdate="CASCADE", + ondelete="CASCADE", + ) + op.create_foreign_key( + "fk_resource_tracker_pricing_units_costs_pricing_plan_id", + "resource_tracker_pricing_unit_costs", + "resource_tracker_pricing_plans", + ["pricing_plan_id"], + ["pricing_plan_id"], + onupdate="CASCADE", + ondelete="CASCADE", + ) + op.create_foreign_key( + "fk_resource_tracker_pricing_units_costs_pricing_unit_id", + "resource_tracker_pricing_unit_costs", + "resource_tracker_pricing_units", + ["pricing_unit_id"], + ["pricing_unit_id"], + onupdate="CASCADE", + ondelete="CASCADE", + ) + op.create_foreign_key( + "fk_wallets_product_name", + "wallets", + "products", + ["product_name"], + ["name"], + onupdate="CASCADE", + ondelete="CASCADE", + ) + op.create_foreign_key( + "fk_workspaces_product_name", + "workspaces", + "products", + ["product_name"], + ["name"], + onupdate="CASCADE", + ondelete="CASCADE", + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint("fk_workspaces_product_name", "workspaces", type_="foreignkey") + op.drop_constraint("fk_wallets_product_name", "wallets", type_="foreignkey") + op.drop_constraint( + "fk_resource_tracker_pricing_units_costs_pricing_unit_id", + "resource_tracker_pricing_unit_costs", + type_="foreignkey", + ) + op.drop_constraint( + "fk_resource_tracker_pricing_units_costs_pricing_plan_id", + "resource_tracker_pricing_unit_costs", + type_="foreignkey", + ) + op.drop_constraint( + "fk_rut_pricing_plans_product_name", + "resource_tracker_pricing_plans", + type_="foreignkey", + ) + op.create_index( + "ix_resource_tracker_pricing_plans_product_name", + "resource_tracker_pricing_plans", + ["product_name"], + unique=False, + ) + op.drop_constraint( + "fk_rut_pricing_plan_to_service_key_and_version", + "resource_tracker_pricing_plan_to_service", + type_="foreignkey", + ) + # ### end Alembic commands ### diff --git a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plan_to_service.py b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plan_to_service.py index b0040d93ae6..820ec42fc50 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plan_to_service.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plan_to_service.py @@ -45,4 +45,11 @@ doc="Option to mark default pricing plan for the service (ex. when there are more pricing plans for the same service)", ), # --------------------------- + sa.ForeignKeyConstraint( + ["service_key", "service_version"], + ["services_meta_data.key", "services_meta_data.version"], + name="fk_rut_pricing_plan_to_service_key_and_version", + onupdate="CASCADE", + ondelete="CASCADE", + ), ) diff --git a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py index 8ec50b0f206..81d98ebcac1 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py @@ -33,9 +33,14 @@ class PricingPlanClassification(str, enum.Enum): sa.Column( "product_name", sa.String, + sa.ForeignKey( + "products.name", + onupdate="CASCADE", + ondelete="CASCADE", + name="fk_rut_pricing_plans_product_name", + ), nullable=False, - doc="Product name", - index=True, + doc="Products unique name", ), sa.Column( "display_name", diff --git a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_unit_costs.py b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_unit_costs.py index defaf49eb4a..46031532387 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_unit_costs.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_unit_costs.py @@ -22,8 +22,14 @@ sa.Column( "pricing_plan_id", sa.BigInteger, + sa.ForeignKey( + "resource_tracker_pricing_plans.pricing_plan_id", + name="fk_resource_tracker_pricing_units_costs_pricing_plan_id", + onupdate="CASCADE", + ondelete="CASCADE", + ), nullable=False, - doc="Parent pricing plan", + doc="Foreign key to pricing plan", index=True, ), sa.Column( @@ -35,8 +41,14 @@ sa.Column( "pricing_unit_id", sa.BigInteger, + sa.ForeignKey( + "resource_tracker_pricing_units.pricing_unit_id", + name="fk_resource_tracker_pricing_units_costs_pricing_unit_id", + onupdate="CASCADE", + ondelete="CASCADE", + ), nullable=False, - doc="Parent pricing unit", + doc="Foreign key to pricing unit", index=True, ), sa.Column( diff --git a/packages/postgres-database/src/simcore_postgres_database/models/wallets.py b/packages/postgres-database/src/simcore_postgres_database/models/wallets.py index e26545f1f4a..3c765529976 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/wallets.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/wallets.py @@ -50,7 +50,18 @@ class WalletStatus(str, enum.Enum): ), column_created_datetime(timezone=True), column_modified_datetime(timezone=True), - sa.Column("product_name", sa.String, nullable=False, doc="Product name"), + sa.Column( + "product_name", + sa.String, + sa.ForeignKey( + "products.name", + onupdate="CASCADE", + ondelete="CASCADE", + name="fk_wallets_product_name", + ), + nullable=False, + doc="Products unique name", + ), ) # ------------------------ TRIGGERS diff --git a/packages/postgres-database/src/simcore_postgres_database/models/workspaces.py b/packages/postgres-database/src/simcore_postgres_database/models/workspaces.py index f4b76812a6c..998c7676761 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/workspaces.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/workspaces.py @@ -34,7 +34,18 @@ nullable=False, doc="Identifier of the group that owns this workspace (Should be just PRIMARY GROUP)", ), - sa.Column("product_name", sa.String, nullable=False, doc="Product name"), + sa.Column( + "product_name", + sa.String, + sa.ForeignKey( + "products.name", + onupdate="CASCADE", + ondelete="CASCADE", + name="fk_workspaces_product_name", + ), + nullable=False, + doc="Products unique name", + ), column_created_datetime(timezone=True), column_modified_datetime(timezone=True), ) diff --git a/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans.py b/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans.py index 5e241e60767..609b0ebd54f 100644 --- a/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans.py +++ b/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans.py @@ -27,6 +27,7 @@ from simcore_postgres_database.models.resource_tracker_pricing_units import ( resource_tracker_pricing_units, ) +from simcore_postgres_database.models.services import services_meta_data from starlette import status from yarl import URL @@ -184,6 +185,15 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato modified=datetime.now(tz=timezone.utc), ) ) + + con.execute( + services_meta_data.insert().values( + key=_SERVICE_KEY, + version=_SERVICE_VERSION, + name="name", + description="description", + ) + ) con.execute( resource_tracker_pricing_plan_to_service.insert().values( pricing_plan_id=_PRICING_PLAN_ID, @@ -192,6 +202,15 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato service_default_plan=True, ) ) + + con.execute( + services_meta_data.insert().values( + key=_SERVICE_KEY_2, + version=_SERVICE_VERSION_2, + name="name", + description="description", + ) + ) con.execute( resource_tracker_pricing_plan_to_service.insert().values( pricing_plan_id=_PRICING_PLAN_ID_2, @@ -207,6 +226,7 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato con.execute(resource_tracker_pricing_units.delete()) con.execute(resource_tracker_pricing_plans.delete()) con.execute(resource_tracker_pricing_unit_costs.delete()) + con.execute(services_meta_data.delete()) async def test_get_default_pricing_plan_for_service( diff --git a/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans_rpc.py b/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans_rpc.py index 5a12fd24dbe..4ec8d45bb72 100644 --- a/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans_rpc.py +++ b/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_pricing_plans_rpc.py @@ -37,6 +37,7 @@ from simcore_postgres_database.models.resource_tracker_pricing_units import ( resource_tracker_pricing_units, ) +from simcore_postgres_database.models.services import services_meta_data pytest_simcore_core_services_selection = ["postgres", "rabbit"] pytest_simcore_ops_services_selection = [ @@ -44,18 +45,52 @@ ] +_SERVICE_KEY = "simcore/services/comp/itis/sleeper" +_SERVICE_VERSION_1 = "2.0.2" +_SERVICE_VERSION_2 = "3.0.0" + +_SERVICE_KEY_3 = "simcore/services/comp/itis/different-service" +_SERVICE_VERSION_3 = "1.0.1" + + @pytest.fixture() def resource_tracker_setup_db( postgres_db: sa.engine.Engine, ) -> Iterator[None]: with postgres_db.connect() as con: + con.execute( + services_meta_data.insert().values( + key=_SERVICE_KEY, + version=_SERVICE_VERSION_1, + name="name", + description="description", + ) + ) + con.execute( + services_meta_data.insert().values( + key=_SERVICE_KEY, + version=_SERVICE_VERSION_2, + name="name", + description="description", + ) + ) + con.execute( + services_meta_data.insert().values( + key=_SERVICE_KEY_3, + version=_SERVICE_VERSION_3, + name="name", + description="description", + ) + ) + yield con.execute(resource_tracker_pricing_unit_costs.delete()) con.execute(resource_tracker_pricing_units.delete()) con.execute(resource_tracker_pricing_plan_to_service.delete()) con.execute(resource_tracker_pricing_plans.delete()) + con.execute(services_meta_data.delete()) async def test_rpc_pricing_plans_workflow( @@ -68,7 +103,7 @@ async def test_rpc_pricing_plans_workflow( result = await pricing_plans.create_pricing_plan( rpc_client, data=PricingPlanCreate( - product_name="s4l", + product_name="osparc", display_name=_display_name, description=faker.sentence(), classification=PricingPlanClassification.TIER, @@ -84,7 +119,7 @@ async def test_rpc_pricing_plans_workflow( _update_description = "description name updated" result = await pricing_plans.update_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", data=PricingPlanUpdate( pricing_plan_id=_pricing_plan_id, display_name=_update_display_name, @@ -99,7 +134,7 @@ async def test_rpc_pricing_plans_workflow( result = await pricing_plans.get_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) assert isinstance(result, PricingPlanGet) @@ -110,7 +145,7 @@ async def test_rpc_pricing_plans_workflow( result = await pricing_plans.list_pricing_plans( rpc_client, - product_name="s4l", + product_name="osparc", ) assert isinstance(result, list) assert len(result) == 1 @@ -120,7 +155,7 @@ async def test_rpc_pricing_plans_workflow( # Now I will deactivate the pricing plan result = await pricing_plans.update_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", data=PricingPlanUpdate( pricing_plan_id=_pricing_plan_id, display_name=faker.word(), @@ -142,7 +177,7 @@ async def test_rpc_pricing_plans_with_units_workflow( result = await pricing_plans.create_pricing_plan( rpc_client, data=PricingPlanCreate( - product_name="s4l", + product_name="osparc", display_name=_display_name, description=faker.sentence(), classification=PricingPlanClassification.TIER, @@ -156,7 +191,7 @@ async def test_rpc_pricing_plans_with_units_workflow( result = await pricing_units.create_pricing_unit( rpc_client, - product_name="s4l", + product_name="osparc", data=PricingUnitWithCostCreate( pricing_plan_id=_pricing_plan_id, unit_name="SMALL", @@ -175,7 +210,7 @@ async def test_rpc_pricing_plans_with_units_workflow( # Get pricing plan result = await pricing_plans.get_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) assert isinstance(result, PricingPlanGet) @@ -187,7 +222,7 @@ async def test_rpc_pricing_plans_with_units_workflow( _unit_name = "VERY SMALL" result = await pricing_units.update_pricing_unit( rpc_client, - product_name="s4l", + product_name="osparc", data=PricingUnitWithCostUpdate( pricing_plan_id=_pricing_plan_id, pricing_unit_id=_first_pricing_unit_id, @@ -206,7 +241,7 @@ async def test_rpc_pricing_plans_with_units_workflow( # Update pricing unit with COST update! result = await pricing_units.update_pricing_unit( rpc_client, - product_name="s4l", + product_name="osparc", data=PricingUnitWithCostUpdate( pricing_plan_id=_pricing_plan_id, pricing_unit_id=_first_pricing_unit_id, @@ -228,7 +263,7 @@ async def test_rpc_pricing_plans_with_units_workflow( # Test get pricing unit result = await pricing_units.get_pricing_unit( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, pricing_unit_id=_first_pricing_unit_id, ) @@ -238,7 +273,7 @@ async def test_rpc_pricing_plans_with_units_workflow( # Create one more unit result = await pricing_units.create_pricing_unit( rpc_client, - product_name="s4l", + product_name="osparc", data=PricingUnitWithCostCreate( pricing_plan_id=_pricing_plan_id, unit_name="LARGE", @@ -256,7 +291,7 @@ async def test_rpc_pricing_plans_with_units_workflow( # Get pricing plan with units result = await pricing_plans.get_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) assert isinstance(result, PricingPlanGet) @@ -275,7 +310,7 @@ async def test_rpc_pricing_plans_to_service_workflow( result = await pricing_plans.create_pricing_plan( rpc_client, data=PricingPlanCreate( - product_name="s4l", + product_name="osparc", display_name=faker.word(), description=faker.sentence(), classification=PricingPlanClassification.TIER, @@ -288,19 +323,19 @@ async def test_rpc_pricing_plans_to_service_workflow( result = ( await pricing_plans.list_connected_services_to_pricing_plan_by_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) ) assert isinstance(result, list) assert result == [] - _first_service_version = ServiceVersion("2.0.2") + _first_service_version = ServiceVersion(_SERVICE_VERSION_1) result = await pricing_plans.connect_service_to_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, - service_key=ServiceKey("simcore/services/comp/itis/sleeper"), + service_key=ServiceKey(_SERVICE_KEY), service_version=_first_service_version, ) assert isinstance(result, PricingPlanToServiceGet) @@ -310,7 +345,7 @@ async def test_rpc_pricing_plans_to_service_workflow( result = ( await pricing_plans.list_connected_services_to_pricing_plan_by_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) ) @@ -318,12 +353,12 @@ async def test_rpc_pricing_plans_to_service_workflow( assert len(result) == 1 # Connect different version - _second_service_version = ServiceVersion("3.0.0") + _second_service_version = ServiceVersion(_SERVICE_VERSION_2) result = await pricing_plans.connect_service_to_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, - service_key=ServiceKey("simcore/services/comp/itis/sleeper"), + service_key=ServiceKey(_SERVICE_KEY), service_version=_second_service_version, ) assert isinstance(result, PricingPlanToServiceGet) @@ -333,7 +368,7 @@ async def test_rpc_pricing_plans_to_service_workflow( result = ( await pricing_plans.list_connected_services_to_pricing_plan_by_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) ) @@ -341,13 +376,13 @@ async def test_rpc_pricing_plans_to_service_workflow( assert len(result) == 2 # Connect different service - _different_service_key = ServiceKey("simcore/services/comp/itis/different-service") + _different_service_key = ServiceKey(_SERVICE_KEY_3) result = await pricing_plans.connect_service_to_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, service_key=_different_service_key, - service_version=ServiceVersion("1.0.0"), + service_version=ServiceVersion(_SERVICE_VERSION_3), ) assert isinstance(result, PricingPlanToServiceGet) assert result.pricing_plan_id == _pricing_plan_id @@ -356,7 +391,7 @@ async def test_rpc_pricing_plans_to_service_workflow( result = ( await pricing_plans.list_connected_services_to_pricing_plan_by_pricing_plan( rpc_client, - product_name="s4l", + product_name="osparc", pricing_plan_id=_pricing_plan_id, ) ) diff --git a/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_triggered_by_listening_with_billing.py b/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_triggered_by_listening_with_billing.py index 8d95ae78d75..7a5e2114c1d 100644 --- a/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_triggered_by_listening_with_billing.py +++ b/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_triggered_by_listening_with_billing.py @@ -28,6 +28,7 @@ from simcore_postgres_database.models.resource_tracker_pricing_units import ( resource_tracker_pricing_units, ) +from simcore_postgres_database.models.services import services_meta_data from .conftest import assert_service_runs_db_row @@ -128,6 +129,14 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato modified=datetime.now(tz=timezone.utc), ) ) + con.execute( + services_meta_data.insert().values( + key="simcore/services/comp/itis/sleeper", + version="1.0.16", + name="name", + description="description", + ) + ) con.execute( resource_tracker_pricing_plan_to_service.insert().values( pricing_plan_id=1, @@ -144,6 +153,7 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato con.execute(resource_tracker_pricing_plans.delete()) con.execute(resource_tracker_pricing_unit_costs.delete()) con.execute(resource_tracker_credit_transactions.delete()) + con.execute(services_meta_data.delete()) @pytest.mark.flaky(max_runs=3) diff --git a/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing.py b/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing.py index 92946509e91..4b6c1a0dfac 100644 --- a/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing.py +++ b/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing.py @@ -30,6 +30,7 @@ from simcore_postgres_database.models.resource_tracker_pricing_units import ( resource_tracker_pricing_units, ) +from simcore_postgres_database.models.services import services_meta_data from simcore_service_resource_usage_tracker.modules.db.repositories.resource_tracker import ( ResourceTrackerRepository, ) @@ -142,6 +143,14 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato modified=datetime.now(tz=timezone.utc), ) ) + con.execute( + services_meta_data.insert().values( + key="simcore/services/comp/itis/sleeper", + version="1.0.16", + name="name", + description="description", + ) + ) con.execute( resource_tracker_pricing_plan_to_service.insert().values( pricing_plan_id=1, @@ -158,6 +167,7 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato con.execute(resource_tracker_pricing_plans.delete()) con.execute(resource_tracker_pricing_unit_costs.delete()) con.execute(resource_tracker_credit_transactions.delete()) + con.execute(services_meta_data.delete()) @pytest.fixture diff --git a/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing_cost_0.py b/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing_cost_0.py index d5bc497fb0f..c1d62af5b23 100644 --- a/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing_cost_0.py +++ b/services/resource-usage-tracker/tests/unit/with_dbs/test_process_rabbitmq_message_with_billing_cost_0.py @@ -30,6 +30,7 @@ from simcore_postgres_database.models.resource_tracker_pricing_units import ( resource_tracker_pricing_units, ) +from simcore_postgres_database.models.services import services_meta_data from simcore_service_resource_usage_tracker.modules.db.repositories.resource_tracker import ( ResourceTrackerRepository, ) @@ -88,6 +89,14 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato modified=datetime.now(tz=timezone.utc), ) ) + con.execute( + services_meta_data.insert().values( + key="simcore/services/comp/itis/sleeper", + version="1.0.16", + name="name", + description="description", + ) + ) con.execute( resource_tracker_pricing_plan_to_service.insert().values( pricing_plan_id=1, @@ -104,6 +113,7 @@ def resource_tracker_pricing_tables_db(postgres_db: sa.engine.Engine) -> Iterato con.execute(resource_tracker_pricing_plans.delete()) con.execute(resource_tracker_pricing_unit_costs.delete()) con.execute(resource_tracker_credit_transactions.delete()) + con.execute(services_meta_data.delete()) @pytest.fixture