db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('{{%property_definition}}', [ 'id' => $this->primaryKey(), 'name' => $this->string(100)->notNull(), 'label' => $this->string(100)->notNull(), 'type' => $this->string(100)->notNull(), 'config' => $this->string(), 'created_at' => $this->timestamp()->notNull(), 'updated_at' => $this->timestamp()->notNull(), ], $tableOptions); $this->createTable('{{%property}}', [ 'id' => $this->primaryKey(), 'id_user' => $this->integer(11), 'id_property_definition' => $this->integer(11), 'value' => $this->string(), 'created_at' => $this->timestamp()->notNull(), 'updated_at' => $this->timestamp()->notNull(), ], $tableOptions); } /** * {@inheritdoc} */ public function safeDown() { echo "m211011_050352_add_properties cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "m211011_050352_add_properties cannot be reverted.\n"; return false; } */ }