<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2731/">https://reviewboard.asterisk.org/r/2731/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On August 1st, 2013, 8:51 a.m. UTC, <b>wdoekes</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">But I too favor the old SQL files over an extra Alembic dependency and less readable files.
If however using Alembic makes it easier to update the in-tree SQL files, I could see some use for it there.</pre>
</blockquote>
<p>On August 1st, 2013, 2:42 p.m. UTC, <b>Russell Bryant</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The primary benefit is in schema migration. When Asterisk N+1 gets released, and you need to update your existing installation with some additional columns. You re-run alembic and it gets everything up to date for you.
The secondary benefit is maintaining the schema in one place, as opposed to duplicated for each database (and completely out of sync or non-existent for some of them).
It can generate the SQL files, as well. See the bottom of the README.</pre>
</blockquote>
<p>On August 1st, 2013, 2:52 p.m. UTC, <b>Tilghman Lesher</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">How about if, as a release task, we generate the SQL files and package them? Since it can upgrade existing installations, there's a use for having it in the tarball, but those who are unfamiliar (as newbies tend to be), can have the simple SQL files to reference.</pre>
</blockquote>
<p>On August 1st, 2013, 3:04 p.m. UTC, <b>Russell Bryant</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">What value does having the SQL files provide? Just so you don't have to install the dependencies to get your db created? Having both seems weird. If folks are uncomfortable with the dependency, I think I'd rather just drop it.</pre>
</blockquote>
<p>On August 1st, 2013, 4:15 p.m. UTC, <b>Matt Jordan</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">A couple observations:
(1) The schemas between MySQL and PostgreSQL are often disjoint. This causes confusion.
(2) We've had folders for Oracle and SQLServer that have been empty for... I don't know how long. Probably a long time. (Yes, Oracle. Yes, SQLServer. People do still use those however.)
(3) We (as in the "collective Asterisk Developer Community We") are typically bad at remembering to update the realtime schemas when we make a change.
(3.1) As a corollary, when we do remember to update the schemas, we often forget to do all of the supported schemas.
(3.2) As a further corollary, when we do remember to update the supported schemas, we often forget to note the change in the CHANGES/UPGRADE files.
Anything that helps alleviate *any* of the above points I'm a fan of. As a speculative bonus, we may be able to also produce wiki-able documentation for the schemas for a particular version as well - which is also nifty.
I like this patch - it makes developer's lives easier and reduces the the number of places things have to be updated when a schema change is needed.
Tilghman's concern about not having generated SQL files is justifiable however - not everyone will have Alembic, remember to run it, understand how to run it, or generally "get" what is going on. While I don't think we need the SQL files in the branches or even the tags, updating the release scripts to produce SQL files for the tarballs and/or packages is relatively minor and could be done for Asterisk 12. I'm okay with that.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">+1
That was the point I was trying to get across, and Matt expressed it a lot better than I did.</pre>
<br />
<p>- Tilghman</p>
<br />
<p>On August 1st, 2013, 4:12 a.m. UTC, Russell Bryant wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Russell Bryant.</div>
<p style="color: grey;"><i>Updated Aug. 1, 2013, 4:12 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I ran schema upgrade/downgrade against MariaDB (MySQL compatible). The schema came out as expected. I haven't hooked it up to Asterisk, though...</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/CHANGES <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/ast-db-manage/README.md <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/config.ini.sample <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/config/env.py <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/config/script.py.mako <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/voicemail.ini.sample <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/voicemail/env.py <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/voicemail/script.py.mako <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/ast-db-manage/voicemail/versions/a2e9769475e_create_tables.py <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/contrib/realtime/mysql/iaxfriends.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/meetme.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/musiconhold.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/queue_log.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/sippeers.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/voicemail.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/voicemail_data.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/mysql/voicemail_messages.sql <span style="color: grey">(395934)</span></li>
<li>/trunk/contrib/realtime/postgresql/realtime.sql <span style="color: grey">(395934)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2731/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>