verbb / events

Craft CMS Plugin for events management and ticketing.
Other
22 stars 13 forks source link

Installation problems #35

Closed peteeveleigh closed 5 years ago

peteeveleigh commented 5 years ago

Unable to install the plugin.

In control panel, clicking install shows the flash message "Unable to install plugin".

The database tables are created but the following SQL error is shown in the logs

Exception: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint

The SQL that fails is:

ALTER TABLEevents_purchasedticketsADD CONSTRAINTevents_purchasedtickets_lineItemId_fkFOREIGN KEY (lineItemId) REFERENCEScommerce_lineitems(id) ON DELETE SET NULL

There is also an error

Tried to roll back a savepoint, but it does not exist: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT LEVEL1 does not exist
The SQL being executed was: ROLLBACK TO SAVEPOINT LEVEL1
engram-design commented 5 years ago

Do you have Commerce installed? I think this error might appear when you try to install the plugin without Commerce installed first?

peteeveleigh commented 5 years ago

Hi @engram-design

That was it. Commerce wasn't installed 🤦‍♂

I installed Commerce and tried again. Still no luck. Removed Events. And Reinstalled. No luck. Removed Events. Checked the database and could see the tables still there so removed them manually. Reinstalled and.... WIN!

Can't believe I didn't realise that's what was wrong.

Many thanks

engram-design commented 4 years ago

FYI, I have added a better error message to be shown in this instance, in 1.1.7