Declare a partitioned table in liquibase


Thanks for your prompt response.

I’ll speak to my company if we can contact you , but we are a small company so I doubt if I’ll get approval. In any case, we are partitioning at a prototype stage now, so looks like it’ll be me who needs to do it :slight_smile: . I’ll definitely contact you in case we need to partner with someone.

If I use the option , can I directly enclose (for example) the following SQL?

CREATE TABLE members ( firstname VARCHAR(25) NOT NULL, lastname VARCHAR(25) NOT NULL, username VARCHAR(16) NOT NULL, email VARCHAR(35), joined DATE NOT NULL ) PARTITION BY KEY(joined) PARTITIONS 6; 

Are there any other limitations I should know?

Liquibase does not support this natively. You would need to use on of the following techniques:

  1. Write your own extension to Liquibase.

  2. Contact my company (Datical) as we have written an extension that does this.

  3. Use the change type rather than the change type, and specify the exact SQL you want.

Steve Donie
Principal Software Engineer
Datical, Inc.

We have been using mysql and non-partitioned table. We now want to partition some of our tables by a tenant_id that would enable us to process things faster and avoid locking issues.

It works fine in MySQL (I checked the SQLs and they work fine) ,but how can I declare a table as partitioned in liquibase? If it does not allow it, what is the other option?