Project

General

Profile

Bug #7892

Migration issue with user.last_login

Added by Yannick Warnier almost 4 years ago. Updated almost 4 years ago.

Status:
Bug resolved
Priority:
Urgent
Category:
Database & API changes
Target version:
Start date:
12/10/2015
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

When user.last_login already exists (mainly because the optional DB upgrade was executed in a prior version), the migration process generates an error which might break the upgrade:

ERROR: An exception occurred while executing 'ALTER TABLE user ADD COLUMN last_login datetime DEFAULT NULL': SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'last_login'

There is no way in MySQL to add a column only if it does not already exist, so we need to add a manual check (or to delete the field before upgrade, but this would cause another issue of loosing all the data stored in that field so far).

The query is in Version20150522222222

History

#1

Updated by Yannick Warnier almost 4 years ago

  • Status changed from Assigned to Bug resolved
  • % Done changed from 0 to 100

Fix sent to migration version file

Also available in: Atom PDF