Alembic-migration

Using alembic-migration, required data modeling for networking-sfc is defined and applied to the database. Refer to Neutron alembic migration process for further details.

The important operations are listed below.

Checking migration

neutron-db-manage --subproject networking-sfc check_migration
  Running branches for networking-sfc ...
start_networking_sfc (branchpoint)
                     -> 48072cb59133 (contract) (head)
                     -> 24fc7241aa5 (expand)

  OK

Checking branch information

neutron-db-manage --subproject networking-sfc branches
  Running branches for networking-sfc ...
start_networking_sfc (branchpoint)
                     -> 48072cb59133 (contract) (head)
                     -> 24fc7241aa5 (expand)

  OK

Checking migration history

neutron-db-manage --subproject networking-sfc history
  Running history for networking-sfc ...
9768e6a66c9 -> 5a475fc853e6 (expand) (head), Defining OVS data-model
24fc7241aa5 -> 9768e6a66c9 (expand), Defining flow-classifier data-model
start_networking_sfc -> 24fc7241aa5 (expand), Defining Port Chain data-model.
start_networking_sfc -> 48072cb59133 (contract) (head), Initial Liberty no-op script.
<base> -> start_networking_sfc (branchpoint), start networking-sfc chain

Applying changes

neutron-db-manage --subproject networking-sfc upgrade head
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade for networking-sfc ...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> start_networking_sfc, start networking-sfc chain
INFO  [alembic.runtime.migration] Running upgrade start_networking_sfc -> 48072cb59133, Initial Liberty no-op script.
INFO  [alembic.runtime.migration] Running upgrade start_networking_sfc -> 24fc7241aa5, Defining Port Chain data-model.
INFO  [alembic.runtime.migration] Running upgrade 24fc7241aa5 -> 9768e6a66c9, Defining flow-classifier data-model
INFO  [alembic.runtime.migration] Running upgrade 9768e6a66c9 -> 5a475fc853e6, Defining OVS data-model
  OK

Checking current version

neutron-db-manage --subproject networking-sfc current
  Running current for networking-sfc ...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
48072cb59133 (head)
5a475fc853e6 (head)
  OK