Browse Source

schema update

update-rsyslog-config
lazedo 7 years ago
parent
commit
d156f5f9d4
6 changed files with 22 additions and 22 deletions
  1. +1
    -1
      kamailio/db_scripts/check-kazoodb-sql.sh
  2. +3
    -1
      kamailio/db_scripts/db_kazoo-specific
  3. +6
    -0
      kamailio/db_scripts/vw_w_keepalive_contact.sql
  4. +6
    -0
      kamailio/db_scripts/vw_w_location_contact.sql
  5. +6
    -0
      kamailio/db_scripts/vw_w_watchers_contact.sql
  6. +0
    -20
      kamailio/db_scripts/ww_keepalive_views.sql

+ 1
- 1
kamailio/db_scripts/check-kazoodb-sql.sh View File

@ -25,7 +25,7 @@ fi
for VIEW in `ls ${DB_SCRIPT_DIR}/vw_*.sql`; do
filename=$(basename -- "$VIEW")
filename="${filename%.*}"
viewname=$(echo -n "$filename" | cut -d'_' -f2)
viewname=${filename#*_}
v1=$(KazooDB -db ${DB_CURRENT_DB} "select sql from sqlite_master where type='view' and name='$viewname'" 2> /dev/null | tr -d ' ' | md5sum | cut -d ' ' -f1)
v2=$(cat $VIEW | tr -d ' ' | md5sum | cut -d ' ' -f1)
if [[ "$v1" != "$v2" ]]; then


+ 3
- 1
kamailio/db_scripts/db_kazoo-specific View File

@ -57,7 +57,9 @@ CREATE TABLE keepalive (
CONSTRAINT keepalive_idx_3 UNIQUE (slot, failed, contact)
);
INSERT INTO version (table_name, table_version) values ('keepalive','2');
INSERT INTO version (table_name, table_version) values ('keepalive','3');
CREATE UNIQUE INDEX active_watchers_contact ON active_watchers (contact, id);
create table auth_cache as select * from htable;
INSERT INTO version (table_name, table_version) select 'auth_cache', table_version from version where table_name = 'htable';


+ 6
- 0
kamailio/db_scripts/vw_w_keepalive_contact.sql View File

@ -0,0 +1,6 @@
CREATE VIEW w_keepalive_contact as
select id, slot, failed, case when instr(contact,";") > 0
then substr(contact, 1, instr(contact,";")-1)
else contact
end as contact
from keepalive

+ 6
- 0
kamailio/db_scripts/vw_w_location_contact.sql View File

@ -0,0 +1,6 @@
CREATE VIEW w_location_contact as
select id, case when instr(contact,";") > 0
then substr(contact, 1, instr(contact,";")-1)
else contact
end as contact
from location

+ 6
- 0
kamailio/db_scripts/vw_w_watchers_contact.sql View File

@ -0,0 +1,6 @@
CREATE VIEW w_watchers_contact as
select id, case when instr(contact,";") > 0
then substr(contact, 1, instr(contact,";")-1)
else contact
end as contact
from active_watchers

+ 0
- 20
kamailio/db_scripts/ww_keepalive_views.sql View File

@ -1,20 +0,0 @@
CREATE VIEW w_keepalive_contact as
SELECT id, slot, failed, case when instr(contact,";") > 0
then substr(contact, 1, instr(contact,";")-1)
else contact
end as contact
from keepalive;
CREATE VIEW w_location_contact as
SELECT id, case when instr(contact,";") > 0
then substr(contact, 1, instr(contact,";")-1)
else contact
end as contact
from location;
CREATE VIEW w_watchers_contact as
select id, case when instr(contact,";") > 0
then substr(contact, 1, instr(contact,";")-1)
else contact
end as contact
from active_watchers;

Loading…
Cancel
Save