I'm setting up self-hosted continuous integration using buildbox.io. I need to create the tables and columns in my test database.
On my own computer, I've been using public $import = 'MyTable';
for every fixture, to copy the table defenitions from the $default
database connection in database.php
. It works well, since my development database is always up to date with the latest migrations.
Also, it seems like a massive pain to do it the other way, where you'd have to manually keep your database field definitions up to date in your fixtures, each time you make changes to your database. This seems especially redundant given the list of fields will already be up to date in app/Config/Schema/schema.php
On the server, using public $import = 'MyTable';
won't work. Even if I did want to make the staging database my $default config when running tests, the staging database can't be relied upon to be up to date at all times.
So, my question is, how can I do it? Is there a way to tell Cake to use the definitions in schema.php
for building its test database from fixtures? Or is the only way for me to manually add field definitions in all my fixtures? (that seems like a massive pain!)