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)
........

Merged revisions 397874 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2013-08-28 20:55:53 +00:00
parent b7ec25ec2e
commit 629f43d2b6
10 changed files with 10 additions and 517 deletions

View File

@@ -1,24 +0,0 @@
CREATE TABLE queue_log (
-- Event date and time
time datetime,
-- "REALTIME", "NONE", or channel uniqueid
callid char(50),
-- Name of the queue affected
queuename char(50),
-- Interface name of the queue member
agent char(50),
-- One of ADDMEMBER, REMOVEMEMBER, RINGNOANSWER, EXITEMPTY, TRANSFER,
-- AGENTDUMP, ABANDON, SYSCOMPAT, CONNECT, COMPLETECALLER, COMPLETEAGENT,
-- PAUSEALL, UNPAUSEALL, PAUSE, UNPAUSE, PENALTY, ENTERQUEUE,
-- EXITWITHTIMEOUT, EXITEMPTY, EXITWITHKEY, or another defined by the user.
event char(20),
-- data1 through data5 are possible arguments to the event, the definitions
-- of which are dependent upon the type of event.
data1 char(50),
data2 char(50),
data3 char(50),
data4 char(50),
data5 char(50),
index bydate (time),
index qname (queuename,time)
);