From cc0b6e74079c62ab0678bfcdbad87d0ed319cb2b Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Fri, 23 Aug 2013 11:16:13 +0100 Subject: [PATCH] Remove unused service_* columns from user_creds 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 --- .../versions/025_user_creds_drop_service.py | 37 +++++++++++++++++++ heat/db/sqlalchemy/models.py | 2 - 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 heat/db/sqlalchemy/migrate_repo/versions/025_user_creds_drop_service.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 index 00000000..3070f887 --- /dev/null +++ b/heat/db/sqlalchemy/migrate_repo/versions/025_user_creds_drop_service.py @@ -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) diff --git a/heat/db/sqlalchemy/models.py b/heat/db/sqlalchemy/models.py index 13b0573d..50141ab6 100644 --- a/heat/db/sqlalchemy/models.py +++ b/heat/db/sqlalchemy/models.py @@ -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) -- 2.45.2