QB + Migrations + Seeders : A recipe for success!


Thursday, May 18th, 17:10

In this Session we’ll look at how using QB, Migrations and Seeders can help you take the database complexity out of your projects. Allowing simple but powerful workflows to ensure your developer environment is the same as mine and the same as CI, giving you less headaches, less frustrating and helping you be a more productive developer.

QB is a CFML Query Builder that gives you developer friendly convenient, and fluent interface to run database queries. QB gives you all the tools to make cfml queries less painful, you will know what I mean if you have migrations from tag queries to queryExecute or an ORM like Hibernate. Query Builder gives you the same developer experience all great modern languages have these days.

Migrations are a way of providing version control for your application's schema. Changes to schema are kept in timestamped files that are ran in order up and down. In the up function, you describe the changes to apply your migration. In the down function, you describe the changes to undo your migration. This ensure your database modifications get deployed when your code gets deployed, so you’re never running code without the tables and columns it is relying upon.

But wait, there’s more… you can add superpowers to your Migrations with Seeders. Seeding your database is an optional step that allows you to add data to your database in mass. It is usually used in development to create a populated environment for testing. Seeders should not be used for data required to run your application or to migrate data between columns. Seeders should be seen as entirely optional. If a seeder is never ran, your application should still work.