These are chat archives for luyadev/luya

14th
Jul 2017
dven84
@dven84
Jul 14 2017 08:11

Hi!
After

./vendor/bin/luya migrate/create create_test_table --fields="title:string" modulename

method "up" in migration file is empty. How fix this? :)

Basil
@nadar
Jul 14 2017 08:26
Add your migration code
dven84
@dven84
Jul 14 2017 08:33
  1. after ./vendor/bin/luya migrate/create create_test_table --fields="title:string" catalogadmin
<?php

use yii\db\Migration;

class m170714_082800_create_test_table extends Migration
{
    public function up()
    {

    }

    public function down()
    {
        echo "m170714_082800_create_test_table cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
  1. after ./vendor/yiisoft/yii2/yii migrate/create create_test_table --fields="title:string"
<?php

use yii\db\Migration;

/**
 * Handles the creation of table `test`.
 */
class m170714_082847_create_test_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('test', [
            'id' => $this->primaryKey(),
            'title' => $this->string(),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('test');
    }
}
1.0.0-RC3
Basil
@nadar
Jul 14 2017 08:34
Please make an issue on github, thanks for the report
dven84
@dven84
Jul 14 2017 08:35
ok!