]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Remove unused service_* columns from user_creds
authorSteven Hardy <shardy@redhat.com>
Fri, 23 Aug 2013 10:16:13 +0000 (11:16 +0100)
committerSteven Hardy <shardy@redhat.com>
Tue, 27 Aug 2013 17:00:40 +0000 (18:00 +0100)
The service_user and service_password columns are not used anywhere
so remove the columns from the DB and the model

bug #1215850

Change-Id: If2df8cb768a1e2b10897cc09d64df5bcb1c7cd24

heat/db/sqlalchemy/migrate_repo/versions/025_user_creds_drop_service.py [new file with mode: 0644]
heat/db/sqlalchemy/models.py

diff --git a/heat/db/sqlalchemy/migrate_repo/versions/025_user_creds_drop_service.py b/heat/db/sqlalchemy/migrate_repo/versions/025_user_creds_drop_service.py
new file mode 100644 (file)
index 0000000..3070f88
--- /dev/null
@@ -0,0 +1,37 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+#    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.
+
+import sqlalchemy
+
+
+def upgrade(migrate_engine):
+    meta = sqlalchemy.MetaData(bind=migrate_engine)
+
+    user_creds = sqlalchemy.Table('user_creds', meta, autoload=True)
+
+    user_creds.c.service_user.drop()
+    user_creds.c.service_password.drop()
+
+
+def downgrade(migrate_engine):
+    meta = sqlalchemy.MetaData(bind=migrate_engine)
+
+    user_creds = sqlalchemy.Table('user_creds', meta, autoload=True)
+
+    service_user = sqlalchemy.Column('service_user',
+                                     sqlalchemy.String(length=255))
+    service_user.create(user_creds)
+    service_password = sqlalchemy.Column('service_password',
+                                         sqlalchemy.String(length=255))
+    service_password.create(user_creds)
index 13b0573da376d8605a4e6e10ca038655eece14a9..50141ab637e369d2033f4d4b5ae20a6934f91f3b 100644 (file)
@@ -207,8 +207,6 @@ class UserCreds(BASE, HeatBase):
     id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
     username = sqlalchemy.Column(sqlalchemy.String)
     password = sqlalchemy.Column(sqlalchemy.String)
-    service_user = sqlalchemy.Column(sqlalchemy.String)
-    service_password = sqlalchemy.Column(sqlalchemy.String)
     tenant = sqlalchemy.Column(sqlalchemy.String)
     auth_url = sqlalchemy.Column(sqlalchemy.String)
     aws_auth_url = sqlalchemy.Column(sqlalchemy.String)