summaryrefslogtreecommitdiff
path: root/ironic/db/sqlalchemy/alembic/versions
diff options
context:
space:
mode:
authorSatoru Moriya <satoru.moriya.br@hitachi.com>2016-02-26 19:49:15 +0900
committerRuby Loo <ruby.loo@intel.com>2016-12-01 16:38:11 +0000
commit07541047bef7e8fea15894ef295be38f8cfe1074 (patch)
tree9a466bf3cac227ea1e8e23b385c133ec7d1e2e80 /ironic/db/sqlalchemy/alembic/versions
parentf857a883d38ad152bb6ae1739127672173b2a564 (diff)
downloadironic-07541047bef7e8fea15894ef295be38f8cfe1074.tar.gz
Add volume_targets table to database
This patch adds a "volume_targets" DB table in order to save the volume target information of physical nodes. With this patch, Ironic can put/get volume target information to/from the database. Co-Authored-By: Stephane Miller <stephane@alum.mit.edu> Co-Authored-By: Ruby Loo <ruby.loo@intel.com> Change-Id: I79063f9d0aafd7b740785a883732536704e43b7c Partial-Bug: 1526231
Diffstat (limited to 'ironic/db/sqlalchemy/alembic/versions')
-rw-r--r--ironic/db/sqlalchemy/alembic/versions/1a59178ebdf6_add_volume_targets_table.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/ironic/db/sqlalchemy/alembic/versions/1a59178ebdf6_add_volume_targets_table.py b/ironic/db/sqlalchemy/alembic/versions/1a59178ebdf6_add_volume_targets_table.py
new file mode 100644
index 000000000..ba9c7ce42
--- /dev/null
+++ b/ironic/db/sqlalchemy/alembic/versions/1a59178ebdf6_add_volume_targets_table.py
@@ -0,0 +1,51 @@
+# 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.
+
+"""Add volume_targets table
+
+Revision ID: 1a59178ebdf6
+Revises: daa1ba02d98
+Create Date: 2016-02-25 11:25:29.836535
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '1a59178ebdf6'
+down_revision = 'daa1ba02d98'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ op.create_table('volume_targets',
+ sa.Column('created_at', sa.DateTime(), nullable=True),
+ sa.Column('updated_at', sa.DateTime(), nullable=True),
+ sa.Column('id', sa.Integer(), nullable=False),
+ sa.Column('uuid', sa.String(length=36), nullable=True),
+ sa.Column('node_id', sa.Integer(), nullable=True),
+ sa.Column('volume_type', sa.String(length=64),
+ nullable=True),
+ sa.Column('properties', sa.Text(), nullable=True),
+ sa.Column('boot_index', sa.Integer(), nullable=True),
+ sa.Column('volume_id',
+ sa.String(length=36), nullable=True),
+ sa.Column('extra', sa.Text(), nullable=True),
+ sa.ForeignKeyConstraint(['node_id'], ['nodes.id'], ),
+ sa.PrimaryKeyConstraint('id'),
+ sa.UniqueConstraint('node_id', 'boot_index',
+ name='uniq_volumetargets0node_id0'
+ 'boot_index'),
+ sa.UniqueConstraint('uuid',
+ name='uniq_volumetargets0uuid'),
+ mysql_charset='utf8',
+ mysql_engine='InnoDB')