Merge lp:~termie/nova/austin_migration into lp:~hudson-openstack/nova/trunk

Proposed by termie
Status: Merged
Approved by: Soren Hansen
Approved revision: 639
Merged at revision: 640
Proposed branch: lp:~termie/nova/austin_migration
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 131 lines (+35/-24)
3 files modified
nova/db/sqlalchemy/migrate_repo/versions/001_austin.py (+5/-19)
nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py (+23/-1)
nova/db/sqlalchemy/migration.py (+7/-4)
To merge this branch: bzr merge lp:~termie/nova/austin_migration
Reviewer Review Type Date Requested Status
Thierry Carrez (community) gfe Approve
Vish Ishaya (community) Approve
Jay Pipes (community) Approve
Devin Carlen (community) Approve
Review via email: mp+47952@code.launchpad.net

Description of the change

Match the initial db version to the actual Austin release db schema.

Fixes: https://bugs.launchpad.net/nova/+bug/709183

Tested by copying nova/tests/db/nova.austin.sqlite to ./nova.sqlite and running ./bin/nova-manage db sync

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

yup, nice work.

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm. This officially needs an exception. IMO this is a required feature. I don't know of anyone actually using austin in production, but I still feel it is imperative that we provide a working upgrade path.

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

Agreed, we need that one in.

