User Tools

Site Tools


install:upgrade:3.2.x-to-3.3.0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
install:upgrade:3.2.x-to-3.3.0 [2011/12/21 17:12]
86.59.95.122 created
install:upgrade:3.2.x-to-3.3.0 [2012/05/04 18:19]
miconda [SQL Commands]
Line 5: Line 5:
 ===== Database Structure ===== ===== Database Structure =====
  
-These sections presents notes, listed by modules, about the structure of database tables that existed in v3.2.x and changed during development of v3.2.0.+These sections presents notes, listed by modules, about the structure of database tables that existed in v3.2.x and changed during development of v3.3.0. 
 + 
 +==== modules_k/dialog ==== 
 + 
 +  * table **dialog** 
 +    * table version is 7 
 +    * new columns: 
 +      * iflags INT(10) UNSIGNED DEFAULT 0 NOT NULL 
 +      * xdata VARCHAR(512) 
 +    * column definition changes: 
 +      * caller_cseq VARCHAR(20) NOT NULL 
 +      * callee_cseq VARCHAR(20) NOT NULL 
 + 
 +==== modules_k/domain ==== 
 +  * new table **domain_attrs** 
 +  * table **domain** 
 +    * new column **did**
  
 ==== modules/lcr ==== ==== modules/lcr ====
