From cb4640d67dc8a66dbdc2cf6cb81e18948ec2d7ad Mon Sep 17 00:00:00 2001 From: ricolin Date: Tue, 14 Mar 2017 15:52:46 +0800 Subject: [PATCH] Squash database patches Remove patches up to the Mitaka release to speed up initial deployment and tests, as we don't support previous versions anymore. Closes-bug: #1672630 Change-Id: I4f821176cb11ca3dc3af247238ba3c4fbc20a092 --- .../migrate_repo/versions/066_placeholder.py | 20 ----------------- .../migrate_repo/versions/067_placeholder.py | 20 ----------------- .../migrate_repo/versions/068_placeholder.py | 20 ----------------- .../migrate_repo/versions/069_placeholder.py | 20 ----------------- .../migrate_repo/versions/070_placeholder.py | 20 ----------------- .../{065_liberty.py => 071_mitaka.py} | 1 + .../versions/071_stack_owner_id_index.py | 22 ------------------- heat/db/sqlalchemy/migration.py | 2 +- 8 files changed, 2 insertions(+), 123 deletions(-) delete mode 100644 heat/db/sqlalchemy/migrate_repo/versions/066_placeholder.py delete mode 100644 heat/db/sqlalchemy/migrate_repo/versions/067_placeholder.py delete mode 100644 heat/db/sqlalchemy/migrate_repo/versions/068_placeholder.py delete mode 100644 heat/db/sqlalchemy/migrate_repo/versions/069_placeholder.py delete mode 100644 heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py rename heat/db/sqlalchemy/migrate_repo/versions/{065_liberty.py => 071_mitaka.py} (99%) delete mode 100644 heat/db/sqlalchemy/migrate_repo/versions/071_stack_owner_id_index.py diff --git a/heat/db/sqlalchemy/migrate_repo/versions/066_placeholder.py b/heat/db/sqlalchemy/migrate_repo/versions/066_placeholder.py deleted file mode 100644 index 5dae7237b8..0000000000 --- a/heat/db/sqlalchemy/migrate_repo/versions/066_placeholder.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. - -# This is a placeholder for Liberty backports. -# Do not use this number for new Mitaka work. New Mitaka work starts after -# all the placeholders. - - -def upgrade(migrate_engine): - pass diff --git a/heat/db/sqlalchemy/migrate_repo/versions/067_placeholder.py b/heat/db/sqlalchemy/migrate_repo/versions/067_placeholder.py deleted file mode 100644 index 5dae7237b8..0000000000 --- a/heat/db/sqlalchemy/migrate_repo/versions/067_placeholder.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. - -# This is a placeholder for Liberty backports. -# Do not use this number for new Mitaka work. New Mitaka work starts after -# all the placeholders. - - -def upgrade(migrate_engine): - pass diff --git a/heat/db/sqlalchemy/migrate_repo/versions/068_placeholder.py b/heat/db/sqlalchemy/migrate_repo/versions/068_placeholder.py deleted file mode 100644 index 5dae7237b8..0000000000 --- a/heat/db/sqlalchemy/migrate_repo/versions/068_placeholder.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. - -# This is a placeholder for Liberty backports. -# Do not use this number for new Mitaka work. New Mitaka work starts after -# all the placeholders. - - -def upgrade(migrate_engine): - pass diff --git a/heat/db/sqlalchemy/migrate_repo/versions/069_placeholder.py b/heat/db/sqlalchemy/migrate_repo/versions/069_placeholder.py deleted file mode 100644 index 5dae7237b8..0000000000 --- a/heat/db/sqlalchemy/migrate_repo/versions/069_placeholder.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. - -# This is a placeholder for Liberty backports. -# Do not use this number for new Mitaka work. New Mitaka work starts after -# all the placeholders. - - -def upgrade(migrate_engine): - pass diff --git a/heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py b/heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py deleted file mode 100644 index 5dae7237b8..0000000000 --- a/heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. - -# This is a placeholder for Liberty backports. -# Do not use this number for new Mitaka work. New Mitaka work starts after -# all the placeholders. - - -def upgrade(migrate_engine): - pass diff --git a/heat/db/sqlalchemy/migrate_repo/versions/065_liberty.py b/heat/db/sqlalchemy/migrate_repo/versions/071_mitaka.py similarity index 99% rename from heat/db/sqlalchemy/migrate_repo/versions/065_liberty.py rename to heat/db/sqlalchemy/migrate_repo/versions/071_mitaka.py index 6c5a6639fb..22d69da496 100644 --- a/heat/db/sqlalchemy/migrate_repo/versions/065_liberty.py +++ b/heat/db/sqlalchemy/migrate_repo/versions/071_mitaka.py @@ -91,6 +91,7 @@ def upgrade(migrate_engine): sqlalchemy.Column('parent_resource_name', sqlalchemy.String(255)), sqlalchemy.Index('ix_stack_name', 'name', mysql_length=255), sqlalchemy.Index('ix_stack_tenant', 'tenant', mysql_length=255), + sqlalchemy.Index('ix_stack_owner_id', 'owner_id', mysql_length=36), mysql_engine='InnoDB', mysql_charset='utf8' diff --git a/heat/db/sqlalchemy/migrate_repo/versions/071_stack_owner_id_index.py b/heat/db/sqlalchemy/migrate_repo/versions/071_stack_owner_id_index.py deleted file mode 100644 index 4c86a0c159..0000000000 --- a/heat/db/sqlalchemy/migrate_repo/versions/071_stack_owner_id_index.py +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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) - stack = sqlalchemy.Table('stack', meta, autoload=True) - name_index = sqlalchemy.Index('ix_stack_owner_id', stack.c.owner_id, - mysql_length=36) - name_index.create(migrate_engine) diff --git a/heat/db/sqlalchemy/migration.py b/heat/db/sqlalchemy/migration.py index 6825139078..051d6af163 100644 --- a/heat/db/sqlalchemy/migration.py +++ b/heat/db/sqlalchemy/migration.py @@ -16,7 +16,7 @@ import os from oslo_db.sqlalchemy import migration as oslo_migration -INIT_VERSION = 64 +INIT_VERSION = 70 def db_sync(engine, version=None):