Problem/Motivation

In SqlContentEntityStorage.php line 1580:
                                                                                                                                                    
  Exception thrown while performing a schema update. SQLSTATE[HY000]: General error: 1 near "transaction": syntax error: CREATE UNIQUE INDEX main.  
  transaction_transaction_field__uuid__value ON transaction (uuid); Array                                                                           
  (                                                                                                                                                 
  )                                                                                                                                                 
                                                                                                                                                    

In ExceptionHandler.php line 79:
                                                                                                                                                    
  SQLSTATE[HY000]: General error: 1 near "transaction": syntax error: CREATE UNIQUE INDEX main.transaction_transaction_field__uuid__value ON trans  
  action (uuid); Array                                                                                                                              
  (                                                                                                                                                 
  )                                                                                                                                                 
                                                                                                                                                    

In Statement.php line 82:
                                                                      
  SQLSTATE[HY000]: General error: 1 near "transaction": syntax error  
                                                                      

Steps to reproduce

  1. A fresh drupal installation
  2. The transaction module version: 1.0.0-beta1
  3. Run drush en transaction, and get the exception message above

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

jungle created an issue. See original summary.

heddn’s picture

This is a fatal bug w/ the module and running tests on sqlite:

sqlite> create table foo (id INTEGER PRIMARY KEY AUTOINCREMENT CHECK (id>= 0));
sqlite> create table transaction (id INTEGER PRIMARY KEY AUTOINCREMENT CHECK (id>= 0));
Error: near "transaction": syntax error

Basically, a table named transaction is reserved in Sqlite.

heddn’s picture

Priority: Normal » Major

Hmm, maybe should mark this a a major? One could argue critical, but how many people actually use sqlite on a live site. So there is a work around. Because we can also just have all testing run via mysql/mariadb. But ideally that wouldn't be needed. Ergo, raising the priority.

manuel.adan’s picture

Title: Exception got while installing » Exception got while installing (with sqlite DB)
Status: Active » Closed (won't fix)

As #3130579: Make Drupal\Core\Database\Schema work with reserved keywords for naming, it seems to be actually a Drupal core bug and an appropriate solution should be made at that level and not in every affected project.