Line 11: Line 27:
   * table **lcr_gw**   * table **lcr_gw**
     * ip_addr column has now the size varchar(47)     * ip_addr column has now the size varchar(47)
 +  * table **lcr_rule**
 +    * new column request_uri varchar(64)
 +    * table version is 2
 +==== modules_k/msilo ====
 +
 +  * table **silo**
 +    * table version is 6
 +    * new columns:
 +      * extra_hdrs TEXT DEFAULT ' ' NOT NULL
 +
 +==== modules/mtree ====
 +
 +  * table **mtrees**
 +    * table version is 2
 +    * definition changes:
 +      * drop: CONSTRAINT tname_tprefix_idx UNIQUE (tname, tprefix)
 +      * add: CONSTRAINT tname_tprefix_tvalue_idx UNIQUE (tname, tprefix, tvalue)
 +
 +==== modules_k/permissions ====
 +
 +  * table **address**
 +    * table version is 5
 +    * column definition changes:
 +      * grp INT(11) UNSIGNED DEFAULT 1 NOT NULL
 +      * ip_addr VARCHAR(48) NOT NULL
 +      * mask INT DEFAULT 32 NOT NULL
 +
 +==== modules_k/usrloc ====
 +  * table **aliases**
 +    * table version is 5
 +    * new columns:
 +      * ruid VARCHAR(64) DEFAULT ' ' NOT NULL
 +      * instance VARCHAR(255) DEFAULT NULL
 +  * table **location**
 +    * table version is 5
 +    * new columns:
 +      * ruid VARCHAR(64) DEFAULT ' ' NOT NULL
 +      * instance VARCHAR(255) DEFAULT NULL
 +      * reg_id INT(11) DEFAULT 0 NOT NULL
 +
 ==== SQL Commands ==== ==== SQL Commands ====
 +
 +=== MySQL ===
  
 You can use next SQL commands (made for MySQL) to update the structure of existing tables in v3.2.x for v3.3.0: You can use next SQL commands (made for MySQL) to update the structure of existing tables in v3.2.x for v3.3.0:
  
 <code sql> <code sql>
 +-- DIALOG
 +ALTER TABLE dialog ADD iflags INT(10) UNSIGNED DEFAULT 0 NOT NULL;
 +ALTER TABLE dialog ADD xdata VARCHAR(512);
 +ALTER TABLE dialog MODIFY caller_cseq VARCHAR(20) NOT NULL;
 +ALTER TABLE dialog MODIFY callee_cseq VARCHAR(20) NOT NULL;
 +UPDATE version SET table_version=7 WHERE table_name='dialog';
  
 +-- DOMAIN
 +ALTER TABLE domain ADD did VARCHAR(64) DEFAULT NULL;
 +UPDATE version SET table_version=2 WHERE table_name='domain';
 +
 +CREATE TABLE domain_attrs (
 +    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
 +    did VARCHAR(64) NOT NULL,
 +    name VARCHAR(32) NOT NULL,
 +    type INT UNSIGNED NOT NULL,
 +    value VARCHAR(255) NOT NULL,
 +    last_modified DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
 +    CONSTRAINT domain_attrs_idx UNIQUE (did, name, value)
 +) ENGINE=MyISAM;
 +INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
 +
 +-- LCR
 ALTER TABLE lcr_gw MODIFY ip_addr VARCHAR(47) NOT NULL; ALTER TABLE lcr_gw MODIFY ip_addr VARCHAR(47) NOT NULL;
 +ALTER TABLE lcr_rule ADD COLUMN request_uri VARCHAR(64) DEFAULT NULL AFTER prefix;
 +ALTER TABLE lcr_rule DROP KEY lcr_id_prefix_from_uri_idx;
 +ALTER TABLE lcr_rule ADD CONSTRAINT UNIQUE lcrid_prefix_ruri_furi_idx(`lcr_id`,`prefix`, `request_uri`, `from_uri`);
 +UPDATE version SET table_version=2 WHERE table_name='lcr_rule';
  
 +-- MSILO
 +ALTER TABLE silo ADD extra_hdrs TEXT DEFAULT '' NOT NULL;
 +UPDATE version SET table_version=6 WHERE table_name='silo';
 +
 +-- MTREE
 +
 +ALTER TABLE mtrees ADD CONSTRAINT tname_tprefix_idx UNIQUE (tname, tprefix);
 +ALTER TABLE mtrees DROP CONSTRAINT tname_tprefix_tvalue_idx UNIQUE (tname, tprefix, tvalue);
 +UPDATE version SET table_version=2 WHERE table_name='mtrees';
 +
 +-- PERMISSIONS
 +ALTER TABLE address MODIFY grp INT(11) UNSIGNED DEFAULT 1 NOT NULL;
 +ALTER TABLE address MODIFY ip_addr VARCHAR(48) NOT NULL;
 +ALTER TABLE address MODIFY mask INT DEFAULT 32 NOT NULL;
 +UPDATE version SET table_version=5 WHERE table_name='address';
 +
 +-- USRLOC
 +ALTER TABLE aliases ADD ruid VARCHAR(64) DEFAULT '' NOT NULL;
 +ALTER TABLE aliases ADD instance VARCHAR(255) DEFAULT NULL;
 +ALTER TABLE aliases ADD reg_id INT(11) DEFAULT 0 NOT NULL;
 +UPDATE version SET table_version=2 WHERE table_name='aliases';
 +
 +ALTER TABLE location ADD ruid VARCHAR(64) DEFAULT '' NOT NULL;
 +ALTER TABLE location ADD instance VARCHAR(255) DEFAULT NULL;
 +ALTER TABLE location ADD reg_id INT(11) DEFAULT 0 NOT NULL;
 +UPDATE version SET table_version=2 WHERE table_name='location';
 </code> </code>
  
-This is the translation of the above script for PostgreSQL (should work with 9.1.1, but is untested!)+=== PostgreSQL === 
 + 
 +This is the translation of the above MySQL script for PostgreSQL (should work with 9.1.1, but is untested!)
  
 <code sql> <code sql>
Line 28: Line 140:
  
 </code> </code>
- 
 ===== Modules ===== ===== Modules =====
 +
 +==== modules_k/presence ====
 +
 +  * removed db_mode and fallback2db parameters
 +  * added two new parameters subs_db_mode and publ_cache to replace the ones that were removed
  
 ==== modules/your-module-here ==== ==== modules/your-module-here ====
  
   * Add changes or additions reflected in kamailio config syntax here.   * Add changes or additions reflected in kamailio config syntax here.
install/upgrade/3.2.x-to-3.3.0.txt · Last modified: 2014/09/23 11:21 by klaus3000