Yes, the schema can change between versions. Following the instructions on
https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime#SettingupPJSIPRealtime-InstallingandUsingAlembic
will cause alembic to upgrade the tables.
--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at:
www.digium.com & www.asterisk.org
I'm not a fan of alembic at all, but I'll give it another try.
One issue I have is I don't want it to make the extensions table, because I
already use that name of table for some proprietary stuff I use. Right now it's
complaining that I already have a table named that. Any way to exclude that
other stuff, and only have it manage the core sip_devices and PJSIP stuff?
travis@pcimphone1:~/downloads/asterisk-13.5.0/contrib/ast-db-manage$ sudo
alembic -c config.ini upgrade head
INFO [alembic.migration] Context impl MySQLImpl.
INFO [alembic.migration] Will assume non-transactional DDL.
INFO [alembic.migration] Running upgrade 43956d550a44 -> 581a4264e537, adding
extensions
Traceback (most recent call last):
File "/usr/bin/alembic", line 9, in <module>
load_entry_point('alembic==0.6.2', 'console_scripts', 'alembic')()
File "/usr/lib/python2.7/dist-packages/alembic/config.py", line 298, in main
CommandLine(prog=prog).main(argv=argv)
File "/usr/lib/python2.7/dist-packages/alembic/config.py", line 293, in main
self.run_cmd(cfg, options)
File "/usr/lib/python2.7/dist-packages/alembic/config.py", line 279, in
run_cmd
**dict((k, getattr(options, k)) for k in kwarg)
File "/usr/lib/python2.7/dist-packages/alembic/command.py", line 124, in
upgrade
script.run_env()
File "/usr/lib/python2.7/dist-packages/alembic/script.py", line 199, in
run_env
util.load_python_file(self.dir, 'env.py')
File "/usr/lib/python2.7/dist-packages/alembic/util.py", line 199, in
load_python_file
module = load_module(module_id, path)
File "/usr/lib/python2.7/dist-packages/alembic/compat.py", line 55, in
load_module
mod = imp.load_source(module_id, path, fp)
File "config/env.py", line 73, in <module>
run_migrations_online()
File "config/env.py", line 66, in run_migrations_online
context.run_migrations()
File "<string>", line 7, in run_migrations
File "/usr/lib/python2.7/dist-packages/alembic/environment.py", line 652, in
run_migrations
self.get_context().run_migrations(**kw)
File "/usr/lib/python2.7/dist-packages/alembic/migration.py", line 225, in
run_migrations
change(**kw)
File "config/versions/581a4264e537_adding_extensions.py", line 45, in upgrade
sa.Column('appdata', sa.String(256), nullable=False),
File "<string>", line 7, in create_table
File "/usr/lib/python2.7/dist-packages/alembic/operations.py", line 647, in
create_table
self._table(name, *columns, **kw)
File "/usr/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 149, in
create_table
self._exec(schema.CreateTable(table))
File "/usr/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 76, in _exec
conn.execute(construct, *multiparams, **params)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662,
in execute
params)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 720,
in _execute_ddl
compiled
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874,
in _execute_context
context)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1024,
in _handle_dbapi_exception
exc_info
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 196,
in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 867,
in _execute_context
context)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line
324, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in
execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in
defaulterrorhandler
raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (OperationalError) (1050, "Table 'extensions'
already exists") '\nCREATE TABLE extensions (\n\tid BIGINT NOT NULL
AUTO_INCREMENT, \n\tcontext VARCHAR(40) NOT NULL, \n\texten VARCHAR(40) NOT
NULL, \n\tpriority INTEGER NOT NULL, \n\tapp VARCHAR(40) NOT NULL, \n\tappdata
VARCHAR(256) NOT NULL, \n\tPRIMARY KEY (id, context, exten, priority),
\n\tUNIQUE (id)\n)\n\n' ()
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users