Selaa lähdekoodia

kamctl: db sql files updated after xsl changes

- insert statement for version is after creation of the table
Daniel-Constantin Mierla 9 vuotta sitten
vanhempi
commit
784f73b880
100 muutettua tiedostoa jossa 334 lisäystä ja 167 poistoa
  1. 6 3
      utils/kamctl/db_sqlite/acc-create.sql
  2. 2 1
      utils/kamctl/db_sqlite/alias_db-create.sql
  3. 2 1
      utils/kamctl/db_sqlite/auth_db-create.sql
  4. 2 1
      utils/kamctl/db_sqlite/avpops-create.sql
  5. 8 4
      utils/kamctl/db_sqlite/carrierroute-create.sql
  6. 2 1
      utils/kamctl/db_sqlite/cpl-create.sql
  7. 4 2
      utils/kamctl/db_sqlite/dialog-create.sql
  8. 2 1
      utils/kamctl/db_sqlite/dialplan-create.sql
  9. 2 1
      utils/kamctl/db_sqlite/dispatcher-create.sql
  10. 4 2
      utils/kamctl/db_sqlite/domain-create.sql
  11. 2 1
      utils/kamctl/db_sqlite/domainpolicy-create.sql
  12. 8 4
      utils/kamctl/db_sqlite/drouting-create.sql
  13. 4 2
      utils/kamctl/db_sqlite/group-create.sql
  14. 2 1
      utils/kamctl/db_sqlite/htable-create.sql
  15. 4 2
      utils/kamctl/db_sqlite/imc-create.sql
  16. 6 3
      utils/kamctl/db_sqlite/lcr-create.sql
  17. 2 1
      utils/kamctl/db_sqlite/matrix-create.sql
  18. 4 2
      utils/kamctl/db_sqlite/mohqueue-create.sql
  19. 2 1
      utils/kamctl/db_sqlite/msilo-create.sql
  20. 4 2
      utils/kamctl/db_sqlite/mtree-create.sql
  21. 2 1
      utils/kamctl/db_sqlite/pdt-create.sql
  22. 4 2
      utils/kamctl/db_sqlite/permissions-create.sql
  23. 2 1
      utils/kamctl/db_sqlite/pipelimit-create.sql
  24. 10 5
      utils/kamctl/db_sqlite/presence-create.sql
  25. 2 1
      utils/kamctl/db_sqlite/purple-create.sql
  26. 2 1
      utils/kamctl/db_sqlite/registrar-create.sql
  27. 4 2
      utils/kamctl/db_sqlite/rls-create.sql
  28. 2 1
      utils/kamctl/db_sqlite/rtpproxy-create.sql
  29. 2 1
      utils/kamctl/db_sqlite/sca-create.sql
  30. 2 1
      utils/kamctl/db_sqlite/siptrace-create.sql
  31. 2 1
      utils/kamctl/db_sqlite/speeddial-create.sql
  32. 2 1
      utils/kamctl/db_sqlite/standard-create.sql
  33. 2 1
      utils/kamctl/db_sqlite/uac-create.sql
  34. 2 1
      utils/kamctl/db_sqlite/uid_auth_db-create.sql
  35. 2 1
      utils/kamctl/db_sqlite/uid_avp_db-create.sql
  36. 4 2
      utils/kamctl/db_sqlite/uid_domain-create.sql
  37. 2 1
      utils/kamctl/db_sqlite/uid_gflags-create.sql
  38. 4 2
      utils/kamctl/db_sqlite/uid_uri_db-create.sql
  39. 2 1
      utils/kamctl/db_sqlite/uri_db-create.sql
  40. 4 2
      utils/kamctl/db_sqlite/userblacklist-create.sql
  41. 4 2
      utils/kamctl/db_sqlite/usrloc-create.sql
  42. 6 3
      utils/kamctl/mysql/acc-create.sql
  43. 2 1
      utils/kamctl/mysql/alias_db-create.sql
  44. 2 1
      utils/kamctl/mysql/auth_db-create.sql
  45. 2 1
      utils/kamctl/mysql/avpops-create.sql
  46. 8 4
      utils/kamctl/mysql/carrierroute-create.sql
  47. 2 1
      utils/kamctl/mysql/cpl-create.sql
  48. 4 2
      utils/kamctl/mysql/dialog-create.sql
  49. 2 1
      utils/kamctl/mysql/dialplan-create.sql
  50. 2 1
      utils/kamctl/mysql/dispatcher-create.sql
  51. 4 2
      utils/kamctl/mysql/domain-create.sql
  52. 2 1
      utils/kamctl/mysql/domainpolicy-create.sql
  53. 8 4
      utils/kamctl/mysql/drouting-create.sql
  54. 4 2
      utils/kamctl/mysql/group-create.sql
  55. 2 1
      utils/kamctl/mysql/htable-create.sql
  56. 4 2
      utils/kamctl/mysql/imc-create.sql
  57. 6 3
      utils/kamctl/mysql/lcr-create.sql
  58. 2 1
      utils/kamctl/mysql/matrix-create.sql
  59. 4 2
      utils/kamctl/mysql/mohqueue-create.sql
  60. 2 1
      utils/kamctl/mysql/msilo-create.sql
  61. 4 2
      utils/kamctl/mysql/mtree-create.sql
  62. 2 1
      utils/kamctl/mysql/pdt-create.sql
  63. 4 2
      utils/kamctl/mysql/permissions-create.sql
  64. 2 1
      utils/kamctl/mysql/pipelimit-create.sql
  65. 10 5
      utils/kamctl/mysql/presence-create.sql
  66. 2 1
      utils/kamctl/mysql/purple-create.sql
  67. 2 1
      utils/kamctl/mysql/registrar-create.sql
  68. 4 2
      utils/kamctl/mysql/rls-create.sql
  69. 2 1
      utils/kamctl/mysql/rtpproxy-create.sql
  70. 2 1
      utils/kamctl/mysql/sca-create.sql
  71. 2 1
      utils/kamctl/mysql/siptrace-create.sql
  72. 2 1
      utils/kamctl/mysql/speeddial-create.sql
  73. 2 1
      utils/kamctl/mysql/standard-create.sql
  74. 2 1
      utils/kamctl/mysql/uac-create.sql
  75. 2 1
      utils/kamctl/mysql/uid_auth_db-create.sql
  76. 2 1
      utils/kamctl/mysql/uid_avp_db-create.sql
  77. 4 2
      utils/kamctl/mysql/uid_domain-create.sql
  78. 2 1
      utils/kamctl/mysql/uid_gflags-create.sql
  79. 4 2
      utils/kamctl/mysql/uid_uri_db-create.sql
  80. 2 1
      utils/kamctl/mysql/uri_db-create.sql
  81. 4 2
      utils/kamctl/mysql/userblacklist-create.sql
  82. 4 2
      utils/kamctl/mysql/usrloc-create.sql
  83. 6 3
      utils/kamctl/oracle/acc-create.sql
  84. 2 1
      utils/kamctl/oracle/alias_db-create.sql
  85. 2 1
      utils/kamctl/oracle/auth_db-create.sql
  86. 2 1
      utils/kamctl/oracle/avpops-create.sql
  87. 8 4
      utils/kamctl/oracle/carrierroute-create.sql
  88. 2 1
      utils/kamctl/oracle/cpl-create.sql
  89. 4 2
      utils/kamctl/oracle/dialog-create.sql
  90. 2 1
      utils/kamctl/oracle/dialplan-create.sql
  91. 2 1
      utils/kamctl/oracle/dispatcher-create.sql
  92. 4 2
      utils/kamctl/oracle/domain-create.sql
  93. 2 1
      utils/kamctl/oracle/domainpolicy-create.sql
  94. 8 4
      utils/kamctl/oracle/drouting-create.sql
  95. 4 2
      utils/kamctl/oracle/group-create.sql
  96. 2 1
      utils/kamctl/oracle/htable-create.sql
  97. 4 2
      utils/kamctl/oracle/imc-create.sql
  98. 6 3
      utils/kamctl/oracle/lcr-create.sql
  99. 2 1
      utils/kamctl/oracle/matrix-create.sql
  100. 4 2
      utils/kamctl/oracle/mohqueue-create.sql

