Hey fullas...
I need to add a new property to an existing data object that is optimized in the database with a NOT NULL constraint and a DEFAULT value.
Clearly, this can't be done in the actual property of the $db hash. I get a syntax error from db/build when I try the following:
function extraDBFields() {
return array("db" => array("TestField" => "Varchar(4) NOT NULL DEFAULT 'test'"));
}
The following works as a baseline, but always creates a row with NULL values, which is what I don't want:
function extraDBFields() {
return array("db" => array("TestField" => "Varchar(4)"));
}
Is there a recommended way to solve this within Sapphire? Am I missing something obvious? As I would like to be able to migrate these changes to multiple servers using just db/build, rather than having to manually change the columns.
Thanks,
Mark