# Liquibase for Multiple DB Schemas (with different changelogs)

**URL:** https://forum.liquibase.org/t/liquibase-for-multiple-db-schemas-with-different-changelogs/6475
**Category:** General Discussion
**Created:** [February 1, 2022, 2:21pm UTC](https://forum.liquibase.org/t/liquibase-for-multiple-db-schemas-with-different-changelogs/6475 "2022-02-01T14:21:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![or.keren21](https://avatars.discourse-cdn.com/v4/letter/o/9e8a1a/32.png) [@or.keren21](https://forum.liquibase.org/u/or.keren21)
#### Post date: [February 1, 2022, 2:21pm UTC](https://forum.liquibase.org/t/liquibase-for-multiple-db-schemas-with-different-changelogs/6475/1 "2022-02-01T14:21:44Z")

</div>

Hello all,  
I was just wondering whether it is possible to use Liquibase to manage more than one DB Schema

The use case is that we have an application that has several different DB Schemas under one DB Server, with each one having a different set of tables. So something like so:

```auto
MySQL:

     DB Schema 1:
          Table A, Table B
     DB Schema 2:
          Table C, Table D
     DB Schema 3:
          Table E, Table F

```

There is no foreign key constraint between any table, each DB Schema is its own independent thing.  
We’d like to integrate liquibase and use it to manage all three schemas, is it possible?

Thanks

---

<div class="post-metadata">

### Author: ![EduardUta](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/eduarduta/32/324_2.png) [@EduardUta](https://forum.liquibase.org/u/EduardUta)
#### Post date: [February 1, 2022, 10:33pm UTC](https://forum.liquibase.org/t/liquibase-for-multiple-db-schemas-with-different-changelogs/6475/2 "2022-02-01T22:33:37Z")

</div>

Hi @or.keren21

By “use Liquibase to manage more than one DB Schema”, do you mean having everything in the same changelogs (same files) and depending on the target schema, deploy either this table or other one?  
If this is the case, then yes, it can be done, using a functionality called “contexts”.  
Check out contexts and how you can conditionally apply particular changesets (in the current example, createTable type of changeset) on different target environments (DBSchema1…n)) depending on this input context value: [Understanding When to Use Contexts vs. Labels | Liquibase](https://www.liquibase.com/blog/contexts-vs-labels)  
and [context tag | Liquibase Docs](https://docs.liquibase.com/concepts/changelogs/attributes/contexts.html)
