File: fix-db-schema-migration.patch

package info (click to toggle)
cinder 2%3A27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 44,032 kB
  • sloc: python: 496,072; pascal: 2,230; sh: 394; makefile: 104; xml: 26
file content (21 lines) | stat: -rw-r--r-- 1,016 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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())