Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are best practices for maintaining a Mysql database schema in a cross platform way?

We have two software stacks, Ruby on Rails and Java, that share a single Mysql database. We're using the Jooq Java database abstraction layer, which works by reading an existing database schema and generating code.

We have been relying on Rails migrations to keep track of schema changes, but our Java developers are unfamiliar with this, and our Rails devs have had to dig us out of problems more than once. It's also a rather cumbersome process, making a schema change can take 5-10 minutes, whereas it would take seconds if modifying the schema directly through a tool like MySql Workbench.

It would be preferable to have a solution for modifying our DB schema that wasn't tied to Rails, can anyone recommend a suitable approach?

like image 302
sanity Avatar asked Dec 19 '12 12:12

sanity


1 Answers

I guess you could take a look at Liquibase. It's a Java-based tool, but as I understand it would suit some of your requirements. Using that tool you are able to express the database content (both structure and data), then run such a tool against a running database and the tool will tell you what changes are missing and will apply them.

like image 108
Grzegorz Oledzki Avatar answered Oct 20 '22 00:10

Grzegorz Oledzki