diff options
author | George Joseph <gjoseph@digium.com> | 2016-10-04 15:59:54 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2016-10-07 07:49:42 -0500 |
commit | 442b597929c8d81fc41a9cbd8439e6ec215ba9ea (patch) | |
tree | f307ef3ec51f360e285077335cb37cd49f4455a0 /cel | |
parent | 55e8c9eff24b5d6f22cbb0f9a9aa165e63f3d538 (diff) |
alembic: Allow cdr, config and voicemail to exist in the same schema
cdr, config and voicemail are all separate alembic trees. Because
alembic's default is to use a table named 'alembic_version' to store
the current tree revision, the 3 trees can't exist in the same schema
without stepping on each other.
Now each tree uses 'alembic_version_<tree_name>' as the version table.
Each tree's env.py script now first checks for 'alembic_version'. If
it finds it AND its revision is in the tree's history, the script
renames it to 'alembic_version_<tree_name>'. Regardless, the script
then continues with the migration using 'alembic_version_<tree_name>'
and creates that table if it's not found. The result is that if an
existing 'alembic_version' table was found but it didn't belong to this
tree, it's left alone and 'alembic_version_<tree_name>' is used or
created.
WARNING: If multiple trees are using the same schema, they MUST NOT
CRU or D any objects with names that might exist in the other trees.
An example would be 'yesno_values' type. If two trees perform
operations on it, one tree could pull it out from under the other.
Thankfully we currently don't share any names among cdr, config and
voicemail.
NOTE: Since the env.py scripts in each tree were identical, a common
env.py has been placed in the ast-db-manage directory and a symlink
to it has been placed in each tree directory.
ASTERISK-24311 #close
Reported-by: Dafi Ni
Change-Id: I4d593f000350deb5d21a14fa1e9bc3896844d898
Diffstat (limited to 'cel')
0 files changed, 0 insertions, 0 deletions