diff --git a/src/main/resources/templates/db_scripts/migration/update_encumbrances_order_status.ftl b/src/main/resources/templates/db_scripts/migration/update_encumbrances_order_status.ftl deleted file mode 100644 index a2332236..00000000 --- a/src/main/resources/templates/db_scripts/migration/update_encumbrances_order_status.ftl +++ /dev/null @@ -1,11 +0,0 @@ -<#if mode.name() == "UPDATE"> -UPDATE ${myuniversity}_${mymodule}.transaction tr -SET jsonb = jsonb_set(jsonb, '{encumbrance,orderStatus}', - (SELECT jsonb -> 'workflowStatus' - from ${myuniversity}_mod_orders_storage.purchase_order - where jsonb ->> 'id' = tr.jsonb #>> '{encumbrance,sourcePurchaseOrderId}')) -WHERE jsonb ? 'encumbrance' - AND (SELECT jsonb -> 'workflowStatus' - from ${myuniversity}_mod_orders_storage.purchase_order - where jsonb ->> 'id' = tr.jsonb #>> '{encumbrance,sourcePurchaseOrderId}') IS NOT NULL; - diff --git a/src/main/resources/templates/db_scripts/schema.json b/src/main/resources/templates/db_scripts/schema.json index 5d287630..f9e3d5ed 100644 --- a/src/main/resources/templates/db_scripts/schema.json +++ b/src/main/resources/templates/db_scripts/schema.json @@ -56,11 +56,6 @@ "snippetPath": "migration/update_order_encumbrance.sql", "fromModuleVersion": "mod-finance-storage-7.0.0" }, - { - "run": "after", - "snippetPath": "migration/update_encumbrances_order_status.ftl", - "fromModuleVersion": "mod-finance-storage-7.0.3" - }, { "run": "after", "snippetPath": "migration/update_budget_summary_information.sql", diff --git a/src/test/java/org/folio/rest/impl/TenantSampleDataTest.java b/src/test/java/org/folio/rest/impl/TenantSampleDataTest.java index 55512a04..072cff7d 100644 --- a/src/test/java/org/folio/rest/impl/TenantSampleDataTest.java +++ b/src/test/java/org/folio/rest/impl/TenantSampleDataTest.java @@ -9,29 +9,16 @@ import static org.folio.rest.utils.TestEntities.EXPENSE_CLASS; import static org.folio.rest.utils.TestEntities.FUND_TYPE; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.folio.StorageTestSuite; import org.folio.rest.jaxrs.model.Parameter; import org.folio.rest.jaxrs.model.TenantAttributes; import org.folio.rest.jaxrs.model.TenantJob; -import org.folio.rest.persist.PostgresClient; import org.folio.rest.tools.utils.ModuleName; import org.folio.rest.utils.TestEntities; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import io.restassured.http.Header; @@ -46,16 +33,6 @@ public class TenantSampleDataTest extends TestBase { private static TenantJob tenantJob; - @BeforeAll - static void createPurchaseOrderTable() throws IOException, InterruptedException, ExecutionException, TimeoutException { - InputStream tableInput = TenantSampleDataTest.class.getClassLoader().getResourceAsStream("cross_module_migrations_schemas.sql"); - String sqlFile = IOUtils.toString(Objects.requireNonNull(tableInput), StandardCharsets.UTF_8); - CompletableFuture schemaCreated = new CompletableFuture<>(); - PostgresClient.getInstance(StorageTestSuite.getVertx()).runSQLFile(sqlFile, false) - .onComplete(listAsyncResult -> schemaCreated.complete(null)); - schemaCreated.get(60, TimeUnit.SECONDS); - } - @AfterAll public static void after() { deleteTenant(tenantJob, ANOTHER_TENANT_HEADER); diff --git a/src/test/resources/cross_module_migrations_schemas.sql b/src/test/resources/cross_module_migrations_schemas.sql deleted file mode 100644 index dada1cf0..00000000 --- a/src/test/resources/cross_module_migrations_schemas.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE ROLE new_tenant_mod_orders_storage PASSWORD 'new_tenant' NOSUPERUSER NOCREATEDB INHERIT LOGIN; -GRANT new_tenant_mod_orders_storage TO CURRENT_USER; -CREATE SCHEMA new_tenant_mod_orders_storage AUTHORIZATION new_tenant_mod_orders_storage; - -CREATE TABLE IF NOT EXISTS new_tenant_mod_orders_storage.purchase_order -( - id UUID PRIMARY KEY, - jsonb JSONB NOT NULL -); - -CREATE ROLE new_tenant_mod_invoice_storage PASSWORD 'new_tenant' NOSUPERUSER NOCREATEDB INHERIT LOGIN; -GRANT new_tenant_mod_invoice_storage TO CURRENT_USER; -CREATE SCHEMA new_tenant_mod_invoice_storage AUTHORIZATION new_tenant_mod_invoice_storage; - -CREATE TABLE IF NOT EXISTS new_tenant_mod_invoice_storage.invoice_lines -( - id UUID PRIMARY KEY, - jsonb JSONB NOT NULL -); -