Description: Fix db schema migration
 This is a known issue documented here:
 https://bugs.launchpad.net/cinder/+bug/2070475
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2024-11-20

--- cinder-24.0.0.orig/cinder/db/migrations/versions/9ab1b092a404_make_use_quota_non_nullable.py
+++ cinder-24.0.0/cinder/db/migrations/versions/9ab1b092a404_make_use_quota_non_nullable.py
@@ -45,9 +45,11 @@ def upgrade():
                                   nullable=False, server_default=sa.true())
 
     else:
+        op.execute('UPDATE volumes SET use_quota="1" WHERE use_quota IS NULL')
         op.alter_column('volumes', 'use_quota',
                         existing_type=sa.BOOLEAN,
                         nullable=False, server_default=sa.true())
+        op.execute('UPDATE snapshots SET use_quota="1" WHERE use_quota IS NULL')
         op.alter_column('snapshots', 'use_quota',
                         existing_type=sa.BOOLEAN,
                         nullable=False, server_default=sa.true())
