-
Notifications
You must be signed in to change notification settings - Fork 51
Help in php yii migrate #86
Comments
Changing the bank collaction to utf8 I can migrate the bank to the step below, even after giving alter table to utf8mb4, of this error.
Total 8 new migrations to be applied: Apply the above migrations? (yes|no) [no]:yes 0 from 8 migrations were applied. Migration failed. The rest of the migrations are canceled. |
*** applying m180110_204953_create_account_table
> create table account ...Exception 'yii\db\Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
The SQL being executed was: CREATE TABLE
account
(id
int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,username
varchar(255) NOT NULL UNIQUE,profile_pic_url
varchar(255),full_name
varchar(255),biography
varchar(255),external_url
varchar(255),instagram_id
varchar(255),updated_at
datetime,created_at
datetime,monitoring
tinyint(1) NOT NULL DEFAULT 0)'
in /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/db/Schema.php:664
Error Info:
Array
(
[0] => 42000
[1] => 1071
[2] => Specified key was too long; max key length is 767 bytes
)
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/db/Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'CREATE TABLE
a...') #1 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/db/Command.php(1091): yii\db\Command->internalExecute('CREATE TABLE
a...')#2 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/db/Migration.php(323): yii\db\Command->execute()
#3 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/migrations/m180110_204953_create_account_table.php(25): yii\db\Migration->createTable('account', Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(725): m180110_204953_create_account_table->up()
#5 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(199): yii\console\controllers\BaseMigrateController->migrateUp('m180110_204953_...')
#6 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#7 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#10 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
#11 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#12 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#13 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#14 /Applications/XAMPP/xamppfiles/htdocs/igmonitoring/yii(20): yii\base\Application->run()
#15 {main}
The text was updated successfully, but these errors were encountered: