【发布时间】:2020-10-06 15:05:13
【问题描述】:
我刚刚使用(托管数据库)将我的应用程序部署到 DigitalOcean,并且在调用 php artisan migrate 时出现以下错误
SQLSTATE[HY000]: General error: 3750 Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. (SQL: create table `sessions` (`id` varchar(255) not null, `user_id` bigint unsigned null, `ip_address` varchar(45) null, `user_agent` text null, `payload` text not null, `last_activity` int not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
当 mysql var sql_require_primary_key 设置为 true 时,Laravel 迁移似乎不起作用。
你有什么解决办法吗?
【问题讨论】:
标签: mysql laravel migration digital-ocean