Created
December 3, 2014 20:11
-
-
Save pvolyntsev/bee52e25cad053342561 to your computer and use it in GitHub Desktop.
Пример файла миграции Yii
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 | |
class m141202_180046_icon_created extends CDbMigration | |
{ | |
// установка обновления | |
public function up() | |
{ | |
$this->addColumn('icons_by_name_view', 'created', 'datetime NOT NULL'); | |
$this->addColumn('similar_view', 'created', 'datetime NOT NULL'); | |
$this->refreshTableSchema('icons_by_name_view'); | |
$this->refreshTableSchema('similar_view'); | |
} | |
// отмена обновления | |
public function down() | |
{ | |
$this->dropColumn('icons_by_name_view', 'created'); | |
$this->dropColumn('similar_view', 'created'); | |
$this->refreshTableSchema('icons_by_name_view'); | |
$this->refreshTableSchema('similar_view'); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment