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

Migration introducing the password reset table doesn't work on mariadb #2569

Closed
simongroenewolt opened this issue May 11, 2021 · 1 comment
Closed

Comments

@simongroenewolt
Copy link
Contributor

After performing the steps specified in #2318 to upgrade to Bolt 5 (beta) I had to run a migration. That resulted in an error:

root@b1523f9476fd:/var/www/bolt# php bin/console doctrine:migrations:migrate

 WARNING! You are about to execute a migration in database "lieu" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
 > yes

[notice] Migrating up to Bolt\DoctrineMigrations\Version20201210105836
[error] Migration Bolt\DoctrineMigrations\Version20201210105836 failed during Execution. Error: "An exception occurred while executing 'CREATE TABLE bolt_password_request (user_id INT DEFAULT 0 NOT NULL, id INT AUTO_INCREMENT NOT NULL, INDEX IDX_AFC1BF6FA76ED395 (user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB':

SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key"

In AbstractMySQLDriver.php line 128:
                                                                                                                                                                                                         
  An exception occurred while executing 'CREATE TABLE bolt_password_request (user_id INT DEFAULT 0 NOT NULL, id INT AUTO_INCREMENT NOT NULL, INDEX IDX_AFC1BF6FA76ED395 (user_id)) DEFAULT CHARACTER SE  
  T utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB':                                                                                                                                               
                                                                                                                                                                                                         
  SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key                                                  
                                                                                                                                                                                                         

In Exception.php line 18:
                                                                                                                                                         
  SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key  
                                                                                                                                                         

In PDOConnection.php line 132:
                                                                                                                                                         
  SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key  
                                                                                                                                                         

doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]

I think the migration probably runs fine on other databases (sqlite?), but MariaDB is a bit more picky?

I've got a fix already, will submit that later.

@bobdenotter
Copy link
Member

Fixed by #2582

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