learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
456 stars 306 forks source link

Broken migration in 0.17.6b1-0.17.6b5 #5609

Closed benjaoming closed 4 years ago

benjaoming commented 4 years ago

Summary

On staging of the Central Server, I ran into this and want to pin it as an issue for now.

Running migrations for securesync:
 - Migrating forwards to 0025_auto__chg_field_device_version__add_field_facilitygroup_description.
 > securesync:0025_auto__chg_field_device_version__add_field_facilitygroup_description
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   - no dry run output for alter_column() due to dynamic DDL, sorry
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `securesync_facilitygroup` DROP COLUMN `description` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)

System information

KA Lite central server.

benjaoming commented 4 years ago

The migration was added here: https://github.com/learningequality/ka-lite/commit/6dd0c9debe9c0fff9a4c7e006c844ef60847af80

benjaoming commented 4 years ago

It seems the column already existed:

FATAL ERROR - The following SQL query failed: ALTER TABLE `securesync_facilitygroup` ADD COLUMN `description` longtext NOT NULL;
The error was: (1060, "Duplicate column name 'description'")
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   - no dry run output for alter_column() due to dynamic DDL, sorry
   - no dry run output for delete_foreign_key() due to dynamic DDL, sorry
   = ALTER TABLE `securesync_facilitygroup` DROP COLUMN `description` CASCADE; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)
 ! NOTE: The error which caused the migration to fail is further up.
Error in migration: securesync:0025_auto__chg_field_device_version__add_field_facilitygroup_description
DatabaseError: (1060, "Duplicate column name 'description'")
benjaoming commented 4 years ago

Seems it was already present here: https://github.com/learningequality/ka-lite/blob/master/kalite/packages/bundled/securesync/migrations/0024_auto__add_field_facilitygroup_description.py

Question can remain as to why South added it, but guessing it's because there are two 0024 migrations.

benjaoming commented 4 years ago

FIxed