add contract started_at field
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160302_171507_alter__table__contract__add__column__started_at extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("contract", "started_at", "datetime");
|
||||
$this->execute("update contract set started_at = created_at");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160302_171507_alter__table__contract__add__column__started_at cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user