0

I have a Postgres DB with a foreign schema from another DWH, but recently this original schema was deleted from there. We have the init.sql file with contents like this (edited to remove specifics):

--liquibase formatted sql

--changeset author_id:create:schema:abc_schema_name

create schema abc_schema_name;

--changeset author_id:import:schema:abc_schema_name

import foreign schema abc_schema_name 
limit to (table_1, table_2, table_3) 
from server GreenPlumDev into abc_schema_name;

And we also have the changelog.xml with <include file="init.sql" relativeToChangelogFile="true"/> there.

How do I properly remove this schema from our database, as it's no longer exists in original one? I thought of just deleting the init.sql and changelog.xml and dropping schema manually, but would it be correct?

Thanks!

1 Answers1

0

Liquibase is designed to operate within application's schema.

I don't think it's a good idea to delete/create schema itself with Liquibase changeSets. There are no createSchema or deleteSchema changes for a reason.

I believe you can write custom sql changeSet to do it, but once again, it's not what Liquibase is designed for.

You should delete changelog, init.sql and drop schema manually, let DBAs handle it, etc., depending on your company's process.

htshame
  • 6,599
  • 5
  • 36
  • 56