Merge "Use with_variant method for dialects db types"
This commit is contained in:
commit
d794d08302
@ -24,6 +24,7 @@ from sqlalchemy import orm as sa_orm
|
|||||||
|
|
||||||
from murano.common import uuidutils
|
from murano.common import uuidutils
|
||||||
from murano.db import session as db_session
|
from murano.db import session as db_session
|
||||||
|
from murano.db.sqla import types as st
|
||||||
from murano.openstack.common import timeutils
|
from murano.openstack.common import timeutils
|
||||||
|
|
||||||
|
|
||||||
@ -265,7 +266,7 @@ class Package(BASE, ModificationsTrackedObject):
|
|||||||
id = sa.Column(sa.String(36),
|
id = sa.Column(sa.String(36),
|
||||||
primary_key=True,
|
primary_key=True,
|
||||||
default=uuidutils.generate_uuid)
|
default=uuidutils.generate_uuid)
|
||||||
archive = sa.Column(sa.LargeBinary)
|
archive = sa.Column(st.LargeBinary())
|
||||||
fully_qualified_name = sa.Column(sa.String(512),
|
fully_qualified_name = sa.Column(sa.String(512),
|
||||||
nullable=False,
|
nullable=False,
|
||||||
index=True,
|
index=True,
|
||||||
@ -283,7 +284,7 @@ class Package(BASE, ModificationsTrackedObject):
|
|||||||
secondary=package_to_tag,
|
secondary=package_to_tag,
|
||||||
cascade='save-update, merge',
|
cascade='save-update, merge',
|
||||||
lazy='joined')
|
lazy='joined')
|
||||||
logo = sa.Column(sa.LargeBinary, nullable=True)
|
logo = sa.Column(st.LargeBinary(), nullable=True)
|
||||||
owner_id = sa.Column(sa.String(36), nullable=False)
|
owner_id = sa.Column(sa.String(36), nullable=False)
|
||||||
ui_definition = sa.Column(sa.Text)
|
ui_definition = sa.Column(sa.Text)
|
||||||
supplier_logo = sa.Column(sa.LargeBinary, nullable=True)
|
supplier_logo = sa.Column(sa.LargeBinary, nullable=True)
|
||||||
|
@ -17,11 +17,5 @@ from sqlalchemy.dialects import mysql
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
def _is_mysql_avail():
|
|
||||||
return CONF.database.connection.startswith('mysql')
|
|
||||||
|
|
||||||
|
|
||||||
def LargeBinary():
|
def LargeBinary():
|
||||||
if _is_mysql_avail():
|
return sa.LargeBinary().with_variant(mysql.LONGBLOB(), 'mysql')
|
||||||
return mysql.LONGBLOB
|
|
||||||
return sa.LargeBinary
|
|
||||||
|
Loading…
Reference in New Issue
Block a user