Using DBIx::Class to Version Your Schema

Intro to DBIx::Class In my opinion DBIx::Class is one of the best ORM solutions out there. Not only can it model your database, including mapping out any foreign key relationships, it can also be used as a canonical point of reference for your schema. This means we can use it not only as an application layer interface to the database, but can also define a versioned database structure using the code, where if you add a field into your result class, you can generate a version of alter statements and a DDL just by running a simple script. [Read More]

Using SQLT to Create Database Diffs

Overview Database diffs can be useful for a variety of use cases, from outputting the differences in your development versus production schema to full blown database versioning systems. A database diff is similar in nature to a file diff, but instead of outputting the differences between two files, it will output the set of alterations to be made to bring one databases schema in sync with another. There are a variety of tools that will accomplish this for you, but I am going to use a tool called SQL::Translator. [Read More]