user_id column was widened to support domain users

The length of keystone domain users is 64 chars length
but the columns that hold user_id were VARCHAR(36)

Change-Id: Idcbdd49b71ff3c88cf1801362b2f51d6cb22464e
Closes-Bug: #1521104
This commit is contained in:
Stan Lagun 2015-12-28 14:04:16 +03:00
parent 95e25b00a6
commit 64fda46806
2 changed files with 46 additions and 2 deletions

View File

@ -0,0 +1,44 @@
# 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.
"""
Change sizes of columns that hold keystone user ID to support domain users
which are 64 characters long.
Revision ID: 012
Revises: table session, table package
"""
# revision identifiers, used by Alembic.
revision = '012'
down_revision = '011'
from alembic import op
import sqlalchemy as sa
MYSQL_ENGINE = 'InnoDB'
MYSQL_CHARSET = 'utf8'
def upgrade():
op.alter_column('session', 'user_id', type_=sa.String(64), nullable=False)
op.alter_column('package', 'owner_id', type_=sa.String(64), nullable=False)
# end Alembic commands #
def downgrade():
op.alter_column('package', 'owner_id', type_=sa.String(36), nullable=False)
op.alter_column('session', 'user_id', type_=sa.String(36), nullable=False)
# end Alembic commands #

View File

@ -114,7 +114,7 @@ class Session(Base, TimestampMixin):
default=uuidutils.generate_uuid)
environment_id = sa.Column(sa.String(255), sa.ForeignKey('environment.id'))
user_id = sa.Column(sa.String(36), nullable=False)
user_id = sa.Column(sa.String(64), nullable=False)
state = sa.Column(sa.String(36), nullable=False)
description = sa.Column(st.JsonBlob(), nullable=False)
version = sa.Column(sa.BigInteger, nullable=False, default=0)
@ -251,7 +251,7 @@ class Package(Base, TimestampMixin):
cascade='save-update, merge',
lazy='joined')
logo = sa.Column(st.LargeBinary(), nullable=True)
owner_id = sa.Column(sa.String(36), nullable=False)
owner_id = sa.Column(sa.String(64), nullable=False)
ui_definition = sa.Column(sa.Text)
supplier_logo = sa.Column(sa.LargeBinary, nullable=True)
categories = sa_orm.relationship("Category",