From dfde6222d5724bf9432d47b4c95e1e303a3ec68b Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 17 Sep 2012 15:12:35 +0000 Subject: [PATCH] Use '0' instead of now() for timestamps If --no-data is *not* used in the mysqldump command line of trunk deployments then we get stuff like that into our svn repository committed: | > -INSERT INTO `subscriber` VALUES | (1,'no_such_number','voip.sipwise.local','499187eef57cdee845f8e98bf81c04b4','','1cece14d3af643f05273228e790ce1b7','90d1398 | 204f968fc9bca32689d933b90',NULL,'9bcb88b6-541a-43da-8fdc-816f5557ff93','','2012-09-03 | 16:02:41'),(2,'nagios','voip.sipwise.local','nagios4Sipwise!','','e5290263a1b27f90c5630eecc7319715','aba8e5f08f6fc0dd1e18e | 9e27550b8f0',NULL,'ac1697cf-6933-45ef-9abf-b1278054ded0','','2012-09-03 16:02:41'); | > +INSERT INTO `subscriber` VALUES | (1,'no_such_number','voip.sipwise.local','3ce39530696080435b2625be8de48786','','d2635d573e32f8e49bea5b8244d6f54f','457794a | 1beffd43c1cbe04e3cb5c0229',NULL,'9bcb88b6-541a-43da-8fdc-816f5557ff93','','2012-09-03 | 16:24:36'),(2,'nagios','voip.sipwise.local','nagios4Sipwise!','','e5290263a1b27f90c5630eecc7319715','aba8e5f08f6fc0dd1e18e | 9e27550b8f0',NULL,'ac1697cf-6933-45ef-9abf-b1278054ded0','','2012-09-03 16:24:36'); | [...] To avoid those moving timestamp changes hit our svn repos we replace all function calls to "now()" with just '0'. Also see discussion on development@sipwise.com with thread subject "[VCS/DEV] r10942 - ngcp/db-schema/trunk/schema" Acked-by: Daniel Tiefnig Acked-by: Jon Bonilla From: Michael Prokop --- db_scripts/base/0010_create_bss.up | 2 +- db_scripts/base/0020_create_oss.up | 4 ++-- db_scripts/base/0040_create_oss_triggers_kamailio.up | 2 +- db_scripts/base/3972.down | 2 +- db_scripts/base/3972.up | 2 +- db_scripts/base/4762.up | 4 ++-- db_scripts/base/5973.up | 4 ++-- db_scripts/diff/10950.up | 2 +- db_scripts/diff/9086.down | 2 +- db_scripts/diff/9086.up | 2 +- db_scripts/diff/9256.up | 2 +- db_scripts/diff/9303.up | 4 ++-- db_scripts/diff/9312.up | 8 ++++---- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/db_scripts/base/0010_create_bss.up b/db_scripts/base/0010_create_bss.up index d93fb5ea..8a7e0c07 100644 --- a/db_scripts/base/0010_create_bss.up +++ b/db_scripts/base/0010_create_bss.up @@ -622,7 +622,7 @@ INSERT INTO `products` (2,NULL,'sippeering','SIP_PEERING','SIP Peering',1,NULL,NULL,NULL), (3,NULL,'reseller','VOIP_RESELLER','VoIP Reseller',1,NULL,NULL,NULL); -- the default reseller contract, will be the only one unless multitenancy is enabled -INSERT INTO `contracts` VALUES (1,NULL,NULL,NULL,NULL,'active',now(),now(),now(),NULL); +INSERT INTO `contracts` VALUES (1,NULL,NULL,NULL,NULL,'active','0','0','0',NULL); INSERT INTO `resellers` VALUES (1,1,'default','active'); INSERT INTO `billing_mappings` VALUES (1,NULL,NULL,NULL,1,3); -- first administrative account, change password after first login diff --git a/db_scripts/base/0020_create_oss.up b/db_scripts/base/0020_create_oss.up index b5850e0b..908322c6 100644 --- a/db_scripts/base/0020_create_oss.up +++ b/db_scripts/base/0020_create_oss.up @@ -397,10 +397,10 @@ INSERT INTO xmlgroups (name) VALUES('appserver'); -- internal domain and subscribers INSERT INTO voip_domains (domain, local) VALUES('voip.sipwise.local', true); INSERT INTO voip_subscribers (username, domain_id, uuid, create_timestamp) - SELECT 'no_such_number', id, '9bcb88b6-541a-43da-8fdc-816f5557ff93', NOW() + SELECT 'no_such_number', id, '9bcb88b6-541a-43da-8fdc-816f5557ff93', '0' FROM voip_domains WHERE domain = 'voip.sipwise.local'; INSERT INTO voip_subscribers (username, domain_id, uuid, password, create_timestamp) - SELECT 'nagios', id, 'ac1697cf-6933-45ef-9abf-b1278054ded0', 'nagios4Sipwise!', NOW() + SELECT 'nagios', id, 'ac1697cf-6933-45ef-9abf-b1278054ded0', 'nagios4Sipwise!', '0' FROM voip_domains WHERE domain = 'voip.sipwise.local'; -- kamailio preferences diff --git a/db_scripts/base/0040_create_oss_triggers_kamailio.up b/db_scripts/base/0040_create_oss_triggers_kamailio.up index 585a892a..f240eb6e 100644 --- a/db_scripts/base/0040_create_oss_triggers_kamailio.up +++ b/db_scripts/base/0040_create_oss_triggers_kamailio.up @@ -11,7 +11,7 @@ CREATE TRIGGER voip_sub_crepl_trig AFTER INSERT ON voip_subscribers SELECT domain INTO subscriber_domain FROM voip_domains where id = NEW.domain_id; INSERT INTO kamailio.subscriber (username, domain, uuid, timezone, password, datetime_created, ha1, ha1b) - VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.timezone, NEW.password, now(), + VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.timezone, NEW.password, '0', MD5(CONCAT(NEW.username, ':', subscriber_domain, ':', NEW.password)), MD5(CONCAT(NEW.username, '@', subscriber_domain, ':', subscriber_domain, ':', NEW.password))); END; diff --git a/db_scripts/base/3972.down b/db_scripts/base/3972.down index 507f6834..e5930fae 100644 --- a/db_scripts/base/3972.down +++ b/db_scripts/base/3972.down @@ -13,7 +13,7 @@ CREATE TRIGGER provisioning.voip_sub_crepl_trig AFTER INSERT ON voip_subscribers SELECT domain INTO subscriber_domain FROM voip_domains where id = NEW.domain_id; INSERT INTO kamailio.subscriber (username, domain, uuid, timezone, password, datetime_created, ha1, ha1b) - VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.timezone, NEW.password, now(), + VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.timezone, NEW.password, '0', MD5(CONCAT(NEW.username, ':', subscriber_domain, ':', NEW.password)), MD5(CONCAT(NEW.username, '@', subscriber_domain, ':', subscriber_domain, ':', NEW.password))); END; diff --git a/db_scripts/base/3972.up b/db_scripts/base/3972.up index 769c837a..e645a1ca 100644 --- a/db_scripts/base/3972.up +++ b/db_scripts/base/3972.up @@ -13,7 +13,7 @@ CREATE TRIGGER provisioning.voip_sub_crepl_trig AFTER INSERT ON voip_subscribers SELECT domain INTO subscriber_domain FROM voip_domains where id = NEW.domain_id; INSERT INTO kamailio.subscriber (username, domain, uuid, password, datetime_created, ha1, ha1b) - VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.password, now(), + VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.password, '0', MD5(CONCAT(NEW.username, ':', subscriber_domain, ':', NEW.password)), MD5(CONCAT(NEW.username, '@', subscriber_domain, ':', subscriber_domain, ':', NEW.password))); END; diff --git a/db_scripts/base/4762.up b/db_scripts/base/4762.up index ee85687c..c7a6854c 100644 --- a/db_scripts/base/4762.up +++ b/db_scripts/base/4762.up @@ -38,7 +38,7 @@ CREATE TRIGGER voip_peerpref_crepl_trig AFTER INSERT ON voip_peer_preferences INSERT INTO kamailio.peer_preferences (id, uuid, attribute, type, value, last_modified) - SELECT NEW.id, NEW.peer_host_id, attribute, type, NEW.value, NOW() + SELECT NEW.id, NEW.peer_host_id, attribute, type, NEW.value, '0' FROM provisioning.voip_preferences WHERE id = NEW.attribute_id; @@ -50,7 +50,7 @@ CREATE TRIGGER voip_peerpref_urepl_trig AFTER UPDATE ON voip_peer_preferences UPDATE kamailio.peer_preferences pp, provisioning.voip_preferences vp SET pp.id = NEW.id, pp.uuid = NEW.peer_host_id, pp.type = vp.type, - pp.attribute = vp.attribute, pp.value = NEW.value, pp.last_modified = NOW() + pp.attribute = vp.attribute, pp.value = NEW.value, pp.last_modified = '0' WHERE pp.id = OLD.id AND vp.id = NEW.attribute_id; diff --git a/db_scripts/base/5973.up b/db_scripts/base/5973.up index 272661cb..399e165a 100644 --- a/db_scripts/base/5973.up +++ b/db_scripts/base/5973.up @@ -1,5 +1,5 @@ USE provisioning; DELETE FROM provisioning.voip_domains where domain = 'voip.sipwise.local'; INSERT INTO provisioning.voip_domains (domain) VALUES('voip.sipwise.local'); -INSERT INTO provisioning.voip_subscribers (username, domain_id, uuid, password, create_timestamp) SELECT 'no_such_number', id, '9bcb88b6-541a-43da-8fdc-816f5557ff93', MD5(RAND()), NOW() FROM voip_domains WHERE domain = 'voip.sipwise.local'; -INSERT INTO provisioning.voip_subscribers (username, domain_id, uuid, password, create_timestamp) SELECT 'nagios', id, 'ac1697cf-6933-45ef-9abf-b1278054ded0', 'nagios4Sipwise!', NOW() FROM voip_domains WHERE domain = 'voip.sipwise.local'; +INSERT INTO provisioning.voip_subscribers (username, domain_id, uuid, password, create_timestamp) SELECT 'no_such_number', id, '9bcb88b6-541a-43da-8fdc-816f5557ff93', MD5(RAND()), '0' FROM voip_domains WHERE domain = 'voip.sipwise.local'; +INSERT INTO provisioning.voip_subscribers (username, domain_id, uuid, password, create_timestamp) SELECT 'nagios', id, 'ac1697cf-6933-45ef-9abf-b1278054ded0', 'nagios4Sipwise!', '0' FROM voip_domains WHERE domain = 'voip.sipwise.local'; diff --git a/db_scripts/diff/10950.up b/db_scripts/diff/10950.up index 926d0af6..0262f8cf 100644 --- a/db_scripts/diff/10950.up +++ b/db_scripts/diff/10950.up @@ -1,5 +1,5 @@ use accounting; alter table prepaid_costs add column timestamp timestamp not null; -update prepaid_costs set timestamp = now(); +update prepaid_costs set timestamp = '0'; alter table prepaid_costs add key (timestamp); diff --git a/db_scripts/diff/9086.down b/db_scripts/diff/9086.down index 80b4ce9e..cd0ab475 100644 --- a/db_scripts/diff/9086.down +++ b/db_scripts/diff/9086.down @@ -37,7 +37,7 @@ FOR EACH ROW BEGIN SELECT domain INTO subscriber_domain FROM voip_domains where id = NEW.domain_id; INSERT INTO kamailio.subscriber (username, domain, uuid, password, datetime_created, ha1, ha1b) - VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.password, now(), + VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.password, '0', MD5(CONCAT(NEW.username, ':', subscriber_domain, ':', NEW.password)), MD5(CONCAT(NEW.username, '@', subscriber_domain, ':', subscriber_domain, ':', NEW.password))); diff --git a/db_scripts/diff/9086.up b/db_scripts/diff/9086.up index 43f21348..94f251d2 100644 --- a/db_scripts/diff/9086.up +++ b/db_scripts/diff/9086.up @@ -89,7 +89,7 @@ FOR EACH ROW BEGIN SELECT domain INTO subscriber_domain FROM voip_domains where id = NEW.domain_id; INSERT INTO kamailio.subscriber (username, domain, uuid, password, datetime_created, ha1, ha1b) - VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.password, now(), + VALUES(NEW.username, subscriber_domain, NEW.uuid, NEW.password, '0', MD5(CONCAT(NEW.username, ':', subscriber_domain, ':', NEW.password)), MD5(CONCAT(NEW.username, '@', subscriber_domain, ':', subscriber_domain, ':', NEW.password))); diff --git a/db_scripts/diff/9256.up b/db_scripts/diff/9256.up index b988e1e0..9a7f8617 100644 --- a/db_scripts/diff/9256.up +++ b/db_scripts/diff/9256.up @@ -1,5 +1,5 @@ USE provisioning; -INSERT INTO voip_preferences VALUES(NULL, 'outbound_socket', 0, 1, 1, 1, 1, now(), 0, 'enum', 0, 'Outbound socket to be used for SIP communication to this entity'); +INSERT INTO voip_preferences VALUES(NULL, 'outbound_socket', 0, 1, 1, 1, 1, '0', 0, 'enum', 0, 'Outbound socket to be used for SIP communication to this entity'); SELECT last_insert_id() INTO @obs_pref_id; INSERT INTO voip_preferences_enum VALUES(NULL, @obs_pref_id, 'default', NULL, 1, 1, 1, 1); diff --git a/db_scripts/diff/9303.up b/db_scripts/diff/9303.up index 3bc96d8e..4212ef91 100644 --- a/db_scripts/diff/9303.up +++ b/db_scripts/diff/9303.up @@ -3,7 +3,7 @@ USE provisioning; INSERT INTO voip_preferences (attribute, type, max_occur, usr_pref, dom_pref, peer_pref, modify_timestamp, internal, data_type, read_only, description) VALUES -('inbound_upn', 0, 1, 1, 1, 1, now(), 0, 'enum', 0, 'The SIP header field to fetch the user-provided-number from for inbound calls'); +('inbound_upn', 0, 1, 1, 1, 1, '0', 0, 'enum', 0, 'The SIP header field to fetch the user-provided-number from for inbound calls'); SELECT last_insert_id() INTO @upn_pref_id; INSERT INTO voip_preferences_enum (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val) @@ -17,7 +17,7 @@ VALUES INSERT INTO voip_preferences (attribute, type, max_occur, usr_pref, dom_pref, peer_pref, modify_timestamp, internal, data_type, read_only, description) VALUES -('inbound_npn', 0, 1, 0, 0, 1, now(), 0, 'enum', 0, 'The SIP header field to fetch the network-provided-number from for inbound calls'); +('inbound_npn', 0, 1, 0, 0, 1, '0', 0, 'enum', 0, 'The SIP header field to fetch the network-provided-number from for inbound calls'); SELECT last_insert_id() INTO @npn_pref_id; INSERT INTO voip_preferences_enum (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val) diff --git a/db_scripts/diff/9312.up b/db_scripts/diff/9312.up index f6ff6060..7306f87f 100644 --- a/db_scripts/diff/9312.up +++ b/db_scripts/diff/9312.up @@ -3,7 +3,7 @@ USE provisioning; INSERT INTO voip_preferences (attribute, type, max_occur, usr_pref, dom_pref, peer_pref, modify_timestamp, internal, data_type, read_only, description) VALUES -('outbound_from_user', 0, 1, 1, 1, 1, now(), 0, 'enum', 0, 'The content to put into the From username for outbound calls'); +('outbound_from_user', 0, 1, 1, 1, 1, '0', 0, 'enum', 0, 'The content to put into the From username for outbound calls'); SELECT last_insert_id() INTO @pref_id; INSERT INTO voip_preferences_enum (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val) @@ -16,7 +16,7 @@ VALUES INSERT INTO voip_preferences (attribute, type, max_occur, usr_pref, dom_pref, peer_pref, modify_timestamp, internal, data_type, read_only, description) VALUES -('outbound_from_display', 0, 1, 1, 1, 1, now(), 0, 'enum', 0, 'The content to put into the From display-name for outbound calls'); +('outbound_from_display', 0, 1, 1, 1, 1, '0', 0, 'enum', 0, 'The content to put into the From display-name for outbound calls'); SELECT last_insert_id() INTO @pref_id; INSERT INTO voip_preferences_enum (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val) @@ -30,7 +30,7 @@ VALUES INSERT INTO voip_preferences (attribute, type, max_occur, usr_pref, dom_pref, peer_pref, modify_timestamp, internal, data_type, read_only, description) VALUES -('outbound_pai_user', 0, 1, 1, 1, 1, now(), 0, 'enum', 0, 'The content to put into the P-Asserted-Identity username for outbound calls (use "None" to not set header at all)'); +('outbound_pai_user', 0, 1, 1, 1, 1, '0', 0, 'enum', 0, 'The content to put into the P-Asserted-Identity username for outbound calls (use "None" to not set header at all)'); SELECT last_insert_id() INTO @pref_id; INSERT INTO voip_preferences_enum (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val) @@ -44,7 +44,7 @@ VALUES INSERT INTO voip_preferences (attribute, type, max_occur, usr_pref, dom_pref, peer_pref, modify_timestamp, internal, data_type, read_only, description) VALUES -('outbound_ppi_user', 0, 1, 1, 1, 1, now(), 0, 'enum', 0, 'The content to put into the P-Preferred-Identity username for outbound calls (use "None" to not set header at all)'); +('outbound_ppi_user', 0, 1, 1, 1, 1, '0', 0, 'enum', 0, 'The content to put into the P-Preferred-Identity username for outbound calls (use "None" to not set header at all)'); SELECT last_insert_id() INTO @pref_id; INSERT INTO voip_preferences_enum (preference_id, label, value, usr_pref, dom_pref, peer_pref, default_val)