Merge "Support MariaDB in the migration scripts"

This commit is contained in:
Jenkins 2017-01-31 15:33:08 +00:00 committed by Gerrit Code Review
commit 0f3948c7c0
2 changed files with 12 additions and 0 deletions

View File

@ -33,6 +33,9 @@ LOG = log.getLogger(__name__)
def upgrade(active_plugins=None, options=None):
version_info = op.get_bind().engine.dialect.server_version_info
if version_info[-1] == "MariaDB":
# Removes fake mysql prefix
version_info = version_info[-4:]
if version_info[0] < 5 or version_info[0] == 5 and version_info[1] < 6:
LOG.warning(
"MySQL version is lower than 5.6. Skipping full-text indexes")
@ -60,6 +63,9 @@ def upgrade(active_plugins=None, options=None):
def downgrade(active_plugins=None, options=None):
version_info = op.get_bind().engine.dialect.server_version_info
if version_info[-1] == "MariaDB":
# Removes fake mysql prefix
version_info = version_info[-4:]
if version_info[0] < 5 or version_info[0] == 5 and version_info[1] < 6:
LOG.warning(
"MySQL version is lower than 5.6. Skipping full-text indexes")

View File

@ -36,6 +36,9 @@ def upgrade(active_plugins=None, options=None):
# Handle the FT Index on the user table.
version_info = op.get_bind().engine.dialect.server_version_info
if version_info[-1] == "MariaDB":
# Removes fake mysql prefix
version_info = version_info[-4:]
if version_info[0] < 5 or version_info[0] == 5 and version_info[1] < 6:
LOG.warning(
"MySQL version is lower than 5.6. Skipping full-text indexes")
@ -54,6 +57,9 @@ def downgrade(active_plugins=None, options=None):
)
version_info = op.get_bind().engine.dialect.server_version_info
if version_info[-1] == "MariaDB":
# Removes fake mysql prefix
version_info = version_info[-4:]
if version_info[0] < 5 or version_info[0] == 5 and version_info[1] < 6:
LOG.warning(
"MySQL version is lower than 5.6. Skipping full-text indexes")