summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-12-05 18:49:56 +0000
committerGerrit Code Review <review@openstack.org>2011-12-05 18:49:56 +0000
commit8e3ceba1bfddb8f49def3bd434ab34f12dd40794 (patch)
tree1254130027b5b89a5a65bba80f2d9a92828b370d
parent5f72723b4137ec59b4c6b376ddf6e7cb42df26b5 (diff)
parent2e000f35023dfe096e94e95b0673e209d93acef9 (diff)
downloadnova-8e3ceba1bfddb8f49def3bd434ab34f12dd40794.tar.gz
nova-8e3ceba1bfddb8f49def3bd434ab34f12dd40794.tar.xz
nova-8e3ceba1bfddb8f49def3bd434ab34f12dd40794.zip
Merge "add index to instance_uuid column in instances"
-rw-r--r--.mailmap3
-rw-r--r--nova/db/sqlalchemy/migrate_repo/versions/061_add_index_to_instance_uuid.py29
2 files changed, 31 insertions, 1 deletions
diff --git a/.mailmap b/.mailmap
index 2f97343e1..2265c2e22 100644
--- a/.mailmap
+++ b/.mailmap
@@ -41,7 +41,7 @@
<nirmal.ranganathan@rackspace.com> <nirmal.ranganathan@rackspace.coom>
<paul@openstack.org> <paul.voccio@rackspace.com>
<paul@openstack.org> <pvoccio@castor.local>
-<rconradharris@gmail.com> <rick.harris@rackspace.com>
+<rconradharris@gmail.com> <rick.harris@rackspace.com>
<rlane@wikimedia.org> <laner@controller>
<sandy.walsh@rackspace.com> <sandy@sandywalsh.com>
<sleepsonthefloor@gmail.com> <root@tonbuntu>
@@ -49,6 +49,7 @@
<throughnothing@gmail.com> <will.wolf@rackspace.com>
<todd@ansolabs.com> <todd@lapex>
<todd@ansolabs.com> <todd@rubidine.com>
+<trey.morris@rackspace.com> <treyemorris@gmail.com>
<tushar.vitthal.patil@gmail.com> <tpatil@vertex.co.in>
<ueno.nachi@lab.ntt.co.jp> <nati.ueno@gmail.com>
<ueno.nachi@lab.ntt.co.jp> <nova@u4>
diff --git a/nova/db/sqlalchemy/migrate_repo/versions/061_add_index_to_instance_uuid.py b/nova/db/sqlalchemy/migrate_repo/versions/061_add_index_to_instance_uuid.py
new file mode 100644
index 000000000..0ec06b66d
--- /dev/null
+++ b/nova/db/sqlalchemy/migrate_repo/versions/061_add_index_to_instance_uuid.py
@@ -0,0 +1,29 @@
+# Copyright 2011 OpenStack LLC.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from sqlalchemy import Index, MetaData, Table
+
+meta = MetaData()
+
+
+def upgrade(migrate_engine):
+ meta.bind = migrate_engine
+ instances = Table('instances', meta, autoload=True)
+ Index('uuid', instances.c.uuid, unique=True).create(migrate_engine)
+
+
+def downgrade(migrate_engine):
+ meta.bind = migrate_engine
+ instances = Table('instances', meta, autoload=True)
+ Index('uuid', instances.c.uuid, unique=True).drop(migrate_engine)