Describe what you are trying to achieve and what goes wrong.
Provide output if related
// paste output here
Provide minimal script to reproduce the issue
<?php
use Phalcon\Db\Column;
use Phalcon\Db\Index;
use Phalcon\Db\Reference;
use Phalcon\Mvc\Model\Migration;
/**
* Class MenusMigration_350
*/
class MenusMigration_350 extends Migration
{
/**
* Define the table structure
*
* @return void
*/
public function morph()
{
$this->morphTable('menus', [
'columns' => [
new Column(
'id',
[
'type' => Column::TYPE_INTEGER,
'notNull' => true,
'autoIncrement' => true,
'size' => 11,
'first' => true
]
),
new Column(
'title',
[
'type' => Column::TYPE_CHAR,
'notNull' => true,
'size' => 255,
'after' => 'id'
]
),
new Column(
'lang',
[
'type' => Column::TYPE_CHAR,
'notNull' => true,
'size' => 3,
'after' => 'title'
]
),
new Column(
'url',
[
'type' => Column::TYPE_CHAR,
'default' => "",
'notNull' => true,
'size' => 255,
'after' => 'lang'
]
),
new Column(
'status',
[
'type' => Column::TYPE_BOOLEAN,
'default' => "1",
'notNull' => true,
'size' => 1,
'after' => 'url'
]
),
new Column(
'external',
[
'type' => Column::TYPE_BOOLEAN,
'default' => "0",
'notNull' => true,
'size' => 1,
'after' => 'status'
]
)
],
'indexes' => [
new Index('PRIMARY', ['id'], 'PRIMARY')
],
'options' => [
'TABLE_TYPE' => 'BASE TABLE',
'AUTO_INCREMENT' => '',
'ENGINE' => 'InnoDB',
'TABLE_COLLATION' => 'utf8_general_ci'
],
]
);
}
/**
* Run the migrations
*
* @return void
*/
public function up()
{
}
/**
* Reverse the migrations
*
* @return void
*/
public function down()
{
}
}
Details
System info and versions (if possible): (phalcon info)
Phalcon Framework version: v3
PHP Version: 7.2
Operating System: ubuntu 16.04
Server: Apache
Other related info (Database, table schema):
Hello in the 3v version. I have a problem - in some situation if I change field from requiement - to the field with defaul value '' - empty string, the migration doesn`t work.
In the code above the only line was added is - ``'default' => "", (in the url field)
Expected and Actual Behavior
Details
phalcon info
)Hello in the 3v version. I have a problem - in some situation if I change field from requiement - to the field with defaul value '' - empty string, the migration doesn`t work.
In the code above the only line was added is -
``'default' => "",
(in the url field)