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 <mprokop@sipwise.com>
remotes/svn/2.7
Michael Prokop 14 years ago
parent f5965aa214
commit dfde6222d5

@ -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

@ -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

@ -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;

@ -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;

@ -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;

@ -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;

@ -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';

@ -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);

@ -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)));

@ -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)));

@ -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);

@ -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)

@ -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)

Loading…
Cancel
Save