Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL missing primary key on table password_resets #901

Open
AmpedCanada opened this issue Jan 5, 2024 · 1 comment
Open

SQL missing primary key on table password_resets #901

AmpedCanada opened this issue Jan 5, 2024 · 1 comment

Comments

@AmpedCanada
Copy link

Problem: Fresh install using mysql database throwing error when running the below command.
Run the database migrations with: sudo -H -u www-data bash -c 'php /var/www/seat/artisan migrate'

Expected: Create the table password_resets but instead fails with error no primary_key set.

Logs / Screenshots / Proof: Screenshot: https://i.imgur.com/uI5f0RC.png

Error Message: 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. N
ote that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. (Connection: mysql, SQL: create table password_resets (email varchar(255) no
t null, token varchar(255) not null, created_at timestamp not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

Version Info: Seat V5.0

@recursivetree
Copy link

  1. Using mysql is not officially supported. SeAT is designed for MariaDB and PostgreSQL. That being said, it will probably also work with mysql, but you might need to tweak a few things here and there.
  2. the sql_require_primary_key should be off by default: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_sql_require_primary_key. I don't know why it is on in your case, but you need to turn it off. Fixing this in SeAT is in my opinion out of scope, since it is on an unsupported DB with a non-default configuration.

What I suggest to do to fix this is to disable the sql_require_primary_key setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants