oudersamir / blog-laravel7-cms-voyager

3 stars 0 forks source link

php artisan migrate #1

Closed ghahabib closed 3 years ago

ghahabib commented 4 years ago

hi Please help

PS D:\laravel\blog-laravel7-cms> php artisan migrate Migration table created successfully. Migrating: 2014_10_12_000000_create_users_table Migrated: 2014_10_12_000000_create_users_table (0.11 seconds) Migrating: 2016_01_01_000000_add_voyager_user_fields Migrated: 2016_01_01_000000_add_voyager_user_fields (0.08 seconds) Migrating: 2016_01_01_000000_create_data_types_table Migrated: 2016_01_01_000000_create_data_types_table (0.3 seconds) Migrating: 2016_01_01_000000_create_pages_table Migrated: 2016_01_01_000000_create_pages_table (0.11 seconds) Migrating: 2016_01_01_000000_create_posts_table Migrated: 2016_01_01_000000_create_posts_table (0.12 seconds) Migrating: 2016_02_15_204651_create_categories_table Migrated: 2016_02_15_204651_create_categories_table (0.23 seconds) Migrating: 2016_05_19_173453_create_menu_table Migrated: 2016_05_19_173453_create_menu_table (0.22 seconds) Migrating: 2016_10_21_190000_create_roles_table Migrated: 2016_10_21_190000_create_roles_table (0.11 seconds) Migrating: 2016_10_21_190000_create_settings_table Migrated: 2016_10_21_190000_create_settings_table (0.11 seconds) Migrating: 2016_11_30_135954_create_permission_table Migrated: 2016_11_30_135954_create_permission_table (0.12 seconds) Migrating: 2016_11_30_141208_create_permission_role_table Migrated: 2016_11_30_141208_create_permission_role_table (0.46 seconds) Migrating: 2016_12_26_201236_data_typesaddserver_side Migrated: 2016_12_26_201236_data_typesaddserver_side (0.08 seconds) Migrating: 2017_01_13_000000_add_route_to_menu_items_table Migrated: 2017_01_13_000000_add_route_to_menu_items_table (0.09 seconds) Migrating: 2017_01_14_005015_create_translations_table

Illuminate\Database\QueryException

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table translations add unique translations_table_name_column_name_foreign_key_locale_unique(table_name, column_name, foreign_key, locale))

at D:\laravel\blog-laravel7-cms\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671 667| // If an exception occurs when attempting to run a query, we'll format the error 668| // message to include the bindings with SQL, which will make this exception a 669| // lot more helpful to the developer instead of just the database's errors. 670| catch (Exception $e) {

671| throw new QueryException( 672| $query, $this->prepareBindings($bindings), $e 673| ); 674| } 675|

1 D:\laravel\blog-laravel7-cms\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:129 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")

2 D:\laravel\blog-laravel7-cms\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:127 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")

Thank You

ghahabib commented 4 years ago

fixed it Inside config/database.php, replace this line for mysql

'engine' => null', with

'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',

oudersamir commented 4 years ago

Good👍