cubicweb #17219759 allow to run migration of a CW database that pre-date 3.24 [in-progress]

The big problem is that in 3.24 the "asource" column of entities has been removed from the database schema. This is not a problem in itself, the problem is that some migration operation like "add_attribute" will modify the entities columns and past 3.24 will try to insert values without the asource column (as expected) but ... if you are migrating an old DB, you'll still have this asource column and this "add_attribute" (or other similar operations) will fails because "asource" is a non-null column and "add_attribute" won't provide a value for it anymore.

It's seems to be the only situation in which this bug appears.

The solution to detect if the "asource" column is here is not pretty at all but each db seems to have it's own way to have the list of columns of a table hence the now so great hack. Maybe CW has a better way to do that but I haven't found it :/

For reference the commit that remove this behavior is 054a947b5415 "[repository] Drop the entities.asource column" https://hg.logilab.org/master/cubicweb/rev/054a947b5415

The current solution might be repalce with direct SQL queries in the migration to avoid having this custom condition in the patch.

prioritynormal
typebug
done in3.28.0
closed by<not specified>
assigned to