+ 6 - 3
utils/kamctl/db_sqlite/acc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('acc','5');
 CREATE TABLE acc (
     id INTEGER PRIMARY KEY NOT NULL,
     method VARCHAR(16) DEFAULT '' NOT NULL,
@@ -12,7 +11,8 @@ CREATE TABLE acc (
 
 CREATE INDEX acc_callid_idx ON acc (callid);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
+INSERT INTO version (table_name, table_version) values ('acc','5');
+
 CREATE TABLE acc_cdrs (
     id INTEGER PRIMARY KEY NOT NULL,
     start_time TIMESTAMP WITHOUT TIME ZONE DEFAULT '2000-01-01 00:00:00' NOT NULL,
@@ -22,7 +22,8 @@ CREATE TABLE acc_cdrs (
 
 CREATE INDEX acc_cdrs_start_time_idx ON acc_cdrs (start_time);
 
-INSERT INTO version (table_name, table_version) values ('missed_calls','4');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
+
 CREATE TABLE missed_calls (
     id INTEGER PRIMARY KEY NOT NULL,
     method VARCHAR(16) DEFAULT '' NOT NULL,
@@ -36,3 +37,5 @@ CREATE TABLE missed_calls (
 
 CREATE INDEX missed_calls_callid_idx ON missed_calls (callid);
 
+INSERT INTO version (table_name, table_version) values ('missed_calls','4');
+

+ 2 - 1
utils/kamctl/db_sqlite/alias_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dbaliases','1');
 CREATE TABLE dbaliases (
     id INTEGER PRIMARY KEY NOT NULL,
     alias_username VARCHAR(64) DEFAULT '' NOT NULL,
@@ -11,3 +10,5 @@ CREATE INDEX dbaliases_alias_user_idx ON dbaliases (alias_username);
 CREATE INDEX dbaliases_alias_idx ON dbaliases (alias_username, alias_domain);
 CREATE INDEX dbaliases_target_idx ON dbaliases (username, domain);
 
+INSERT INTO version (table_name, table_version) values ('dbaliases','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/auth_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('subscriber','6');
 CREATE TABLE subscriber (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) DEFAULT '' NOT NULL,
@@ -13,3 +12,5 @@ CREATE TABLE subscriber (
 
 CREATE INDEX subscriber_username_idx ON subscriber (username);
 
+INSERT INTO version (table_name, table_version) values ('subscriber','6');
+

+ 2 - 1
utils/kamctl/db_sqlite/avpops-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('usr_preferences','2');
 CREATE TABLE usr_preferences (
     id INTEGER PRIMARY KEY NOT NULL,
     uuid VARCHAR(64) DEFAULT '' NOT NULL,
@@ -13,3 +12,5 @@ CREATE TABLE usr_preferences (
 CREATE INDEX usr_preferences_ua_idx ON usr_preferences (uuid, attribute);
 CREATE INDEX usr_preferences_uda_idx ON usr_preferences (username, domain, attribute);
 
+INSERT INTO version (table_name, table_version) values ('usr_preferences','2');
+

+ 8 - 4
utils/kamctl/db_sqlite/carrierroute-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('carrierroute','3');
 CREATE TABLE carrierroute (
     id INTEGER PRIMARY KEY NOT NULL,
     carrier INTEGER DEFAULT 0 NOT NULL,
@@ -14,7 +13,8 @@ CREATE TABLE carrierroute (
     description VARCHAR(255) DEFAULT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('carrierfailureroute','2');
+INSERT INTO version (table_name, table_version) values ('carrierroute','3');
+
 CREATE TABLE carrierfailureroute (
     id INTEGER PRIMARY KEY NOT NULL,
     carrier INTEGER DEFAULT 0 NOT NULL,
@@ -28,15 +28,19 @@ CREATE TABLE carrierfailureroute (
     description VARCHAR(255) DEFAULT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('carrier_name','1');
+INSERT INTO version (table_name, table_version) values ('carrierfailureroute','2');
+
 CREATE TABLE carrier_name (
     id INTEGER PRIMARY KEY NOT NULL,
     carrier VARCHAR(64) DEFAULT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('domain_name','1');
+INSERT INTO version (table_name, table_version) values ('carrier_name','1');
+
 CREATE TABLE domain_name (
     id INTEGER PRIMARY KEY NOT NULL,
     domain VARCHAR(64) DEFAULT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('domain_name','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/cpl-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('cpl','1');
 CREATE TABLE cpl (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE cpl (
     CONSTRAINT cpl_account_idx UNIQUE (username, domain)
 );
 
+INSERT INTO version (table_name, table_version) values ('cpl','1');
+

+ 4 - 2
utils/kamctl/db_sqlite/dialog-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dialog','7');
 CREATE TABLE dialog (
     id INTEGER PRIMARY KEY NOT NULL,
     hash_entry INTEGER NOT NULL,
@@ -28,7 +27,8 @@ CREATE TABLE dialog (
 
 CREATE INDEX dialog_hash_idx ON dialog (hash_entry, hash_id);
 
-INSERT INTO version (table_name, table_version) values ('dialog_vars','1');
+INSERT INTO version (table_name, table_version) values ('dialog','7');
+
 CREATE TABLE dialog_vars (
     id INTEGER PRIMARY KEY NOT NULL,
     hash_entry INTEGER NOT NULL,
@@ -39,3 +39,5 @@ CREATE TABLE dialog_vars (
 
 CREATE INDEX dialog_vars_hash_idx ON dialog_vars (hash_entry, hash_id);
 
+INSERT INTO version (table_name, table_version) values ('dialog_vars','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/dialplan-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dialplan','2');
 CREATE TABLE dialplan (
     id INTEGER PRIMARY KEY NOT NULL,
     dpid INTEGER NOT NULL,
@@ -11,3 +10,5 @@ CREATE TABLE dialplan (
     attrs VARCHAR(64) NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dialplan','2');
+

+ 2 - 1
utils/kamctl/db_sqlite/dispatcher-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dispatcher','4');
 CREATE TABLE dispatcher (
     id INTEGER PRIMARY KEY NOT NULL,
     setid INTEGER DEFAULT 0 NOT NULL,
@@ -9,3 +8,5 @@ CREATE TABLE dispatcher (
     description VARCHAR(64) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dispatcher','4');
+

+ 4 - 2
utils/kamctl/db_sqlite/domain-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('domain','2');
 CREATE TABLE domain (
     id INTEGER PRIMARY KEY NOT NULL,
     domain VARCHAR(64) NOT NULL,
@@ -7,7 +6,8 @@ CREATE TABLE domain (
     CONSTRAINT domain_domain_idx UNIQUE (domain)
 );
 
-INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
+INSERT INTO version (table_name, table_version) values ('domain','2');
+
 CREATE TABLE domain_attrs (
     id INTEGER PRIMARY KEY NOT NULL,
     did VARCHAR(64) NOT NULL,
@@ -18,3 +18,5 @@ CREATE TABLE domain_attrs (
     CONSTRAINT domain_attrs_domain_attrs_idx UNIQUE (did, name, value)
 );
 
+INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/domainpolicy-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('domainpolicy','2');
 CREATE TABLE domainpolicy (
     id INTEGER PRIMARY KEY NOT NULL,
     rule VARCHAR(255) NOT NULL,
@@ -11,3 +10,5 @@ CREATE TABLE domainpolicy (
 
 CREATE INDEX domainpolicy_rule_idx ON domainpolicy (rule);
 
+INSERT INTO version (table_name, table_version) values ('domainpolicy','2');
+

+ 8 - 4
utils/kamctl/db_sqlite/drouting-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
 CREATE TABLE dr_gateways (
     gwid INTEGER PRIMARY KEY NOT NULL,
     type INTEGER DEFAULT 0 NOT NULL,
@@ -9,7 +8,8 @@ CREATE TABLE dr_gateways (
     description VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_rules','3');
+INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
+
 CREATE TABLE dr_rules (
     ruleid INTEGER PRIMARY KEY NOT NULL,
     groupid VARCHAR(255) NOT NULL,
@@ -21,14 +21,16 @@ CREATE TABLE dr_rules (
     description VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+INSERT INTO version (table_name, table_version) values ('dr_rules','3');
+
 CREATE TABLE dr_gw_lists (
     id INTEGER PRIMARY KEY NOT NULL,
     gwlist VARCHAR(255) NOT NULL,
     description VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+
 CREATE TABLE dr_groups (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
@@ -37,3 +39,5 @@ CREATE TABLE dr_groups (
     description VARCHAR(128) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+

+ 4 - 2
utils/kamctl/db_sqlite/group-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('grp','2');
 CREATE TABLE grp (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) DEFAULT '' NOT NULL,
@@ -8,7 +7,8 @@ CREATE TABLE grp (
     CONSTRAINT grp_account_group_idx UNIQUE (username, domain, grp)
 );
 
-INSERT INTO version (table_name, table_version) values ('re_grp','1');
+INSERT INTO version (table_name, table_version) values ('grp','2');
+
 CREATE TABLE re_grp (
     id INTEGER PRIMARY KEY NOT NULL,
     reg_exp VARCHAR(128) DEFAULT '' NOT NULL,
@@ -17,3 +17,5 @@ CREATE TABLE re_grp (
 
 CREATE INDEX re_grp_group_idx ON re_grp (group_id);
 
+INSERT INTO version (table_name, table_version) values ('re_grp','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/htable-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE htable (
     id INTEGER PRIMARY KEY NOT NULL,
     key_name VARCHAR(64) DEFAULT '' NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE htable (
     expires INTEGER DEFAULT 0 NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('htable','2');
+

+ 4 - 2
utils/kamctl/db_sqlite/imc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('imc_rooms','1');
 CREATE TABLE imc_rooms (
     id INTEGER PRIMARY KEY NOT NULL,
     name VARCHAR(64) NOT NULL,
@@ -7,7 +6,8 @@ CREATE TABLE imc_rooms (
     CONSTRAINT imc_rooms_name_domain_idx UNIQUE (name, domain)
 );
 
-INSERT INTO version (table_name, table_version) values ('imc_members','1');
+INSERT INTO version (table_name, table_version) values ('imc_rooms','1');
+
 CREATE TABLE imc_members (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
@@ -17,3 +17,5 @@ CREATE TABLE imc_members (
     CONSTRAINT imc_members_account_room_idx UNIQUE (username, domain, room)
 );
 
+INSERT INTO version (table_name, table_version) values ('imc_members','1');
+

+ 6 - 3
utils/kamctl/db_sqlite/lcr-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('lcr_gw','3');
 CREATE TABLE lcr_gw (
     id INTEGER PRIMARY KEY NOT NULL,
     lcr_id SMALLINT NOT NULL,
@@ -18,7 +17,8 @@ CREATE TABLE lcr_gw (
 
 CREATE INDEX lcr_gw_lcr_id_idx ON lcr_gw (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule_target','1');
+INSERT INTO version (table_name, table_version) values ('lcr_gw','3');
+
 CREATE TABLE lcr_rule_target (
     id INTEGER PRIMARY KEY NOT NULL,
     lcr_id SMALLINT NOT NULL,
@@ -31,7 +31,8 @@ CREATE TABLE lcr_rule_target (
 
 CREATE INDEX lcr_rule_target_lcr_id_idx ON lcr_rule_target (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule_target','1');
+
 CREATE TABLE lcr_rule (
     id INTEGER PRIMARY KEY NOT NULL,
     lcr_id SMALLINT NOT NULL,
@@ -43,3 +44,5 @@ CREATE TABLE lcr_rule (
     CONSTRAINT lcr_rule_lcr_id_prefix_from_uri_idx UNIQUE (lcr_id, prefix, from_uri)
 );
 
+INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+

+ 2 - 1
utils/kamctl/db_sqlite/matrix-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('matrix','1');
 CREATE TABLE matrix (
     first INTEGER NOT NULL,
     second SMALLINT NOT NULL,
@@ -7,3 +6,5 @@ CREATE TABLE matrix (
 
 CREATE INDEX matrix_matrix_idx ON matrix (first, second);
 
+INSERT INTO version (table_name, table_version) values ('matrix','1');
+

+ 4 - 2
utils/kamctl/db_sqlite/mohqueue-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('mohqcalls','1');
 CREATE TABLE mohqcalls (
     id INTEGER PRIMARY KEY NOT NULL,
     mohq_id INTEGER NOT NULL,
@@ -10,7 +9,8 @@ CREATE TABLE mohqcalls (
     CONSTRAINT mohqcalls_mohqcalls_idx UNIQUE (call_id)
 );
 
-INSERT INTO version (table_name, table_version) values ('mohqueues','1');
+INSERT INTO version (table_name, table_version) values ('mohqcalls','1');
+
 CREATE TABLE mohqueues (
     id INTEGER PRIMARY KEY NOT NULL,
     name VARCHAR(25) NOT NULL,
@@ -22,3 +22,5 @@ CREATE TABLE mohqueues (
     CONSTRAINT mohqueues_mohqueue_name_idx UNIQUE (name)
 );
 
+INSERT INTO version (table_name, table_version) values ('mohqueues','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/msilo-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('silo','8');
 CREATE TABLE silo (
     id INTEGER PRIMARY KEY NOT NULL,
     src_addr VARCHAR(128) DEFAULT '' NOT NULL,
@@ -17,3 +16,5 @@ CREATE TABLE silo (
 
 CREATE INDEX silo_account_idx ON silo (username, domain);
 
+INSERT INTO version (table_name, table_version) values ('silo','8');
+

+ 4 - 2
utils/kamctl/db_sqlite/mtree-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('mtree','1');
 CREATE TABLE mtree (
     id INTEGER PRIMARY KEY NOT NULL,
     tprefix VARCHAR(32) DEFAULT '' NOT NULL,
@@ -6,7 +5,8 @@ CREATE TABLE mtree (
     CONSTRAINT mtree_tprefix_idx UNIQUE (tprefix)
 );
 
-INSERT INTO version (table_name, table_version) values ('mtrees','2');
+INSERT INTO version (table_name, table_version) values ('mtree','1');
+
 CREATE TABLE mtrees (
     id INTEGER PRIMARY KEY NOT NULL,
     tname VARCHAR(128) DEFAULT '' NOT NULL,
@@ -15,3 +15,5 @@ CREATE TABLE mtrees (
     CONSTRAINT mtrees_tname_tprefix_tvalue_idx UNIQUE (tname, tprefix, tvalue)
 );
 
+INSERT INTO version (table_name, table_version) values ('mtrees','2');
+

+ 2 - 1
utils/kamctl/db_sqlite/pdt-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('pdt','1');
 CREATE TABLE pdt (
     id INTEGER PRIMARY KEY NOT NULL,
     sdomain VARCHAR(128) NOT NULL,
@@ -7,3 +6,5 @@ CREATE TABLE pdt (
     CONSTRAINT pdt_sdomain_prefix_idx UNIQUE (sdomain, prefix)
 );
 
+INSERT INTO version (table_name, table_version) values ('pdt','1');
+

+ 4 - 2
utils/kamctl/db_sqlite/permissions-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('trusted','6');
 CREATE TABLE trusted (
     id INTEGER PRIMARY KEY NOT NULL,
     src_ip VARCHAR(50) NOT NULL,
@@ -11,7 +10,8 @@ CREATE TABLE trusted (
 
 CREATE INDEX trusted_peer_idx ON trusted (src_ip);
 
-INSERT INTO version (table_name, table_version) values ('address','6');
+INSERT INTO version (table_name, table_version) values ('trusted','6');
+
 CREATE TABLE address (
     id INTEGER PRIMARY KEY NOT NULL,
     grp INTEGER DEFAULT 1 NOT NULL,
@@ -21,3 +21,5 @@ CREATE TABLE address (
     tag VARCHAR(64)
 );
 
+INSERT INTO version (table_name, table_version) values ('address','6');
+

+ 2 - 1
utils/kamctl/db_sqlite/pipelimit-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('pl_pipes','1');
 CREATE TABLE pl_pipes (
     id INTEGER PRIMARY KEY NOT NULL,
     pipeid VARCHAR(64) DEFAULT '' NOT NULL,
@@ -6,3 +5,5 @@ CREATE TABLE pl_pipes (
     plimit INTEGER DEFAULT 0 NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('pl_pipes','1');
+

+ 10 - 5
utils/kamctl/db_sqlite/presence-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('presentity','4');
 CREATE TABLE presentity (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
@@ -16,7 +15,8 @@ CREATE TABLE presentity (
 CREATE INDEX presentity_presentity_expires ON presentity (expires);
 CREATE INDEX presentity_account_idx ON presentity (username, domain, event);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+INSERT INTO version (table_name, table_version) values ('presentity','4');
+
 CREATE TABLE active_watchers (
     id INTEGER PRIMARY KEY NOT NULL,
     presentity_uri VARCHAR(128) NOT NULL,
@@ -51,7 +51,8 @@ CREATE INDEX active_watchers_active_watchers_pres ON active_watchers (presentity
 CREATE INDEX active_watchers_updated_idx ON active_watchers (updated);
 CREATE INDEX active_watchers_updated_winfo_idx ON active_watchers (updated_winfo, presentity_uri);
 
-INSERT INTO version (table_name, table_version) values ('watchers','3');
+INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+
 CREATE TABLE watchers (
     id INTEGER PRIMARY KEY NOT NULL,
     presentity_uri VARCHAR(128) NOT NULL,
@@ -64,7 +65,8 @@ CREATE TABLE watchers (
     CONSTRAINT watchers_watcher_idx UNIQUE (presentity_uri, watcher_username, watcher_domain, event)
 );
 
-INSERT INTO version (table_name, table_version) values ('xcap','4');
+INSERT INTO version (table_name, table_version) values ('watchers','3');
+
 CREATE TABLE xcap (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
@@ -82,7 +84,8 @@ CREATE INDEX xcap_account_doc_type_idx ON xcap (username, domain, doc_type);
 CREATE INDEX xcap_account_doc_type_uri_idx ON xcap (username, domain, doc_type, doc_uri);
 CREATE INDEX xcap_account_doc_uri_idx ON xcap (username, domain, doc_uri);
 
-INSERT INTO version (table_name, table_version) values ('pua','7');
+INSERT INTO version (table_name, table_version) values ('xcap','4');
+
 CREATE TABLE pua (
     id INTEGER PRIMARY KEY NOT NULL,
     pres_uri VARCHAR(128) NOT NULL,
@@ -111,3 +114,5 @@ CREATE INDEX pua_dialog1_idx ON pua (pres_id, pres_uri);
 CREATE INDEX pua_dialog2_idx ON pua (call_id, from_tag);
 CREATE INDEX pua_record_idx ON pua (pres_id);
 
+INSERT INTO version (table_name, table_version) values ('pua','7');
+

+ 2 - 1
utils/kamctl/db_sqlite/purple-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('purplemap','1');
 CREATE TABLE purplemap (
     id INTEGER PRIMARY KEY NOT NULL,
     sip_user VARCHAR(128) NOT NULL,
@@ -7,3 +6,5 @@ CREATE TABLE purplemap (
     ext_pass VARCHAR(64)
 );
 
+INSERT INTO version (table_name, table_version) values ('purplemap','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/registrar-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('aliases','8');
 CREATE TABLE aliases (
     id INTEGER PRIMARY KEY NOT NULL,
     ruid VARCHAR(64) DEFAULT '' NOT NULL,
@@ -29,3 +28,5 @@ CREATE TABLE aliases (
 CREATE INDEX aliases_account_contact_idx ON aliases (username, domain, contact);
 CREATE INDEX aliases_expires_idx ON aliases (expires);
 
+INSERT INTO version (table_name, table_version) values ('aliases','8');
+

+ 4 - 2
utils/kamctl/db_sqlite/rls-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
 CREATE TABLE rls_presentity (
     id INTEGER PRIMARY KEY NOT NULL,
     rlsubs_did VARCHAR(255) NOT NULL,
@@ -16,7 +15,8 @@ CREATE INDEX rls_presentity_rlsubs_idx ON rls_presentity (rlsubs_did);
 CREATE INDEX rls_presentity_updated_idx ON rls_presentity (updated);
 CREATE INDEX rls_presentity_expires_idx ON rls_presentity (expires);
 
-INSERT INTO version (table_name, table_version) values ('rls_watchers','3');
+INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
+
 CREATE TABLE rls_watchers (
     id INTEGER PRIMARY KEY NOT NULL,
     presentity_uri VARCHAR(128) NOT NULL,
@@ -49,3 +49,5 @@ CREATE INDEX rls_watchers_rls_watchers_update ON rls_watchers (watcher_username,
 CREATE INDEX rls_watchers_rls_watchers_expires ON rls_watchers (expires);
 CREATE INDEX rls_watchers_updated_idx ON rls_watchers (updated);
 
+INSERT INTO version (table_name, table_version) values ('rls_watchers','3');
+

+ 2 - 1
utils/kamctl/db_sqlite/rtpproxy-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
 CREATE TABLE rtpproxy (
     id INTEGER PRIMARY KEY NOT NULL,
     setid VARCHAR(32) DEFAULT 00 NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE rtpproxy (
     description VARCHAR(64) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/sca-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
 CREATE TABLE sca_subscriptions (
     id INTEGER PRIMARY KEY NOT NULL,
     subscriber VARCHAR(255) NOT NULL,
@@ -19,3 +18,5 @@ CREATE TABLE sca_subscriptions (
 CREATE INDEX sca_subscriptions_sca_expires_idx ON sca_subscriptions (expires);
 CREATE INDEX sca_subscriptions_sca_subscribers_idx ON sca_subscriptions (subscriber, event);
 
+INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/siptrace-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('sip_trace','4');
 CREATE TABLE sip_trace (
     id INTEGER PRIMARY KEY NOT NULL,
     time_stamp TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL,
@@ -20,3 +19,5 @@ CREATE INDEX sip_trace_date_idx ON sip_trace (time_stamp);
 CREATE INDEX sip_trace_fromip_idx ON sip_trace (fromip);
 CREATE INDEX sip_trace_callid_idx ON sip_trace (callid);
 
+INSERT INTO version (table_name, table_version) values ('sip_trace','4');
+

+ 2 - 1
utils/kamctl/db_sqlite/speeddial-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('speed_dial','2');
 CREATE TABLE speed_dial (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) DEFAULT '' NOT NULL,
@@ -12,3 +11,5 @@ CREATE TABLE speed_dial (
     CONSTRAINT speed_dial_speed_dial_idx UNIQUE (username, domain, sd_domain, sd_username)
 );
 
+INSERT INTO version (table_name, table_version) values ('speed_dial','2');
+

+ 2 - 1
utils/kamctl/db_sqlite/standard-create.sql

@@ -1,7 +1,8 @@
-INSERT INTO version (table_name, table_version) values ('version','1');
 CREATE TABLE version (
     table_name VARCHAR(32) NOT NULL,
     table_version INTEGER DEFAULT 0 NOT NULL,
     CONSTRAINT version_table_name_idx UNIQUE (table_name)
 );
 
+INSERT INTO version (table_name, table_version) values ('version','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/uac-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uacreg','1');
 CREATE TABLE uacreg (
     id INTEGER PRIMARY KEY NOT NULL,
     l_uuid VARCHAR(64) DEFAULT '' NOT NULL,
@@ -14,3 +13,5 @@ CREATE TABLE uacreg (
     CONSTRAINT uacreg_l_uuid_idx UNIQUE (l_uuid)
 );
 
+INSERT INTO version (table_name, table_version) values ('uacreg','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/uid_auth_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
 CREATE TABLE uid_credentials (
     id INTEGER PRIMARY KEY NOT NULL,
     auth_username VARCHAR(64) NOT NULL,
@@ -16,3 +15,5 @@ CREATE INDEX uid_credentials_uid ON uid_credentials (uid);
 CREATE INDEX uid_credentials_did_idx ON uid_credentials (did);
 CREATE INDEX uid_credentials_realm_idx ON uid_credentials (realm);
 
+INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
+

+ 2 - 1
utils/kamctl/db_sqlite/uid_avp_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
 CREATE TABLE uid_user_attrs (
     id INTEGER PRIMARY KEY NOT NULL,
     uid VARCHAR(64) NOT NULL,
@@ -9,3 +8,5 @@ CREATE TABLE uid_user_attrs (
     CONSTRAINT uid_user_attrs_userattrs_idx UNIQUE (uid, name, value)
 );
 
+INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
+

+ 4 - 2
utils/kamctl/db_sqlite/uid_domain-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_domain','2');
 CREATE TABLE uid_domain (
     id INTEGER PRIMARY KEY NOT NULL,
     did VARCHAR(64) NOT NULL,
@@ -9,7 +8,8 @@ CREATE TABLE uid_domain (
 
 CREATE INDEX uid_domain_did_idx ON uid_domain (did);
 
-INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+INSERT INTO version (table_name, table_version) values ('uid_domain','2');
+
 CREATE TABLE uid_domain_attrs (
     id INTEGER PRIMARY KEY NOT NULL,
     did VARCHAR(64),
@@ -22,3 +22,5 @@ CREATE TABLE uid_domain_attrs (
 
 CREATE INDEX uid_domain_attrs_domain_did ON uid_domain_attrs (did, flags);
 
+INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+

+ 2 - 1
utils/kamctl/db_sqlite/uid_gflags-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
 CREATE TABLE uid_global_attrs (
     id INTEGER PRIMARY KEY NOT NULL,
     name VARCHAR(32) NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE uid_global_attrs (
     CONSTRAINT uid_global_attrs_global_attrs_idx UNIQUE (name, value)
 );
 
+INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
+

+ 4 - 2
utils/kamctl/db_sqlite/uid_uri_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_uri','3');
 CREATE TABLE uid_uri (
     id INTEGER PRIMARY KEY NOT NULL,
     uid VARCHAR(64) NOT NULL,
@@ -11,7 +10,8 @@ CREATE TABLE uid_uri (
 CREATE INDEX uid_uri_uri_idx1 ON uid_uri (username, did, scheme);
 CREATE INDEX uid_uri_uri_uid ON uid_uri (uid);
 
-INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+INSERT INTO version (table_name, table_version) values ('uid_uri','3');
+
 CREATE TABLE uid_uri_attrs (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) NOT NULL,
@@ -24,3 +24,5 @@ CREATE TABLE uid_uri_attrs (
     CONSTRAINT uid_uri_attrs_uriattrs_idx UNIQUE (username, did, name, value, scheme)
 );
 
+INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+

+ 2 - 1
utils/kamctl/db_sqlite/uri_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uri','1');
 CREATE TABLE uri (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) DEFAULT '' NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE uri (
     CONSTRAINT uri_account_idx UNIQUE (username, domain, uri_user)
 );
 
+INSERT INTO version (table_name, table_version) values ('uri','1');
+

+ 4 - 2
utils/kamctl/db_sqlite/userblacklist-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('userblacklist','1');
 CREATE TABLE userblacklist (
     id INTEGER PRIMARY KEY NOT NULL,
     username VARCHAR(64) DEFAULT '' NOT NULL,
@@ -9,7 +8,8 @@ CREATE TABLE userblacklist (
 
 CREATE INDEX userblacklist_userblacklist_idx ON userblacklist (username, domain, prefix);
 
-INSERT INTO version (table_name, table_version) values ('globalblacklist','1');
+INSERT INTO version (table_name, table_version) values ('userblacklist','1');
+
 CREATE TABLE globalblacklist (
     id INTEGER PRIMARY KEY NOT NULL,
     prefix VARCHAR(64) DEFAULT '' NOT NULL,
@@ -19,3 +19,5 @@ CREATE TABLE globalblacklist (
 
 CREATE INDEX globalblacklist_globalblacklist_idx ON globalblacklist (prefix);
 
+INSERT INTO version (table_name, table_version) values ('globalblacklist','1');
+

+ 4 - 2
utils/kamctl/db_sqlite/usrloc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('location','8');
 CREATE TABLE location (
     id INTEGER PRIMARY KEY NOT NULL,
     ruid VARCHAR(64) DEFAULT '' NOT NULL,
@@ -29,7 +28,8 @@ CREATE TABLE location (
 CREATE INDEX location_account_contact_idx ON location (username, domain, contact);
 CREATE INDEX location_expires_idx ON location (expires);
 
-INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+INSERT INTO version (table_name, table_version) values ('location','8');
+
 CREATE TABLE location_attrs (
     id INTEGER PRIMARY KEY NOT NULL,
     ruid VARCHAR(64) DEFAULT '' NOT NULL,
@@ -44,3 +44,5 @@ CREATE TABLE location_attrs (
 CREATE INDEX location_attrs_account_record_idx ON location_attrs (username, domain, ruid);
 CREATE INDEX location_attrs_last_modified_idx ON location_attrs (last_modified);
 
+INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+

+ 6 - 3
utils/kamctl/mysql/acc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('acc','5');
 CREATE TABLE `acc` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `method` VARCHAR(16) DEFAULT '' NOT NULL,
@@ -12,7 +11,8 @@ CREATE TABLE `acc` (
 
 CREATE INDEX callid_idx ON acc (`callid`);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
+INSERT INTO version (table_name, table_version) values ('acc','5');
+
 CREATE TABLE `acc_cdrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `start_time` DATETIME DEFAULT '2000-01-01 00:00:00' NOT NULL,
@@ -22,7 +22,8 @@ CREATE TABLE `acc_cdrs` (
 
 CREATE INDEX start_time_idx ON acc_cdrs (`start_time`);
 
-INSERT INTO version (table_name, table_version) values ('missed_calls','4');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
+
 CREATE TABLE `missed_calls` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `method` VARCHAR(16) DEFAULT '' NOT NULL,
@@ -36,3 +37,5 @@ CREATE TABLE `missed_calls` (
 
 CREATE INDEX callid_idx ON missed_calls (`callid`);
 
+INSERT INTO version (table_name, table_version) values ('missed_calls','4');
+

+ 2 - 1
utils/kamctl/mysql/alias_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dbaliases','1');
 CREATE TABLE `dbaliases` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `alias_username` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -11,3 +10,5 @@ CREATE INDEX alias_user_idx ON dbaliases (`alias_username`);
 CREATE INDEX alias_idx ON dbaliases (`alias_username`, `alias_domain`);
 CREATE INDEX target_idx ON dbaliases (`username`, `domain`);
 
+INSERT INTO version (table_name, table_version) values ('dbaliases','1');
+

+ 2 - 1
utils/kamctl/mysql/auth_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('subscriber','6');
 CREATE TABLE `subscriber` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -13,3 +12,5 @@ CREATE TABLE `subscriber` (
 
 CREATE INDEX username_idx ON subscriber (`username`);
 
+INSERT INTO version (table_name, table_version) values ('subscriber','6');
+

+ 2 - 1
utils/kamctl/mysql/avpops-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('usr_preferences','2');
 CREATE TABLE `usr_preferences` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `uuid` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -13,3 +12,5 @@ CREATE TABLE `usr_preferences` (
 CREATE INDEX ua_idx ON usr_preferences (`uuid`, `attribute`);
 CREATE INDEX uda_idx ON usr_preferences (`username`, `domain`, `attribute`);
 
+INSERT INTO version (table_name, table_version) values ('usr_preferences','2');
+

+ 8 - 4
utils/kamctl/mysql/carrierroute-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('carrierroute','3');
 CREATE TABLE `carrierroute` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `carrier` INT(10) UNSIGNED DEFAULT 0 NOT NULL,
@@ -14,7 +13,8 @@ CREATE TABLE `carrierroute` (
     `description` VARCHAR(255) DEFAULT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('carrierfailureroute','2');
+INSERT INTO version (table_name, table_version) values ('carrierroute','3');
+
 CREATE TABLE `carrierfailureroute` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `carrier` INT(10) UNSIGNED DEFAULT 0 NOT NULL,
@@ -28,15 +28,19 @@ CREATE TABLE `carrierfailureroute` (
     `description` VARCHAR(255) DEFAULT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('carrier_name','1');
+INSERT INTO version (table_name, table_version) values ('carrierfailureroute','2');
+
 CREATE TABLE `carrier_name` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `carrier` VARCHAR(64) DEFAULT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('domain_name','1');
+INSERT INTO version (table_name, table_version) values ('carrier_name','1');
+
 CREATE TABLE `domain_name` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `domain` VARCHAR(64) DEFAULT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('domain_name','1');
+

+ 2 - 1
utils/kamctl/mysql/cpl-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('cpl','1');
 CREATE TABLE `cpl` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE `cpl` (
     CONSTRAINT account_idx UNIQUE (`username`, `domain`)
 );
 
+INSERT INTO version (table_name, table_version) values ('cpl','1');
+

+ 4 - 2
utils/kamctl/mysql/dialog-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dialog','7');
 CREATE TABLE `dialog` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `hash_entry` INT(10) UNSIGNED NOT NULL,
@@ -28,7 +27,8 @@ CREATE TABLE `dialog` (
 
 CREATE INDEX hash_idx ON dialog (`hash_entry`, `hash_id`);
 
-INSERT INTO version (table_name, table_version) values ('dialog_vars','1');
+INSERT INTO version (table_name, table_version) values ('dialog','7');
+
 CREATE TABLE `dialog_vars` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `hash_entry` INT(10) UNSIGNED NOT NULL,
@@ -39,3 +39,5 @@ CREATE TABLE `dialog_vars` (
 
 CREATE INDEX hash_idx ON dialog_vars (`hash_entry`, `hash_id`);
 
+INSERT INTO version (table_name, table_version) values ('dialog_vars','1');
+

+ 2 - 1
utils/kamctl/mysql/dialplan-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dialplan','2');
 CREATE TABLE `dialplan` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `dpid` INT(11) NOT NULL,
@@ -11,3 +10,5 @@ CREATE TABLE `dialplan` (
     `attrs` VARCHAR(64) NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dialplan','2');
+

+ 2 - 1
utils/kamctl/mysql/dispatcher-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dispatcher','4');
 CREATE TABLE `dispatcher` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `setid` INT DEFAULT 0 NOT NULL,
@@ -9,3 +8,5 @@ CREATE TABLE `dispatcher` (
     `description` VARCHAR(64) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dispatcher','4');
+

+ 4 - 2
utils/kamctl/mysql/domain-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('domain','2');
 CREATE TABLE `domain` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `domain` VARCHAR(64) NOT NULL,
@@ -7,7 +6,8 @@ CREATE TABLE `domain` (
     CONSTRAINT domain_idx UNIQUE (`domain`)
 );
 
-INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
+INSERT INTO version (table_name, table_version) values ('domain','2');
+
 CREATE TABLE `domain_attrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `did` VARCHAR(64) NOT NULL,
@@ -18,3 +18,5 @@ CREATE TABLE `domain_attrs` (
     CONSTRAINT domain_attrs_idx UNIQUE (`did`, `name`, `value`)
 );
 
+INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
+

+ 2 - 1
utils/kamctl/mysql/domainpolicy-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('domainpolicy','2');
 CREATE TABLE `domainpolicy` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `rule` VARCHAR(255) NOT NULL,
@@ -11,3 +10,5 @@ CREATE TABLE `domainpolicy` (
 
 CREATE INDEX rule_idx ON domainpolicy (`rule`);
 
+INSERT INTO version (table_name, table_version) values ('domainpolicy','2');
+

+ 8 - 4
utils/kamctl/mysql/drouting-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
 CREATE TABLE `dr_gateways` (
     `gwid` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `type` INT(11) UNSIGNED DEFAULT 0 NOT NULL,
@@ -9,7 +8,8 @@ CREATE TABLE `dr_gateways` (
     `description` VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_rules','3');
+INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
+
 CREATE TABLE `dr_rules` (
     `ruleid` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `groupid` VARCHAR(255) NOT NULL,
@@ -21,14 +21,16 @@ CREATE TABLE `dr_rules` (
     `description` VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+INSERT INTO version (table_name, table_version) values ('dr_rules','3');
+
 CREATE TABLE `dr_gw_lists` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `gwlist` VARCHAR(255) NOT NULL,
     `description` VARCHAR(128) DEFAULT '' NOT NULL
 );
 
-INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+
 CREATE TABLE `dr_groups` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) NOT NULL,
@@ -37,3 +39,5 @@ CREATE TABLE `dr_groups` (
     `description` VARCHAR(128) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+

+ 4 - 2
utils/kamctl/mysql/group-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('grp','2');
 CREATE TABLE `grp` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -8,7 +7,8 @@ CREATE TABLE `grp` (
     CONSTRAINT account_group_idx UNIQUE (`username`, `domain`, `grp`)
 );
 
-INSERT INTO version (table_name, table_version) values ('re_grp','1');
+INSERT INTO version (table_name, table_version) values ('grp','2');
+
 CREATE TABLE `re_grp` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `reg_exp` VARCHAR(128) DEFAULT '' NOT NULL,
@@ -17,3 +17,5 @@ CREATE TABLE `re_grp` (
 
 CREATE INDEX group_idx ON re_grp (`group_id`);
 
+INSERT INTO version (table_name, table_version) values ('re_grp','1');
+

+ 2 - 1
utils/kamctl/mysql/htable-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE `htable` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `key_name` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE `htable` (
     `expires` INT DEFAULT 0 NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('htable','2');
+

+ 4 - 2
utils/kamctl/mysql/imc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('imc_rooms','1');
 CREATE TABLE `imc_rooms` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `name` VARCHAR(64) NOT NULL,
@@ -7,7 +6,8 @@ CREATE TABLE `imc_rooms` (
     CONSTRAINT name_domain_idx UNIQUE (`name`, `domain`)
 );
 
-INSERT INTO version (table_name, table_version) values ('imc_members','1');
+INSERT INTO version (table_name, table_version) values ('imc_rooms','1');
+
 CREATE TABLE `imc_members` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) NOT NULL,
@@ -17,3 +17,5 @@ CREATE TABLE `imc_members` (
     CONSTRAINT account_room_idx UNIQUE (`username`, `domain`, `room`)
 );
 
+INSERT INTO version (table_name, table_version) values ('imc_members','1');
+

+ 6 - 3
utils/kamctl/mysql/lcr-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('lcr_gw','3');
 CREATE TABLE `lcr_gw` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `lcr_id` SMALLINT UNSIGNED NOT NULL,
@@ -18,7 +17,8 @@ CREATE TABLE `lcr_gw` (
 
 CREATE INDEX lcr_id_idx ON lcr_gw (`lcr_id`);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule_target','1');
+INSERT INTO version (table_name, table_version) values ('lcr_gw','3');
+
 CREATE TABLE `lcr_rule_target` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `lcr_id` SMALLINT UNSIGNED NOT NULL,
@@ -31,7 +31,8 @@ CREATE TABLE `lcr_rule_target` (
 
 CREATE INDEX lcr_id_idx ON lcr_rule_target (`lcr_id`);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule_target','1');
+
 CREATE TABLE `lcr_rule` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `lcr_id` SMALLINT UNSIGNED NOT NULL,
@@ -43,3 +44,5 @@ CREATE TABLE `lcr_rule` (
     CONSTRAINT lcr_id_prefix_from_uri_idx UNIQUE (`lcr_id`, `prefix`, `from_uri`)
 );
 
+INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+

+ 2 - 1
utils/kamctl/mysql/matrix-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('matrix','1');
 CREATE TABLE `matrix` (
     `first` INT(10) NOT NULL,
     `second` SMALLINT(10) NOT NULL,
@@ -7,3 +6,5 @@ CREATE TABLE `matrix` (
 
 CREATE INDEX matrix_idx ON matrix (`first`, `second`);
 
+INSERT INTO version (table_name, table_version) values ('matrix','1');
+

+ 4 - 2
utils/kamctl/mysql/mohqueue-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('mohqcalls','1');
 CREATE TABLE `mohqcalls` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `mohq_id` INT(10) UNSIGNED NOT NULL,
@@ -10,7 +9,8 @@ CREATE TABLE `mohqcalls` (
     CONSTRAINT mohqcalls_idx UNIQUE (`call_id`)
 );
 
-INSERT INTO version (table_name, table_version) values ('mohqueues','1');
+INSERT INTO version (table_name, table_version) values ('mohqcalls','1');
+
 CREATE TABLE `mohqueues` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `name` VARCHAR(25) NOT NULL,
@@ -22,3 +22,5 @@ CREATE TABLE `mohqueues` (
     CONSTRAINT mohqueue_name_idx UNIQUE (`name`)
 );
 
+INSERT INTO version (table_name, table_version) values ('mohqueues','1');
+

+ 2 - 1
utils/kamctl/mysql/msilo-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('silo','8');
 CREATE TABLE `silo` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `src_addr` VARCHAR(128) DEFAULT '' NOT NULL,
@@ -17,3 +16,5 @@ CREATE TABLE `silo` (
 
 CREATE INDEX account_idx ON silo (`username`, `domain`);
 
+INSERT INTO version (table_name, table_version) values ('silo','8');
+

+ 4 - 2
utils/kamctl/mysql/mtree-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('mtree','1');
 CREATE TABLE `mtree` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `tprefix` VARCHAR(32) DEFAULT '' NOT NULL,
@@ -6,7 +5,8 @@ CREATE TABLE `mtree` (
     CONSTRAINT tprefix_idx UNIQUE (`tprefix`)
 );
 
-INSERT INTO version (table_name, table_version) values ('mtrees','2');
+INSERT INTO version (table_name, table_version) values ('mtree','1');
+
 CREATE TABLE `mtrees` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `tname` VARCHAR(128) DEFAULT '' NOT NULL,
@@ -15,3 +15,5 @@ CREATE TABLE `mtrees` (
     CONSTRAINT tname_tprefix_tvalue_idx UNIQUE (`tname`, `tprefix`, `tvalue`)
 );
 
+INSERT INTO version (table_name, table_version) values ('mtrees','2');
+

+ 2 - 1
utils/kamctl/mysql/pdt-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('pdt','1');
 CREATE TABLE `pdt` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `sdomain` VARCHAR(128) NOT NULL,
@@ -7,3 +6,5 @@ CREATE TABLE `pdt` (
     CONSTRAINT sdomain_prefix_idx UNIQUE (`sdomain`, `prefix`)
 );
 
+INSERT INTO version (table_name, table_version) values ('pdt','1');
+

+ 4 - 2
utils/kamctl/mysql/permissions-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('trusted','6');
 CREATE TABLE `trusted` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `src_ip` VARCHAR(50) NOT NULL,
@@ -11,7 +10,8 @@ CREATE TABLE `trusted` (
 
 CREATE INDEX peer_idx ON trusted (`src_ip`);
 
-INSERT INTO version (table_name, table_version) values ('address','6');
+INSERT INTO version (table_name, table_version) values ('trusted','6');
+
 CREATE TABLE `address` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `grp` INT(11) UNSIGNED DEFAULT 1 NOT NULL,
@@ -21,3 +21,5 @@ CREATE TABLE `address` (
     `tag` VARCHAR(64)
 );
 
+INSERT INTO version (table_name, table_version) values ('address','6');
+

+ 2 - 1
utils/kamctl/mysql/pipelimit-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('pl_pipes','1');
 CREATE TABLE `pl_pipes` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `pipeid` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -6,3 +5,5 @@ CREATE TABLE `pl_pipes` (
     `plimit` INT DEFAULT 0 NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('pl_pipes','1');
+

+ 10 - 5
utils/kamctl/mysql/presence-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('presentity','4');
 CREATE TABLE `presentity` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) NOT NULL,
@@ -16,7 +15,8 @@ CREATE TABLE `presentity` (
 CREATE INDEX presentity_expires ON presentity (`expires`);
 CREATE INDEX account_idx ON presentity (`username`, `domain`, `event`);
 
-INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+INSERT INTO version (table_name, table_version) values ('presentity','4');
+
 CREATE TABLE `active_watchers` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `presentity_uri` VARCHAR(128) NOT NULL,
@@ -51,7 +51,8 @@ CREATE INDEX active_watchers_pres ON active_watchers (`presentity_uri`, `event`)
 CREATE INDEX updated_idx ON active_watchers (`updated`);
 CREATE INDEX updated_winfo_idx ON active_watchers (`updated_winfo`, `presentity_uri`);
 
-INSERT INTO version (table_name, table_version) values ('watchers','3');
+INSERT INTO version (table_name, table_version) values ('active_watchers','11');
+
 CREATE TABLE `watchers` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `presentity_uri` VARCHAR(128) NOT NULL,
@@ -64,7 +65,8 @@ CREATE TABLE `watchers` (
     CONSTRAINT watcher_idx UNIQUE (`presentity_uri`, `watcher_username`, `watcher_domain`, `event`)
 );
 
-INSERT INTO version (table_name, table_version) values ('xcap','4');
+INSERT INTO version (table_name, table_version) values ('watchers','3');
+
 CREATE TABLE `xcap` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) NOT NULL,
@@ -82,7 +84,8 @@ CREATE INDEX account_doc_type_idx ON xcap (`username`, `domain`, `doc_type`);
 CREATE INDEX account_doc_type_uri_idx ON xcap (`username`, `domain`, `doc_type`, `doc_uri`);
 CREATE INDEX account_doc_uri_idx ON xcap (`username`, `domain`, `doc_uri`);
 
-INSERT INTO version (table_name, table_version) values ('pua','7');
+INSERT INTO version (table_name, table_version) values ('xcap','4');
+
 CREATE TABLE `pua` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `pres_uri` VARCHAR(128) NOT NULL,
@@ -111,3 +114,5 @@ CREATE INDEX dialog1_idx ON pua (`pres_id`, `pres_uri`);
 CREATE INDEX dialog2_idx ON pua (`call_id`, `from_tag`);
 CREATE INDEX record_idx ON pua (`pres_id`);
 
+INSERT INTO version (table_name, table_version) values ('pua','7');
+

+ 2 - 1
utils/kamctl/mysql/purple-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('purplemap','1');
 CREATE TABLE `purplemap` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `sip_user` VARCHAR(128) NOT NULL,
@@ -7,3 +6,5 @@ CREATE TABLE `purplemap` (
     `ext_pass` VARCHAR(64)
 );
 
+INSERT INTO version (table_name, table_version) values ('purplemap','1');
+

+ 2 - 1
utils/kamctl/mysql/registrar-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('aliases','8');
 CREATE TABLE `aliases` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `ruid` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -29,3 +28,5 @@ CREATE TABLE `aliases` (
 CREATE INDEX account_contact_idx ON aliases (`username`, `domain`, `contact`);
 CREATE INDEX expires_idx ON aliases (`expires`);
 
+INSERT INTO version (table_name, table_version) values ('aliases','8');
+

+ 4 - 2
utils/kamctl/mysql/rls-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
 CREATE TABLE `rls_presentity` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `rlsubs_did` VARCHAR(255) NOT NULL,
@@ -16,7 +15,8 @@ CREATE INDEX rlsubs_idx ON rls_presentity (`rlsubs_did`);
 CREATE INDEX updated_idx ON rls_presentity (`updated`);
 CREATE INDEX expires_idx ON rls_presentity (`expires`);
 
-INSERT INTO version (table_name, table_version) values ('rls_watchers','3');
+INSERT INTO version (table_name, table_version) values ('rls_presentity','1');
+
 CREATE TABLE `rls_watchers` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `presentity_uri` VARCHAR(128) NOT NULL,
@@ -49,3 +49,5 @@ CREATE INDEX rls_watchers_update ON rls_watchers (`watcher_username`, `watcher_d
 CREATE INDEX rls_watchers_expires ON rls_watchers (`expires`);
 CREATE INDEX updated_idx ON rls_watchers (`updated`);
 
+INSERT INTO version (table_name, table_version) values ('rls_watchers','3');
+

+ 2 - 1
utils/kamctl/mysql/rtpproxy-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
 CREATE TABLE `rtpproxy` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `setid` VARCHAR(32) DEFAULT 00 NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE `rtpproxy` (
     `description` VARCHAR(64) DEFAULT '' NOT NULL
 );
 
+INSERT INTO version (table_name, table_version) values ('rtpproxy','1');
+

+ 2 - 1
utils/kamctl/mysql/sca-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
 CREATE TABLE `sca_subscriptions` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `subscriber` VARCHAR(255) NOT NULL,
@@ -19,3 +18,5 @@ CREATE TABLE `sca_subscriptions` (
 CREATE INDEX sca_expires_idx ON sca_subscriptions (`expires`);
 CREATE INDEX sca_subscribers_idx ON sca_subscriptions (`subscriber`, `event`);
 
+INSERT INTO version (table_name, table_version) values ('sca_subscriptions','1');
+

+ 2 - 1
utils/kamctl/mysql/siptrace-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('sip_trace','4');
 CREATE TABLE `sip_trace` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `time_stamp` DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
@@ -20,3 +19,5 @@ CREATE INDEX date_idx ON sip_trace (`time_stamp`);
 CREATE INDEX fromip_idx ON sip_trace (`fromip`);
 CREATE INDEX callid_idx ON sip_trace (`callid`);
 
+INSERT INTO version (table_name, table_version) values ('sip_trace','4');
+

+ 2 - 1
utils/kamctl/mysql/speeddial-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('speed_dial','2');
 CREATE TABLE `speed_dial` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -12,3 +11,5 @@ CREATE TABLE `speed_dial` (
     CONSTRAINT speed_dial_idx UNIQUE (`username`, `domain`, `sd_domain`, `sd_username`)
 );
 
+INSERT INTO version (table_name, table_version) values ('speed_dial','2');
+

+ 2 - 1
utils/kamctl/mysql/standard-create.sql

@@ -1,7 +1,8 @@
-INSERT INTO version (table_name, table_version) values ('version','1');
 CREATE TABLE `version` (
     `table_name` VARCHAR(32) NOT NULL,
     `table_version` INT UNSIGNED DEFAULT 0 NOT NULL,
     CONSTRAINT table_name_idx UNIQUE (`table_name`)
 );
 
+INSERT INTO version (table_name, table_version) values ('version','1');
+

+ 2 - 1
utils/kamctl/mysql/uac-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uacreg','1');
 CREATE TABLE `uacreg` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `l_uuid` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -14,3 +13,5 @@ CREATE TABLE `uacreg` (
     CONSTRAINT l_uuid_idx UNIQUE (`l_uuid`)
 );
 
+INSERT INTO version (table_name, table_version) values ('uacreg','1');
+

+ 2 - 1
utils/kamctl/mysql/uid_auth_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
 CREATE TABLE `uid_credentials` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `auth_username` VARCHAR(64) NOT NULL,
@@ -16,3 +15,5 @@ CREATE INDEX uid ON uid_credentials (`uid`);
 CREATE INDEX did_idx ON uid_credentials (`did`);
 CREATE INDEX realm_idx ON uid_credentials (`realm`);
 
+INSERT INTO version (table_name, table_version) values ('uid_credentials','7');
+

+ 2 - 1
utils/kamctl/mysql/uid_avp_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
 CREATE TABLE `uid_user_attrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `uid` VARCHAR(64) NOT NULL,
@@ -9,3 +8,5 @@ CREATE TABLE `uid_user_attrs` (
     CONSTRAINT userattrs_idx UNIQUE (`uid`, `name`, `value`)
 );
 
+INSERT INTO version (table_name, table_version) values ('uid_user_attrs','3');
+

+ 4 - 2
utils/kamctl/mysql/uid_domain-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_domain','2');
 CREATE TABLE `uid_domain` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `did` VARCHAR(64) NOT NULL,
@@ -9,7 +8,8 @@ CREATE TABLE `uid_domain` (
 
 CREATE INDEX did_idx ON uid_domain (`did`);
 
-INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+INSERT INTO version (table_name, table_version) values ('uid_domain','2');
+
 CREATE TABLE `uid_domain_attrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `did` VARCHAR(64),
@@ -22,3 +22,5 @@ CREATE TABLE `uid_domain_attrs` (
 
 CREATE INDEX domain_did ON uid_domain_attrs (`did`, `flags`);
 
+INSERT INTO version (table_name, table_version) values ('uid_domain_attrs','1');
+

+ 2 - 1
utils/kamctl/mysql/uid_gflags-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
 CREATE TABLE `uid_global_attrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `name` VARCHAR(32) NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE `uid_global_attrs` (
     CONSTRAINT global_attrs_idx UNIQUE (`name`, `value`)
 );
 
+INSERT INTO version (table_name, table_version) values ('uid_global_attrs','1');
+

+ 4 - 2
utils/kamctl/mysql/uid_uri_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uid_uri','3');
 CREATE TABLE `uid_uri` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `uid` VARCHAR(64) NOT NULL,
@@ -11,7 +10,8 @@ CREATE TABLE `uid_uri` (
 CREATE INDEX uri_idx1 ON uid_uri (`username`, `did`, `scheme`);
 CREATE INDEX uri_uid ON uid_uri (`uid`);
 
-INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+INSERT INTO version (table_name, table_version) values ('uid_uri','3');
+
 CREATE TABLE `uid_uri_attrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) NOT NULL,
@@ -24,3 +24,5 @@ CREATE TABLE `uid_uri_attrs` (
     CONSTRAINT uriattrs_idx UNIQUE (`username`, `did`, `name`, `value`, `scheme`)
 );
 
+INSERT INTO version (table_name, table_version) values ('uid_uri_attrs','2');
+

+ 2 - 1
utils/kamctl/mysql/uri_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('uri','1');
 CREATE TABLE `uri` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -8,3 +7,5 @@ CREATE TABLE `uri` (
     CONSTRAINT account_idx UNIQUE (`username`, `domain`, `uri_user`)
 );
 
+INSERT INTO version (table_name, table_version) values ('uri','1');
+

+ 4 - 2
utils/kamctl/mysql/userblacklist-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('userblacklist','1');
 CREATE TABLE `userblacklist` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `username` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -9,7 +8,8 @@ CREATE TABLE `userblacklist` (
 
 CREATE INDEX userblacklist_idx ON userblacklist (`username`, `domain`, `prefix`);
 
-INSERT INTO version (table_name, table_version) values ('globalblacklist','1');
+INSERT INTO version (table_name, table_version) values ('userblacklist','1');
+
 CREATE TABLE `globalblacklist` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `prefix` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -19,3 +19,5 @@ CREATE TABLE `globalblacklist` (
 
 CREATE INDEX globalblacklist_idx ON globalblacklist (`prefix`);
 
+INSERT INTO version (table_name, table_version) values ('globalblacklist','1');
+

+ 4 - 2
utils/kamctl/mysql/usrloc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('location','8');
 CREATE TABLE `location` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `ruid` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -29,7 +28,8 @@ CREATE TABLE `location` (
 CREATE INDEX account_contact_idx ON location (`username`, `domain`, `contact`);
 CREATE INDEX expires_idx ON location (`expires`);
 
-INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+INSERT INTO version (table_name, table_version) values ('location','8');
+
 CREATE TABLE `location_attrs` (
     `id` INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
     `ruid` VARCHAR(64) DEFAULT '' NOT NULL,
@@ -44,3 +44,5 @@ CREATE TABLE `location_attrs` (
 CREATE INDEX account_record_idx ON location_attrs (`username`, `domain`, `ruid`);
 CREATE INDEX last_modified_idx ON location_attrs (`last_modified`);
 
+INSERT INTO version (table_name, table_version) values ('location_attrs','1');
+

+ 6 - 3
utils/kamctl/oracle/acc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('acc','5');
 CREATE TABLE acc (
     id NUMBER(10) PRIMARY KEY,
     method VARCHAR2(16) DEFAULT '',
@@ -20,7 +19,8 @@ BEGIN map2users('acc'); END;
 /
 CREATE INDEX acc_callid_idx  ON acc (callid);
 
-INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
+INSERT INTO version (table_name, table_version) values ('acc','5');
+
 CREATE TABLE acc_cdrs (
     id NUMBER(10) PRIMARY KEY,
     start_time DATE DEFAULT '2000-01-01 00:00:00',
@@ -38,7 +38,8 @@ BEGIN map2users('acc_cdrs'); END;
 /
 CREATE INDEX acc_cdrs_start_time_idx  ON acc_cdrs (start_time);
 
-INSERT INTO version (table_name, table_version) values ('missed_calls','4');
+INSERT INTO version (table_name, table_version) values ('acc_cdrs','2');
+
 CREATE TABLE missed_calls (
     id NUMBER(10) PRIMARY KEY,
     method VARCHAR2(16) DEFAULT '',
@@ -60,3 +61,5 @@ BEGIN map2users('missed_calls'); END;
 /
 CREATE INDEX missed_calls_callid_idx  ON missed_calls (callid);
 
+INSERT INTO version (table_name, table_version) values ('missed_calls','4');
+

+ 2 - 1
utils/kamctl/oracle/alias_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dbaliases','1');
 CREATE TABLE dbaliases (
     id NUMBER(10) PRIMARY KEY,
     alias_username VARCHAR2(64) DEFAULT '',
@@ -19,3 +18,5 @@ CREATE INDEX dbaliases_alias_user_idx  ON dbaliases (alias_username);
 CREATE INDEX dbaliases_alias_idx  ON dbaliases (alias_username, alias_domain);
 CREATE INDEX dbaliases_target_idx  ON dbaliases (username, domain);
 
+INSERT INTO version (table_name, table_version) values ('dbaliases','1');
+

+ 2 - 1
utils/kamctl/oracle/auth_db-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('subscriber','6');
 CREATE TABLE subscriber (
     id NUMBER(10) PRIMARY KEY,
     username VARCHAR2(64) DEFAULT '',
@@ -21,3 +20,5 @@ BEGIN map2users('subscriber'); END;
 /
 CREATE INDEX subscriber_username_idx  ON subscriber (username);
 
+INSERT INTO version (table_name, table_version) values ('subscriber','6');
+

+ 2 - 1
utils/kamctl/oracle/avpops-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('usr_preferences','2');
 CREATE TABLE usr_preferences (
     id NUMBER(10) PRIMARY KEY,
     uuid VARCHAR2(64) DEFAULT '',
@@ -21,3 +20,5 @@ BEGIN map2users('usr_preferences'); END;
 CREATE INDEX usr_preferences_ua_idx  ON usr_preferences (uuid, attribute);
 CREATE INDEX usr_preferences_uda_idx  ON usr_preferences (username, domain, attribute);
 
+INSERT INTO version (table_name, table_version) values ('usr_preferences','2');
+

+ 8 - 4
utils/kamctl/oracle/carrierroute-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('carrierroute','3');
 CREATE TABLE carrierroute (
     id NUMBER(10) PRIMARY KEY,
     carrier NUMBER(10) DEFAULT 0 NOT NULL,
@@ -22,7 +21,8 @@ END carrierroute_tr;
 /
 BEGIN map2users('carrierroute'); END;
 /
-INSERT INTO version (table_name, table_version) values ('carrierfailureroute','2');
+INSERT INTO version (table_name, table_version) values ('carrierroute','3');
+
 CREATE TABLE carrierfailureroute (
     id NUMBER(10) PRIMARY KEY,
     carrier NUMBER(10) DEFAULT 0 NOT NULL,
@@ -44,7 +44,8 @@ END carrierfailureroute_tr;
 /
 BEGIN map2users('carrierfailureroute'); END;
 /
-INSERT INTO version (table_name, table_version) values ('carrier_name','1');
+INSERT INTO version (table_name, table_version) values ('carrierfailureroute','2');
+
 CREATE TABLE carrier_name (
     id NUMBER(10) PRIMARY KEY,
     carrier VARCHAR2(64) DEFAULT NULL
@@ -58,7 +59,8 @@ END carrier_name_tr;
 /
 BEGIN map2users('carrier_name'); END;
 /
-INSERT INTO version (table_name, table_version) values ('domain_name','1');
+INSERT INTO version (table_name, table_version) values ('carrier_name','1');
+
 CREATE TABLE domain_name (
     id NUMBER(10) PRIMARY KEY,
     domain VARCHAR2(64) DEFAULT NULL
@@ -72,3 +74,5 @@ END domain_name_tr;
 /
 BEGIN map2users('domain_name'); END;
 /
+INSERT INTO version (table_name, table_version) values ('domain_name','1');
+

+ 2 - 1
utils/kamctl/oracle/cpl-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('cpl','1');
 CREATE TABLE cpl (
     id NUMBER(10) PRIMARY KEY,
     username VARCHAR2(64),
@@ -16,3 +15,5 @@ END cpl_tr;
 /
 BEGIN map2users('cpl'); END;
 /
+INSERT INTO version (table_name, table_version) values ('cpl','1');
+

+ 4 - 2
utils/kamctl/oracle/dialog-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dialog','7');
 CREATE TABLE dialog (
     id NUMBER(10) PRIMARY KEY,
     hash_entry NUMBER(10),
@@ -36,7 +35,8 @@ BEGIN map2users('dialog'); END;
 /
 CREATE INDEX dialog_hash_idx  ON dialog (hash_entry, hash_id);
 
-INSERT INTO version (table_name, table_version) values ('dialog_vars','1');
+INSERT INTO version (table_name, table_version) values ('dialog','7');
+
 CREATE TABLE dialog_vars (
     id NUMBER(10) PRIMARY KEY,
     hash_entry NUMBER(10),
@@ -55,3 +55,5 @@ BEGIN map2users('dialog_vars'); END;
 /
 CREATE INDEX dialog_vars_hash_idx  ON dialog_vars (hash_entry, hash_id);
 
+INSERT INTO version (table_name, table_version) values ('dialog_vars','1');
+

+ 2 - 1
utils/kamctl/oracle/dialplan-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dialplan','2');
 CREATE TABLE dialplan (
     id NUMBER(10) PRIMARY KEY,
     dpid NUMBER(10),
@@ -19,3 +18,5 @@ END dialplan_tr;
 /
 BEGIN map2users('dialplan'); END;
 /
+INSERT INTO version (table_name, table_version) values ('dialplan','2');
+

+ 2 - 1
utils/kamctl/oracle/dispatcher-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dispatcher','4');
 CREATE TABLE dispatcher (
     id NUMBER(10) PRIMARY KEY,
     setid NUMBER(10) DEFAULT 0 NOT NULL,
@@ -17,3 +16,5 @@ END dispatcher_tr;
 /
 BEGIN map2users('dispatcher'); END;
 /
+INSERT INTO version (table_name, table_version) values ('dispatcher','4');
+

+ 4 - 2
utils/kamctl/oracle/domain-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('domain','2');
 CREATE TABLE domain (
     id NUMBER(10) PRIMARY KEY,
     domain VARCHAR2(64),
@@ -15,7 +14,8 @@ END domain_tr;
 /
 BEGIN map2users('domain'); END;
 /
-INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
+INSERT INTO version (table_name, table_version) values ('domain','2');
+
 CREATE TABLE domain_attrs (
     id NUMBER(10) PRIMARY KEY,
     did VARCHAR2(64),
@@ -34,3 +34,5 @@ END domain_attrs_tr;
 /
 BEGIN map2users('domain_attrs'); END;
 /
+INSERT INTO version (table_name, table_version) values ('domain_attrs','1');
+

+ 2 - 1
utils/kamctl/oracle/domainpolicy-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('domainpolicy','2');
 CREATE TABLE domainpolicy (
     id NUMBER(10) PRIMARY KEY,
     rule VARCHAR2(255),
@@ -19,3 +18,5 @@ BEGIN map2users('domainpolicy'); END;
 /
 CREATE INDEX domainpolicy_rule_idx  ON domainpolicy (rule);
 
+INSERT INTO version (table_name, table_version) values ('domainpolicy','2');
+

+ 8 - 4
utils/kamctl/oracle/drouting-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
 CREATE TABLE dr_gateways (
     gwid NUMBER(10) PRIMARY KEY,
     type NUMBER(10) DEFAULT 0 NOT NULL,
@@ -17,7 +16,8 @@ END dr_gateways_tr;
 /
 BEGIN map2users('dr_gateways'); END;
 /
-INSERT INTO version (table_name, table_version) values ('dr_rules','3');
+INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
+
 CREATE TABLE dr_rules (
     ruleid NUMBER(10) PRIMARY KEY,
     groupid VARCHAR2(255),
@@ -37,7 +37,8 @@ END dr_rules_tr;
 /
 BEGIN map2users('dr_rules'); END;
 /
-INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+INSERT INTO version (table_name, table_version) values ('dr_rules','3');
+
 CREATE TABLE dr_gw_lists (
     id NUMBER(10) PRIMARY KEY,
     gwlist VARCHAR2(255),
@@ -52,7 +53,8 @@ END dr_gw_lists_tr;
 /
 BEGIN map2users('dr_gw_lists'); END;
 /
-INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
+
 CREATE TABLE dr_groups (
     id NUMBER(10) PRIMARY KEY,
     username VARCHAR2(64),
@@ -69,3 +71,5 @@ END dr_groups_tr;
 /
 BEGIN map2users('dr_groups'); END;
 /
+INSERT INTO version (table_name, table_version) values ('dr_groups','2');
+

+ 4 - 2
utils/kamctl/oracle/group-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('grp','2');
 CREATE TABLE grp (
     id NUMBER(10) PRIMARY KEY,
     username VARCHAR2(64) DEFAULT '',
@@ -16,7 +15,8 @@ END grp_tr;
 /
 BEGIN map2users('grp'); END;
 /
-INSERT INTO version (table_name, table_version) values ('re_grp','1');
+INSERT INTO version (table_name, table_version) values ('grp','2');
+
 CREATE TABLE re_grp (
     id NUMBER(10) PRIMARY KEY,
     reg_exp VARCHAR2(128) DEFAULT '',
@@ -33,3 +33,5 @@ BEGIN map2users('re_grp'); END;
 /
 CREATE INDEX re_grp_group_idx  ON re_grp (group_id);
 
+INSERT INTO version (table_name, table_version) values ('re_grp','1');
+

+ 2 - 1
utils/kamctl/oracle/htable-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('htable','2');
 CREATE TABLE htable (
     id NUMBER(10) PRIMARY KEY,
     key_name VARCHAR2(64) DEFAULT '',
@@ -16,3 +15,5 @@ END htable_tr;
 /
 BEGIN map2users('htable'); END;
 /
+INSERT INTO version (table_name, table_version) values ('htable','2');
+

+ 4 - 2
utils/kamctl/oracle/imc-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('imc_rooms','1');
 CREATE TABLE imc_rooms (
     id NUMBER(10) PRIMARY KEY,
     name VARCHAR2(64),
@@ -15,7 +14,8 @@ END imc_rooms_tr;
 /
 BEGIN map2users('imc_rooms'); END;
 /
-INSERT INTO version (table_name, table_version) values ('imc_members','1');
+INSERT INTO version (table_name, table_version) values ('imc_rooms','1');
+
 CREATE TABLE imc_members (
     id NUMBER(10) PRIMARY KEY,
     username VARCHAR2(64),
@@ -33,3 +33,5 @@ END imc_members_tr;
 /
 BEGIN map2users('imc_members'); END;
 /
+INSERT INTO version (table_name, table_version) values ('imc_members','1');
+

+ 6 - 3
utils/kamctl/oracle/lcr-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('lcr_gw','3');
 CREATE TABLE lcr_gw (
     id NUMBER(10) PRIMARY KEY,
     lcr_id NUMBER(5),
@@ -26,7 +25,8 @@ BEGIN map2users('lcr_gw'); END;
 /
 CREATE INDEX lcr_gw_lcr_id_idx  ON lcr_gw (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule_target','1');
+INSERT INTO version (table_name, table_version) values ('lcr_gw','3');
+
 CREATE TABLE lcr_rule_target (
     id NUMBER(10) PRIMARY KEY,
     lcr_id NUMBER(5),
@@ -47,7 +47,8 @@ BEGIN map2users('lcr_rule_target'); END;
 /
 CREATE INDEX lcr_rule_target_lcr_id_idx  ON lcr_rule_target (lcr_id);
 
-INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+INSERT INTO version (table_name, table_version) values ('lcr_rule_target','1');
+
 CREATE TABLE lcr_rule (
     id NUMBER(10) PRIMARY KEY,
     lcr_id NUMBER(5),
@@ -67,3 +68,5 @@ END lcr_rule_tr;
 /
 BEGIN map2users('lcr_rule'); END;
 /
+INSERT INTO version (table_name, table_version) values ('lcr_rule','2');
+

+ 2 - 1
utils/kamctl/oracle/matrix-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('matrix','1');
 CREATE TABLE matrix (
     first NUMBER(10),
     second NUMBER(5),
@@ -15,3 +14,5 @@ BEGIN map2users('matrix'); END;
 /
 CREATE INDEX matrix_matrix_idx  ON matrix (first, second);
 
+INSERT INTO version (table_name, table_version) values ('matrix','1');
+

+ 4 - 2
utils/kamctl/oracle/mohqueue-create.sql

@@ -1,4 +1,3 @@
-INSERT INTO version (table_name, table_version) values ('mohqcalls','1');
 CREATE TABLE mohqcalls (
     id NUMBER(10) PRIMARY KEY,
     mohq_id NUMBER(10),
@@ -18,7 +17,8 @@ END mohqcalls_tr;
 /
 BEGIN map2users('mohqcalls'); END;
 /
-INSERT INTO version (table_name, table_version) values ('mohqueues','1');
+INSERT INTO version (table_name, table_version) values ('mohqcalls','1');
+
 CREATE TABLE mohqueues (
     id NUMBER(10) PRIMARY KEY,
     name VARCHAR2(25),
@@ -38,3 +38,5 @@ END mohqueues_tr;
 /
 BEGIN map2users('mohqueues'); END;
 /
+INSERT INTO version (table_name, table_version) values ('mohqueues','1');
+

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä