You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migration fails due to syntax error on line 18. 'id_left' => Schema::TYPE_INTEGER.' NOT NULL DEFAULT (-1)',
Here is my yii error message:
Apply the above migration? (yes|no) [no]:yes
*** applying m150127_082652_amilna_cap
> create table cap_account ...Exception 'yii\db\Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(-1),
`id_right` int(11) NOT NULL DEFAULT 0,
`id_level` int(11) NOT NULL DEFAU' at line 9
The SQL being executed was: CREATE TABLE `cap_account` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`code` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`parent_id` int(11),
`increaseon` smallint(6) NOT NULL,
`isbalance` tinyint(1) NOT NULL DEFAULT FALSE,
`exchangable` tinyint(1) NOT NULL DEFAULT FALSE,
`id_left` int(11) NOT NULL DEFAULT (-1),
`id_right` int(11) NOT NULL DEFAULT 0,
`id_level` int(11) NOT NULL DEFAULT 0,
`isdel` smallint(6) NOT NULL DEFAULT 0
)'
So I changed the line to instead: 'id_left' => Schema::TYPE_INTEGER.' NOT NULL DEFAULT \'-1\'',
And it worked
I'm on windows environment. Using UniserverZ as my wamp server
The text was updated successfully, but these errors were encountered:
Migration fails due to syntax error on line 18.
'id_left' => Schema::TYPE_INTEGER.' NOT NULL DEFAULT (-1)',
Here is my yii error message:
So I changed the line to instead:
'id_left' => Schema::TYPE_INTEGER.' NOT NULL DEFAULT \'-1\'',
And it worked
I'm on windows environment. Using UniserverZ as my wamp server
The text was updated successfully, but these errors were encountered: