-
-
Save michaelcullum/0724fdbbe6b0afe489e8 to your computer and use it in GitHub Desktop.
Why we need migrations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// What we do now | |
function database_update_info() | |
{ | |
return array( | |
'3.0.10' => array(), | |
// No changes from 3.0.9 to 3.0.10 | |
'3.0.11' => array(), | |
'add_columns' => array( | |
PROFILE_FIELDS_TABLE => array( | |
'field_show_novalue' => array('BOOL', 0), | |
), | |
), | |
'3.1.0' => array(), | |
'3.1.1' => array( | |
'add_columns' => array( | |
PROFILE_FIELDS_TABLE => array( | |
'field_show_novalue' => array('BOOL', 0), | |
), | |
), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A migration file, one of these would be created every time someone changes their db (so multiple times a feature or once for a feature). Then all of these migration files that have not yet been applied (DB keeps track of migrations applied) would be applied. | |
class Version20121001151649 extends AbstractMigration | |
{ | |
public function up(Schema $schema) | |
{ | |
$this->addSql("QUERY"); | |
} | |
public function down(Schema $schema) | |
{ | |
$this->addSql("QUERY"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment