usercarrier

mail@pastecode.io avatar
unknown
pgsql
2 years ago
3.8 kB
3
Indexable
Never
-- "Comerciales_7265".carrier_control definition

-- Drop table

-- DROP TABLE "Comerciales_7265".carrier_control;

CREATE TABLE "Comerciales_7265".carrier_control (
	user_carrier int4 NOT NULL,
	last_ubication int4 NULL,
	before_ubication int4 NULL,
	state int4 NOT NULL DEFAULT 0,
	request int4 NULL,
	last_request int4 NULL,
	date_starts_shift timestamp NULL,
	date_ends_shift timestamp NULL,
	date_ubication_last timestamp NULL,
	date_ubication_before timestamp NULL,
	alert_inactivity timestamp NULL,
	alert_timeout timestamp NULL,
	detail_process_beacon varchar(100) NULL
);


-- "Comerciales_7265".carrier_control foreign keys

ALTER TABLE "Comerciales_7265".carrier_control ADD CONSTRAINT before_ubication_fk FOREIGN KEY (before_ubication) REFERENCES "Comerciales_7265".ubication(id);
ALTER TABLE "Comerciales_7265".carrier_control ADD CONSTRAINT last_ubication_fk FOREIGN KEY (last_ubication) REFERENCES "Comerciales_7265".ubication(id);
ALTER TABLE "Comerciales_7265".carrier_control ADD CONSTRAINT request_fk FOREIGN KEY (request) REFERENCES "Comerciales_7265".request(id);
ALTER TABLE "Comerciales_7265".carrier_control ADD CONSTRAINT user_carrier_fk FOREIGN KEY (user_carrier) REFERENCES "schemaCommon".user_system_account(id);

INSERT INTO "Comerciales_7265".carrier_control (user_carrier,last_ubication,before_ubication,state,request,last_request,date_starts_shift,date_ends_shift,date_ubication_last,date_ubication_before,alert_inactivity,alert_timeout,detail_process_beacon) VALUES
	 (76,11,4,1,NULL,285,'2021-07-27 15:59:56','2021-07-27 18:00:52','2021-04-05 11:19:29','2020-06-19 16:11:05','2021-07-27 18:15:14',NULL,'Paso 3 2021/07/27 17:57:39'),
	 (198,NULL,NULL,1,NULL,NULL,'2021-06-02 00:08:31','2021-06-02 00:22:07',NULL,NULL,'2021-06-02 00:28:31',NULL,NULL),
	 (87,8,7,1,NULL,143,'2021-06-03 08:56:38','2021-06-03 08:58:30','2020-10-20 11:40:27','2020-03-03 10:29:06','2021-06-03 09:03:54',NULL,'Paso 3 2020/10/20 11:40:27'),
	 (229,NULL,NULL,1,NULL,NULL,'2021-10-25 14:35:07','2021-10-25 14:36:28',NULL,NULL,'2021-10-25 14:55:08',NULL,'Paso 3 2021/10/25 14:43:18'),
	 (169,11,NULL,1,NULL,NULL,NULL,NULL,'2021-01-28 10:26:33',NULL,'2021-01-28 10:36:24',NULL,'Paso 3 2021/01/28 10:26:32'),
	 (102,10,9,1,NULL,282,'2021-06-23 09:44:09','2021-06-23 09:52:51','2020-06-26 10:21:33','2020-06-26 10:21:21','2021-06-23 10:09:03',NULL,'Paso 3 2021/07/01 11:31:58'),
	 (92,15,2,1,NULL,NULL,'2020-09-25 23:56:19','2020-09-26 00:08:31','2020-09-26 00:34:36','2020-09-25 23:53:33','2020-09-26 00:13:34',NULL,'Paso 3 2020/09/26 00:34:36'),
	 (99,8,NULL,1,NULL,68,'2020-06-09 09:03:58','2020-06-09 09:48:10','2020-06-09 09:48:13',NULL,'2020-06-09 10:06:55',NULL,'Paso 3 2020/06/09 09:48:13'),
	 (100,7,13,1,NULL,295,'2021-09-30 14:50:26','2021-09-30 16:01:16','2021-09-30 16:01:39','2020-11-09 14:41:51','2021-09-30 16:15:06',NULL,'Paso 3 2021/10/11 12:26:29'),
	 (101,11,4,1,NULL,249,'2021-03-10 10:23:30','2021-03-16 10:13:27','2021-03-16 10:13:38','2020-09-21 15:02:46','2021-03-16 10:13:31',NULL,'Paso 2 2021/03/16 10:13:38');
INSERT INTO "Comerciales_7265".carrier_control (user_carrier,last_ubication,before_ubication,state,request,last_request,date_starts_shift,date_ends_shift,date_ubication_last,date_ubication_before,alert_inactivity,alert_timeout,detail_process_beacon) VALUES
	 (143,11,15,1,NULL,136,'2021-01-25 21:23:59','2021-01-25 21:42:23','2021-01-25 21:23:12','2020-09-27 19:09:27','2021-01-25 21:52:13',NULL,'Paso 3 2021/03/08 12:10:49'),
	 (93,NULL,NULL,6,NULL,NULL,'2021-11-29 13:02:28',NULL,NULL,NULL,'2021-11-29 18:29:46',NULL,NULL);
	 (93,NULL,NULL,6,NULL,NULL,'2021-11-29 14:02:28',NULL,NULL,NULL,'2021-11-29 18:29:46',NULL,NULL);
	 (93,NULL,NULL,6,NULL,NULL,'2021-11-29 15:02:28',NULL,NULL,NULL,'2021-11-29 18:29:46',NULL,NULL);