Add database schema management using Alembic

This patch replaces contrib/realtime/ with a new setup for managing the
database schema required for database integration with Asterisk.  In
addition to initializing a database with the proper schema, alembic can do a
database migration to assist with upgrading Asterisk in the future.
Hopefully this helps make setting up and operating Asterisk with a database
easier.

With this the schema only needs to be maintained in one place instead of
once per database.  The schemas I have added here have a bit of improvement
over the examples that were there before (some added consistency and added
some missing indexes).  Managing the schema in one place here also applies
to all databases supported by SQLAlchemy.

See contrib/ast-db-manage/README.md for more details.

Review: https://reviewboard.asterisk.org/r/2731

patch by Russell Bryant (license 6300)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397874 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2013-08-28 20:55:31 +00:00
parent 0f61ca1b36
commit 402d4578ba
10 changed files with 10 additions and 517 deletions

View File

@@ -1,19 +0,0 @@
CREATE TABLE musiconhold (
-- Name of the MOH class
name char(80) not null primary key,
-- One of 'custom', 'files', 'mp3nb', 'quietmp3nb', or 'quietmp3'
mode char(80) null,
-- If 'custom', directory is ignored. Otherwise, specifies a directory with files to play or a stream URL
directory char(255) null,
-- If 'custom', application will be invoked to provide MOH. Ignored otherwise.
application char(255) null,
-- Digit associated with this MOH class, when MOH is selectable by the caller.
digit char(1) null,
-- One of 'random' or 'alpha', to determine how files are played. If NULL, files are played in directory order
sort char(10) null,
-- In custom mode, the format of the audio delivered. Ignored otherwise. Defaults to SLIN.
format char(10) null,
-- When this record was last modified
stamp timestamp
);