review: Approve (gfe)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The person who submitted this branch (termie) does not appear in http://wiki.openstack.org/Contributors?action=raw

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The person who submitted this branch (termie) does not appear in http://wiki.openstack.org/Contributors?action=raw

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/001_austin.py'
--- nova/db/sqlalchemy/migrate_repo/versions/001_austin.py 2011-01-18 23:59:02 +0000
+++ nova/db/sqlalchemy/migrate_repo/versions/001_austin.py 2011-01-31 01:16:21 +0000
@@ -134,6 +134,9 @@
134 Column('ramdisk_id',134 Column('ramdisk_id',
135 String(length=255, convert_unicode=False, assert_unicode=None,135 String(length=255, convert_unicode=False, assert_unicode=None,
136 unicode_error=None, _warn_on_bytestring=False)),136 unicode_error=None, _warn_on_bytestring=False)),
137 Column('server_name',
138 String(length=255, convert_unicode=False, assert_unicode=None,
139 unicode_error=None, _warn_on_bytestring=False)),
137 Column('launch_index', Integer()),140 Column('launch_index', Integer()),
138 Column('key_name',141 Column('key_name',
139 String(length=255, convert_unicode=False, assert_unicode=None,142 String(length=255, convert_unicode=False, assert_unicode=None,
@@ -178,23 +181,6 @@
178 )181 )
179182
180183
181iscsi_targets = Table('iscsi_targets', meta,
182 Column('created_at', DateTime(timezone=False)),
183 Column('updated_at', DateTime(timezone=False)),
184 Column('deleted_at', DateTime(timezone=False)),
185 Column('deleted', Boolean(create_constraint=True, name=None)),
186 Column('id', Integer(), primary_key=True, nullable=False),
187 Column('target_num', Integer()),
188 Column('host',
189 String(length=255, convert_unicode=False, assert_unicode=None,
190 unicode_error=None, _warn_on_bytestring=False)),
191 Column('volume_id',
192 Integer(),
193 ForeignKey('volumes.id'),
194 nullable=True),
195 )
196
197
198key_pairs = Table('key_pairs', meta,184key_pairs = Table('key_pairs', meta,
199 Column('created_at', DateTime(timezone=False)),185 Column('created_at', DateTime(timezone=False)),
200 Column('updated_at', DateTime(timezone=False)),186 Column('updated_at', DateTime(timezone=False)),
@@ -523,7 +509,7 @@
523 meta.bind = migrate_engine509 meta.bind = migrate_engine
524510
525 for table in (auth_tokens, export_devices, fixed_ips, floating_ips,511 for table in (auth_tokens, export_devices, fixed_ips, floating_ips,
526 instances, iscsi_targets, key_pairs, networks,512 instances, key_pairs, networks,
527 projects, quotas, security_groups, security_group_inst_assoc,513 projects, quotas, security_groups, security_group_inst_assoc,
528 security_group_rules, services, users,514 security_group_rules, services, users,
529 user_project_association, user_project_role_association,515 user_project_association, user_project_role_association,
@@ -539,7 +525,7 @@
539def downgrade(migrate_engine):525def downgrade(migrate_engine):
540 # Operations to reverse the above upgrade go here.526 # Operations to reverse the above upgrade go here.
541 for table in (auth_tokens, export_devices, fixed_ips, floating_ips,527 for table in (auth_tokens, export_devices, fixed_ips, floating_ips,
542 instances, iscsi_targets, key_pairs, networks,528 instances, key_pairs, networks,
543 projects, quotas, security_groups, security_group_inst_assoc,529 projects, quotas, security_groups, security_group_inst_assoc,
544 security_group_rules, services, users,530 security_group_rules, services, users,
545 user_project_association, user_project_role_association,531 user_project_association, user_project_role_association,
546532
=== modified file 'nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py'
--- nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py 2011-01-18 23:59:02 +0000
+++ nova/db/sqlalchemy/migrate_repo/versions/002_bexar.py 2011-01-31 01:16:21 +0000
@@ -41,6 +41,10 @@
41 Column('id', Integer(), primary_key=True, nullable=False),41 Column('id', Integer(), primary_key=True, nullable=False),
42 )42 )
4343
44volumes = Table('volumes', meta,
45 Column('id', Integer(), primary_key=True, nullable=False),
46 )
47
4448
45#49#
46# New Tables50# New Tables
@@ -131,6 +135,23 @@
131 )135 )
132136
133137
138iscsi_targets = Table('iscsi_targets', meta,
139 Column('created_at', DateTime(timezone=False)),
140 Column('updated_at', DateTime(timezone=False)),
141 Column('deleted_at', DateTime(timezone=False)),
142 Column('deleted', Boolean(create_constraint=True, name=None)),
143 Column('id', Integer(), primary_key=True, nullable=False),
144 Column('target_num', Integer()),
145 Column('host',
146 String(length=255, convert_unicode=False, assert_unicode=None,
147 unicode_error=None, _warn_on_bytestring=False)),
148 Column('volume_id',
149 Integer(),
150 ForeignKey('volumes.id'),
151 nullable=True),
152 )
153
154
134#155#
135# Tables to alter156# Tables to alter
136#157#
@@ -188,7 +209,8 @@
188 # Upgrade operations go here. Don't create your own engine;209 # Upgrade operations go here. Don't create your own engine;
189 # bind migrate_engine to your metadata210 # bind migrate_engine to your metadata
190 meta.bind = migrate_engine211 meta.bind = migrate_engine
191 for table in (certificates, consoles, console_pools, instance_actions):212 for table in (certificates, consoles, console_pools, instance_actions,
213 iscsi_targets):
192 try:214 try:
193 table.create()215 table.create()
194 except Exception:216 except Exception:
195217
=== modified file 'nova/db/sqlalchemy/migration.py'
--- nova/db/sqlalchemy/migration.py 2011-01-13 00:57:04 +0000
+++ nova/db/sqlalchemy/migration.py 2011-01-31 01:16:21 +0000
@@ -46,12 +46,15 @@
46 meta.reflect(bind=engine)46 meta.reflect(bind=engine)
47 try:47 try:
48 for table in ('auth_tokens', 'export_devices', 'fixed_ips',48 for table in ('auth_tokens', 'export_devices', 'fixed_ips',
49 'floating_ips', 'instances', 'iscsi_targets',49 'floating_ips', 'instances',
50 'key_pairs', 'networks', 'projects', 'quotas',50 'key_pairs', 'networks', 'projects', 'quotas',
51 'security_group_rules',51 'security_group_instance_association',
52 'security_group_instance_association', 'services',52 'security_group_rules', 'security_groups',
53 'services',
53 'users', 'user_project_association',54 'users', 'user_project_association',
54 'user_project_role_association', 'volumes'):55 'user_project_role_association',
56 'user_role_association',
57 'volumes'):
55 assert table in meta.tables58 assert table in meta.tables
56 return db_version_control(1)59 return db_version_control(1)
57 except AssertionError:60 except AssertionError:
5861
=== added file 'nova/tests/db/nova.austin.sqlite'
59Binary files nova/tests/db/nova.austin.sqlite 1970-01-01 00:00:00 +0000 and nova/tests/db/nova.austin.sqlite 2011-01-31 01:16:21 +0000 differ62Binary files nova/tests/db/nova.austin.sqlite 1970-01-01 00:00:00 +0000 and nova/tests/db/nova.austin.sqlite 2011-01-31 01:16:21 +0000 differ