Ticket #1792: sqlit3-new.patch
| File sqlit3-new.patch, 4.1 kB (added by diego_iastrubni, 1 year ago) |
|---|
-
install.sql
old new -
module.xml
old new 1 1 <module> 2 2 <rawname>ivr</rawname> 3 3 <name>IVR</name> 4 <version>2. 5.14.2</version>4 <version>2.6.0</version> 5 5 <type>setup</type> 6 6 <category>Inbound Call Control</category> 7 7 <description> 8 8 Creates Digital Receptionist (aka Auto-Attendant, aka Interactive Voice Response) menus. These can be used to send callers to different locations (eg, "Press 1 for sales") and/or allow direct-dialing of extension numbers. 9 9 </description> 10 10 <changelog> 11 *2.6.0* sane version, add SQLite3 support, fixes http://freepbx.org/trac/ticket/1792 11 12 *2.5.14.2* merge findmefollow/core extension destinations if any 12 13 *2.5.14.1* removed depends on 2.2.2 - classes are in all version of 2.3 13 14 *2.5.14* add waitexten to 2.2 -
uninstall.sql
old new 1 DROP TABLE IF EXISTS ivr;2 DROP TABLE IF EXISTS ivr_dests;1 DROP TABLE IF EXISTS `ivr`; 2 DROP TABLE IF EXISTS `ivr_dests`; -
install.php
old new 1 1 <?php 2 sql('CREATE TABLE IF NOT EXISTS ivr ( ivr_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, displayname VARCHAR(50), deptname VARCHAR(50), enable_directory VARCHAR(8), enable_directdial VARCHAR(8), timeout INT, announcement VARCHAR(255), dircontext VARCHAR ( 50 ) DEFAULT "default" )');3 sql('CREATE TABLE IF NOT EXISTS ivr_dests ( ivr_id INT NOT NULL, selection VARCHAR(10), dest VARCHAR(50))');4 5 2 global $db; 6 3 4 // install the tables 5 $autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT"; 6 7 $sql = "CREATE TABLE IF NOT EXISTS ivr ( 8 ivr_id INTEGER NOT NULL PRIMARY KEY $autoincrement, 9 displayname VARCHAR(50), 10 deptname VARCHAR(50), 11 enable_directory VARCHAR(8), 12 enable_directdial VARCHAR(8), 13 timeout INTEGER, 14 announcement VARCHAR(255), 15 dircontext VARCHAR ( 50 ) DEFAULT \"default\" 16 );"; 17 $check = $db->query($sql); 18 if (DB::IsError($check)) { 19 die( "Can not create `ivr` table: " . $check->getMessage() . "\n"); 20 } 21 22 $sql = "CREATE TABLE IF NOT EXISTS ivr_dests ( 23 ivr_id INTEGER NOT NULL, 24 selection VARCHAR(10), 25 dest VARCHAR(50), 26 ivr_ret TINYINT(1) NOT NULL DEFAULT 0 27 );"; 28 $check = $db->query($sql); 29 if (DB::IsError($check)) { 30 die( "Can not create `ivrdests` table: " . $check->getMessage() . "\n"); 31 } 32 33 $ivr_modcurrentvers = modules_getversion('ivr'); 34 7 35 // Now, we need to check for upgrades. 8 36 // V1.0, old IVR. You shouldn't see this, but check for it anyway, and assume that it's 2.0 9 37 // V2.0, Original Release … … 11 39 // v2.2, announcement changed to support filenames instead of ID's from recordings table 12 40 // 13 41 14 $ivr_modcurrentvers = modules_getversion('ivr');15 16 42 // Add the col 17 43 $sql = "SELECT dircontext FROM ivr"; 18 44 $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); … … 25 51 } 26 52 } 27 53 28 if ( version_compare($ivr_modcurrentvers, "2.2", "<")) {54 if ( ($ivr_modcurrentvers != "") && (version_compare($ivr_modcurrentvers, "2.2", "<")) ) { 29 55 //echo "<p>Start 2.2 upgrade</p>"; 30 56 $sql = "ALTER TABLE ivr CHANGE COLUMN announcement announcement VARCHAR ( 255 )"; 31 57 $result = $db->query($sql);
