[asterisk-dev] [Code Review] 3227: alembic: Add missing queue and cdr table creation scripts.

Kevin Harwell reviewboard at asterisk.org
Wed Mar 5 09:39:33 CST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3227/#review11070
-----------------------------------------------------------



/branches/12/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py
<https://reviewboard.asterisk.org/r/3227/#comment20714>

    I believe these and any other ones that have previously defined enums will fail on a downgrade/upgrade due to the enum already existing (that is if they had been created by another script and are already in the database).
    
    This can be worked around by not creating it by default if it already exists.  Unfortunately you have to use the postgres specific enum for this, but it seems to work okay for mysql.  Here is an example from the 12_1 script under configs:
    
    from sqlalchemy.dialects.postgresql import ENUM
    
    yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)



/branches/12/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py
<https://reviewboard.asterisk.org/r/3227/#comment20715>

    Any enums created in this script need to be dropped as well on a downgrade


- Kevin Harwell


On March 3, 2014, 12:53 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3227/
> -----------------------------------------------------------
> 
> (Updated March 3, 2014, 12:53 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-23233
>     https://issues.asterisk.org/jira/browse/ASTERISK-23233
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Created the queues, queue_members, and cdr alembic scripts.
> 
> The CDR table is more of an example for new setups since the actual table can be fully customized in cdr_adaptive_odbc.conf.
> 
> 
> Diffs
> -----
> 
>   /branches/12/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py PRE-CREATION 
>   /branches/12/contrib/ast-db-manage/cdr/versions/210693f3123d_create_cdr_table.py PRE-CREATION 
>   /branches/12/contrib/ast-db-manage/cdr/script.py.mako PRE-CREATION 
>   /branches/12/contrib/ast-db-manage/cdr/env.py PRE-CREATION 
>   /branches/12/contrib/ast-db-manage/cdr.ini.sample PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/3227/diff/
> 
> 
> Testing
> -------
> 
> Created a postgres DB to see that queues and members were read in.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140305/891dc7d8/attachment-0001.html>


More information about the asterisk-dev mailing list