Reputation: 51
public function up() {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
$columns = [
'id' => $this->primaryKey(),
'name' => $this->string(255)->notNull(),
'price' => $this->decimal(10, 2)->notNull()->defaultValue(0),
'original_price' => $this->decimal(10, 2)->notNull()->defaultValue(0),
'special_price' => $this->decimal(10, 2)->notNull()->defaultValue(0),
'comment' => $this->string(10),
'is_deleted' => $this->boolean()->defaultValue(0),
'created_at' => $this->dateTime()->notNull(),
'updated_at' => $this->ti`enter code here`mestamp()
];
$this->createTable('tbl_ironing_order_item', $columns, $tableOptions);
}
i am using yii2 framework, i deploy project on server migrations run working fine, recently create new modules that migrations not run on serve, not showing any error, How can i run migrations at deploy time?
Upvotes: 1
Views: 163
Reputation: 545
Make sure that the migration files are on console/migrations directory. If they are not in that directory, you could specify the directories they are in.
Run
php yii migrate/up --migrationPath=@vendor/path/to/your/migrations
Upvotes: 1