123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- use yii\db\Migration;
- /**
- * Class m221225_045621_slider
- */
- class m221225_045621_slider extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->createTable('{{%top_slider}}',[
- 'id'=>$this->primaryKey(),
- 'post_id'=>$this->integer(),
- 'published_from'=>$this->dateTime(),
- 'published_to'=>$this->dateTime(),
- 'is_active'=>$this->smallInteger()->defaultValue(1)
- ]);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "m221225_045621_slider cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m221225_045621_slider cannot be reverted.\n";
- return false;
- }
- */
- }
|