Change database migration version to ussuri
Change-Id: Ic80b169d34ae9adc6d1329785f80a0d27d2cb241
This commit is contained in:
parent
0eacf2da18
commit
d413625172
@ -47,9 +47,9 @@ def get_backend():
|
|||||||
# Migration-related constants
|
# Migration-related constants
|
||||||
EXPAND_BRANCH = 'expand'
|
EXPAND_BRANCH = 'expand'
|
||||||
CONTRACT_BRANCH = 'contract'
|
CONTRACT_BRANCH = 'contract'
|
||||||
CURRENT_RELEASE = 'train'
|
CURRENT_RELEASE = 'ussuri'
|
||||||
ALEMBIC_INIT_VERSION = 'liberty'
|
ALEMBIC_INIT_VERSION = 'liberty'
|
||||||
LATEST_REVISION = 'rocky_contract02'
|
LATEST_REVISION = 'train_contract01'
|
||||||
INIT_VERSION = 0
|
INIT_VERSION = 0
|
||||||
|
|
||||||
MIGRATE_REPO_PATH = os.path.join(
|
MIGRATE_REPO_PATH = os.path.join(
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
# Copyright (C) 2020 RedHat Inc.
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
|
||||||
|
def has_migrations(engine):
|
||||||
|
"""Returns true if at least one data row can be migrated."""
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def migrate(engine):
|
||||||
|
"""Return the number of rows migrated."""
|
||||||
|
|
||||||
|
return 0
|
@ -0,0 +1,25 @@
|
|||||||
|
# Copyright (C) 2020 RedHat Inc
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'ussuri_contract01'
|
||||||
|
down_revision = 'train_contract01'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = 'ussuri_expand01'
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
pass
|
@ -0,0 +1,30 @@
|
|||||||
|
# Copyright (C) 2020 RedHat Inc
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
"""empty expand for symmetry with ussuri_expand01
|
||||||
|
|
||||||
|
Revision ID: ussuri_expand01
|
||||||
|
Revises: train_expand01
|
||||||
|
Create Date: 2020-01-03 11:55:16.657499
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'ussuri_expand01'
|
||||||
|
down_revision = 'train_expand01'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
pass
|
@ -81,7 +81,7 @@ class TestTrainMigrate01Mixin(test_migrations.AlembicMigrationsMixin):
|
|||||||
self.assertIn('"backend":', row['meta_data'])
|
self.assertIn('"backend":', row['meta_data'])
|
||||||
|
|
||||||
# run data migrations
|
# run data migrations
|
||||||
data_migrations.migrate(engine)
|
data_migrations.migrate(engine, release='train')
|
||||||
|
|
||||||
# check that meta_data has 'backend' key replaced with 'store'
|
# check that meta_data has 'backend' key replaced with 'store'
|
||||||
rows = (image_locations.select()
|
rows = (image_locations.select()
|
||||||
|
Loading…
Reference in New Issue
Block a user