WITH init_values AS (SELECT NOW()::DATE AS now_date)
INSERT INTO ropidgtfs_calendar_actual (end_date,friday,monday,saturday,service_id,start_date,sunday,thursday,tuesday,wednesday,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 (TO_CHAR((SELECT now_date FROM init_values)+INTERVAL '7 days','YYYYMMDD'),1,1,1,'1111111-2',TO_CHAR((SELECT now_date FROM init_values)-INTERVAL '1 days','YYYYMMDD'),1,1,1,1,-1,'2022-10-24 10:18:51.362+02',NULL,-1,'2022-10-24 10:18:51.362+02',NULL);

INSERT INTO ropidgtfs_stops_actual (level_id,location_type,parent_station,platform_code,stop_code,stop_desc,stop_id,stop_lat,stop_lon,stop_name,stop_timezone,stop_url,wheelchair_boarding,zone_id,asw_node_id,asw_stop_id,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 ('U157L2',0,'U157S1','1',NULL,NULL,'U157Z101P',50.09831,14.36283,'Bořislavka',NULL,NULL,1,'P',157,101,-1,'2022-10-24 10:21:10.47+02',NULL,-1,'2022-10-24 10:21:10.47+02',NULL),
	 ('U157L2',0,'U157S1','2',NULL,NULL,'U157Z102P',50.09837,14.36282,'Bořislavka',NULL,NULL,1,'P',157,102,-1,'2022-10-24 10:21:10.47+02',NULL,-1,'2022-10-24 10:21:10.47+02',NULL),
	 ('U400L4',0,'U400S1','A1',NULL,NULL,'U400Z101P',50.0794,14.43159,'Muzeum',NULL,NULL,1,'P',400,101,-1,'2022-10-24 10:21:10.47+02',NULL,-1,'2022-10-24 10:21:10.47+02',NULL),
	 ('U400L4',0,'U400S1','A2',NULL,NULL,'U400Z102P',50.07953,14.43178,'Muzeum',NULL,NULL,1,'P',400,102,-1,'2022-10-24 10:21:10.47+02',NULL,-1,'2022-10-24 10:21:10.47+02',NULL),
	 ('U462L3',0,'U462S1','M1',NULL,NULL,'U462Z101P',50.09588,14.34829,'Nádraží Veleslavín',NULL,NULL,1,'P',462,101,-1,'2022-10-24 10:21:10.47+02',NULL,-1,'2022-10-24 10:21:10.47+02',NULL),
	 ('U462L3',0,'U462S1','M2',NULL,NULL,'U462Z102P',50.09583,14.34836,'Nádraží Veleslavín',NULL,NULL,1,'P',462,102,-1,'2022-10-24 10:21:10.47+02',NULL,-1,'2022-10-24 10:21:10.47+02',NULL)
        ON CONFLICT DO NOTHING;

INSERT INTO ropidgtfs_stops_actual (stop_id,level_id,location_type,parent_station,platform_code,stop_code,stop_desc,stop_lat,stop_lon,stop_name,stop_timezone,stop_url,wheelchair_boarding,zone_id,asw_node_id,asw_stop_id,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 ('U476Z101P','U476L2',0,'U476S1','1',NULL,NULL,50.07531,14.43976,'Náměstí Míru',NULL,NULL,2,'P',476,101,NULL,'2023-07-20 05:38:03.527',NULL,NULL,'2023-07-20 05:38:03.527',NULL),
	 ('U209Z101P','U209L2',0,'U209S1','1',NULL,NULL,50.07769,14.45077,'Jiřího z Poděbrad',NULL,NULL,0,'P',209,101,NULL,'2023-07-20 05:38:03.527',NULL,NULL,'2023-07-20 05:38:03.527',NULL);

INSERT INTO ropidgtfs_stop_times_actual (arrival_time,arrival_time_seconds,departure_time,departure_time_seconds,drop_off_type,pickup_type,shape_dist_traveled,stop_headsign,stop_id,stop_sequence,timepoint,trip_id,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 ('9:55:10',NULL,'9:55:10',NULL,'0','0',0.0,NULL,'U1071Z101P',1,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('9:57:10',NULL,'9:57:40',NULL,'0','0',1.142977,NULL,'U953Z102P',2,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('9:59:55',NULL,'10:00:25',NULL,'0','0',2.532413,NULL,'U713Z102P',3,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:02:05',NULL,'10:02:35',NULL,'0','0',3.768299,NULL,'U921Z102P',4,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:04:00',NULL,'10:04:20',NULL,'0','0',4.713793,NULL,'U118Z102P',5,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:05:35',NULL,'10:05:55',NULL,'0','0',5.577322,NULL,'U209Z102P',6,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:07:10',NULL,'10:07:30',NULL,'0','0',6.43347,NULL,'U476Z102P',7,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:08:45',NULL,'10:09:15',NULL,'0','0',7.240121,NULL,'U400Z102P',8,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:10:20',NULL,'10:10:50',NULL,'0','0',7.930907,NULL,'U1072Z102P',9,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:12:00',NULL,'10:12:20',NULL,'0','0',8.673048,NULL,'U703Z102P',10,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:13:25',NULL,'10:13:45',NULL,'0','0',9.448995,NULL,'U360Z102P',11,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:15:05',NULL,'10:15:35',NULL,'0','0',10.270193,NULL,'U163Z102P',12,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:16:55',NULL,'10:17:25',NULL,'0','0',11.099298,NULL,'U321Z102P',13,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:20:00',NULL,'10:20:20',NULL,'0','0',13.284389,NULL,'U157Z102P',14,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:21:50',NULL,'10:22:10',NULL,'0','0',14.377112,NULL,'U462Z102P',15,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:23:50',NULL,'10:24:20',NULL,'0','0',15.513008,NULL,'U507Z102P',16,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:26:20',NULL,'10:26:20',NULL,'0','0',17.037615,NULL,'U306Z102P',17,NULL,'991_77_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:32:35',NULL,'10:32:35',NULL,'0','0',0.0,NULL,'U306Z101P',1,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:34:25',NULL,'10:34:55',NULL,'0','0',1.476727,NULL,'U507Z101P',2,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:36:25',NULL,'10:36:45',NULL,'0','0',2.660696,NULL,'U462Z101P',3,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:38:10',NULL,'10:38:30',NULL,'0','0',3.754257,NULL,'U157Z101P',4,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:40:45',NULL,'10:41:15',NULL,'0','0',5.939039,NULL,'U321Z101P',5,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:42:25',NULL,'10:42:55',NULL,'0','0',6.768432,NULL,'U163Z101P',6,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:44:05',NULL,'10:44:25',NULL,'0','0',7.588778,NULL,'U360Z101P',7,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:45:30',NULL,'10:45:50',NULL,'0','0',8.364975,NULL,'U703Z101P',8,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:47:00',NULL,'10:47:30',NULL,'0','0',9.113977,NULL,'U1072Z101P',9,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:48:40',NULL,'10:49:10',NULL,'0','0',9.79675,NULL,'U400Z101P',10,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:50:30',NULL,'10:50:50',NULL,'0','0',10.604748,NULL,'U476Z101P',11,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:52:05',NULL,'10:52:25',NULL,'0','0',11.461495,NULL,'U209Z101P',12,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:53:45',NULL,'10:54:05',NULL,'0','0',12.322287,NULL,'U118Z101P',13,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:55:25',NULL,'10:55:55',NULL,'0','0',13.268853,NULL,'U921Z101P',14,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:57:40',NULL,'10:58:10',NULL,'0','0',14.488865,NULL,'U713Z101P',15,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:00:40',NULL,'11:00:40',NULL,'0','0',15.794289,NULL,'U953Z102P',16,NULL,'991_78_220321',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:02:40',NULL,'11:02:40',NULL,'0','0',0.0,NULL,'U953Z102P',1,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:04:55',NULL,'11:05:25',NULL,'0','0',1.389436,NULL,'U713Z102P',2,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:07:05',NULL,'11:07:35',NULL,'0','0',2.625322,NULL,'U921Z102P',3,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:09:00',NULL,'11:09:20',NULL,'0','0',3.570817,NULL,'U118Z102P',4,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:10:35',NULL,'11:10:55',NULL,'0','0',4.434345,NULL,'U209Z102P',5,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:12:10',NULL,'11:12:30',NULL,'0','0',5.290494,NULL,'U476Z102P',6,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:13:45',NULL,'11:14:15',NULL,'0','0',6.097144,NULL,'U400Z102P',7,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:15:20',NULL,'11:15:50',NULL,'0','0',6.78793,NULL,'U1072Z102P',8,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:17:00',NULL,'11:17:20',NULL,'0','0',7.530071,NULL,'U703Z102P',9,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:18:25',NULL,'11:18:45',NULL,'0','0',8.306018,NULL,'U360Z102P',10,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:20:05',NULL,'11:20:35',NULL,'0','0',9.127216,NULL,'U163Z102P',11,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:21:55',NULL,'11:22:25',NULL,'0','0',9.956321,NULL,'U321Z102P',12,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:25:00',NULL,'11:25:20',NULL,'0','0',12.141412,NULL,'U157Z102P',13,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:26:50',NULL,'11:27:10',NULL,'0','0',13.234135,NULL,'U462Z102P',14,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:28:50',NULL,'11:29:20',NULL,'0','0',14.370031,NULL,'U507Z102P',15,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('11:31:20',NULL,'11:31:20',NULL,'0','0',15.894638,NULL,'U306Z102P',16,NULL,'991_124_201230',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:04:35',NULL,'10:04:35',NULL,'0','0',0.0,NULL,'U306Z101P',1,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:06:25',NULL,'10:06:55',NULL,'0','0',1.476727,NULL,'U507Z101P',2,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:08:25',NULL,'10:08:45',NULL,'0','0',2.660696,NULL,'U462Z101P',3,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:10:10',NULL,'10:10:30',NULL,'0','0',3.754257,NULL,'U157Z101P',4,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:12:45',NULL,'10:13:15',NULL,'0','0',5.939039,NULL,'U321Z101P',5,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:14:25',NULL,'10:14:55',NULL,'0','0',6.768432,NULL,'U163Z101P',6,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:16:05',NULL,'10:16:25',NULL,'0','0',7.588778,NULL,'U360Z101P',7,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:17:30',NULL,'10:17:50',NULL,'0','0',8.364975,NULL,'U703Z101P',8,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:19:00',NULL,'10:19:30',NULL,'0','0',9.113977,NULL,'U1072Z101P',9,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:20:40',NULL,'10:21:10',NULL,'0','0',9.79675,NULL,'U400Z101P',10,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:22:30',NULL,'10:22:50',NULL,'0','0',10.604748,NULL,'U476Z101P',11,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:24:05',NULL,'10:24:25',NULL,'0','0',11.461495,NULL,'U209Z101P',12,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:25:45',NULL,'10:26:05',NULL,'0','0',12.322287,NULL,'U118Z101P',13,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:27:25',NULL,'10:27:55',NULL,'0','0',13.268853,NULL,'U921Z101P',14,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:29:40',NULL,'10:30:10',NULL,'0','0',14.488865,NULL,'U713Z101P',15,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL),
	 ('10:32:40',NULL,'10:32:40',NULL,'0','0',15.893049,NULL,'U953Z101P',16,NULL,'991_294_220901',-1,'2022-10-24 10:21:13.104+02',NULL,-1,'2022-10-24 10:21:13.104+02',NULL);

INSERT INTO ropidgtfs_routes_actual (agency_id,is_night,is_regional,is_substitute_transport,route_color,route_desc,route_id,route_long_name,route_short_name,route_text_color,route_type,route_url,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 ('99','0','0','0','00A562',NULL,'L991','Nemocnice Motol - Petřiny - Skalka - Depo Hostivař','A','FFFFFF','1','https://pid.cz/linka/A',-1,'2022-10-24 10:18:51.722+02',NULL,-1,'2022-10-24 10:18:51.722+02',NULL)
        ON CONFLICT DO NOTHING;

INSERT INTO ropidgtfs_trips_actual (bikes_allowed,block_id,direction_id,exceptional,route_id,service_id,shape_id,trip_headsign,trip_id,trip_operation_type,trip_short_name,wheelchair_accessible,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 (1,NULL,1,0,'L991','1111111-2','L991V7','Depo Hostivař','991_294_220901',NULL,NULL,1,-1,'2022-10-24 10:22:47.459+02',NULL,-1,'2022-10-24 10:22:47.459+02',NULL),
	 (1,NULL,0,0,'L991','1111111-1','L991V8','Nemocnice Motol','991_77_220901',NULL,NULL,1,-1,'2022-10-24 10:22:47.459+02',NULL,-1,'2022-10-24 10:22:47.459+02',NULL),
	 (1,NULL,1,0,'L991','1111111-1','L991V6','Skalka','991_78_220321',NULL,NULL,1,-1,'2022-10-24 10:22:47.459+02',NULL,-1,'2022-10-24 10:22:47.459+02',NULL),
	 (1,NULL,0,0,'L991','1111111-2','L991V1','Nemocnice Motol','991_124_201230',NULL,NULL,1,-1,'2022-10-24 10:22:47.459+02',NULL,-1,'2022-10-24 10:22:47.459+02',NULL);

INSERT INTO ropidgtfs_run_numbers_actual (route_id,run_number,service_id,trip_id,vehicle_type,trip_number,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
	 ('L991',5,'1111111-1','991_77_220901',3,NULL,NULL,'2022-10-24 10:23:04.722+02',NULL,NULL,'2022-10-24 10:23:04.722+02',NULL),
	 ('L991',5,'1111111-1','991_78_220321',3,NULL,NULL,'2022-10-24 10:23:04.722+02',NULL,NULL,'2022-10-24 10:23:04.722+02',NULL),
	 ('L991',5,'1111111-1','991_124_201230',3,NULL,NULL,'2022-10-24 10:23:04.722+02',NULL,NULL,'2022-10-24 10:23:04.722+02',NULL),
	 ('L991',8,'1111111-3','991_124_201230',3,NULL,NULL,'2022-10-24 10:23:04.722+02',NULL,NULL,'2022-10-24 10:23:04.722+02',NULL),
	 ('L991',9,'1111111-1','991_294_220901',3,NULL,NULL,'2022-10-24 10:23:04.722+02',NULL,NULL,'2022-10-24 10:23:04.722+02',NULL);

WITH init_values AS (
    SELECT CAST(current_date - INTERVAL '1 day' + INTERVAL '10 hour' AS TIMESTAMP WITH TIME ZONE) AT TIME ZONE 'Europe/Prague' AS origin_datetime
)
INSERT INTO vehiclepositions_metro_runs_messages (route_name, message_timestamp, train_set_number_scheduled, train_set_number_real, train_number, track_id, delay_origin, actual_position_timestamp_scheduled, created_at, updated_at) VALUES
    ('A', concat(CURRENT_DATE,'T08:20:08Z')::timestamp, '5', '5', '182', '1806', 25, concat(CURRENT_DATE,'T08:20:33Z')::timestamp, (SELECT origin_datetime FROM init_values), (SELECT origin_datetime FROM init_values)),
    ('A', concat(CURRENT_DATE,'T08:20:13Z')::timestamp, '5', '5', '182', '1806', 25, concat(CURRENT_DATE,'T08:20:38Z')::timestamp, (SELECT origin_datetime FROM init_values), (SELECT origin_datetime FROM init_values)),
    ('A', concat(CURRENT_DATE,'T08:20:08Z')::timestamp, '9', '9', '175', '1211', -15, concat(CURRENT_DATE,'T08:19:53Z')::timestamp, (SELECT origin_datetime FROM init_values), (SELECT origin_datetime FROM init_values)),
    ('A', concat(CURRENT_DATE,'T08:20:13Z')::timestamp, '9', '9', '175', '1209', -15, concat(CURRENT_DATE,'T08:19:58Z')::timestamp, (SELECT origin_datetime FROM init_values), (SELECT origin_datetime FROM init_values));

INSERT INTO vehiclepositions_trips (cis_line_id,cis_trip_number,run_number,cis_line_short_name,created_at,gtfs_route_id,gtfs_route_short_name,gtfs_trip_id,id,updated_at,start_cis_stop_id,start_cis_stop_platform_code,start_time,start_timestamp,vehicle_type_id,wheelchair_accessible,create_batch_id,created_by,update_batch_id,updated_by,agency_name_scheduled,origin_route_name,agency_name_real,vehicle_registration_number,gtfs_trip_headsign,start_asw_stop_id,gtfs_route_type,gtfs_block_id,last_position_id,is_canceled,end_timestamp,gtfs_trip_short_name,last_position_context,provider_source_type) VALUES
	 (NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_78_220321',concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'10:32:35',concat(CURRENT_DATE,'T08:32:35Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Skalka',NULL,1,NULL,30,NULL,concat(CURRENT_DATE,'T09:00:40Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'), '"}')::json, '3'),
	 (NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_77_220901',concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'09:55:10',concat(CURRENT_DATE,'T07:55:10Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Nemocnice Motol',NULL,1,NULL,29,NULL,concat(CURRENT_DATE,'T08:26:20Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'), '"}')::json, '3'),
	 (NULL,NULL,5,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_124_201230',concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'),concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,'11:02:40',concat(CURRENT_DATE,'T09:02:40Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Nemocnice Motol',NULL,1,NULL,31,NULL,concat(CURRENT_DATE,'T09:31:20Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'), '"}')::json, '3'),
	 (NULL,NULL,9,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,'L991','A','991_294_220901',concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'),concat(CURRENT_DATE,'T06:14:51Z')::timestamp,NULL,NULL,'10:04:35',concat(CURRENT_DATE,'T08:04:35Z')::timestamp,1,true,NULL,NULL,NULL,NULL,'DP PRAHA','991','DP PRAHA',NULL,'Skalka',NULL,1,NULL,32,NULL,concat(CURRENT_DATE,'T08:32:40Z')::timestamp,NULL,concat('{"atStopStreak":{"stop_sequence":null,"firstPositionTimestamp":null,"firstPositionDelay":null},"lastPositionLastStop":{"id":null,"sequence":null,"arrival_time":null,"departure_time":null},"lastPositionDelay":null,"lastPositionId":null,"lastPositionOriginTimestamp":null,"lastPositionTracking":null,"lastPositionCanceled":null,"lastPositionBeforeTrackDelayed":null,"lastPositionState":null,"tripId":"', concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'), '"}')::json, '3');

INSERT INTO vehiclepositions_positions (created_at,delay,delay_stop_arrival,delay_stop_departure,next_stop_id,shape_dist_traveled,is_canceled,lat,lng,origin_time,origin_timestamp,is_tracked,trips_id,create_batch_id,created_by,update_batch_id,updated_at,updated_by,id,bearing,cis_last_stop_id,cis_last_stop_sequence,last_stop_id,last_stop_sequence,next_stop_sequence,speed,last_stop_arrival_time,last_stop_departure_time,next_stop_arrival_time,next_stop_departure_time,asw_last_stop_id,state_process,state_position,this_stop_id,this_stop_sequence,tcp_event,last_stop_headsign,last_stop_name,next_stop_name,this_stop_name,valid_to) VALUES
	 (concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,NULL,NULL,'U306Z101P',0,NULL,50.09837,14.36282,'10:20:08',concat(CURRENT_DATE,'T08:20:08Z')::timestamptz,false,concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,26,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,concat(CURRENT_DATE,'T08:32:35Z')::timestamp,concat(CURRENT_DATE,'T08:32:35Z')::timestamp,NULL,'processed','before_track','U157Z102P',NULL,NULL,NULL,NULL,NULL,NULL,concat(CURRENT_DATE,'T09:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:32Z')::timestamp,0,NULL,NULL,'U462Z102P',13.284,NULL,50.09837,14.36282,'10:20:08',concat(CURRENT_DATE,'T08:20:08Z')::timestamptz,true,concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,25,263,NULL,NULL,'U157Z102P',14,15,NULL,concat(CURRENT_DATE,'T08:20:00Z')::timestamp,concat(CURRENT_DATE,'T08:20:20Z')::timestamp,concat(CURRENT_DATE,'T08:21:50Z')::timestamp,concat(CURRENT_DATE,'T08:22:10Z')::timestamp,NULL,'processed','at_stop','U157Z102P',14,NULL,NULL,'Bořislavka',NULL,NULL,concat(CURRENT_DATE,'T09:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,NULL,NULL,'U953Z102P',0,NULL,50.09837,14.36282,'10:20:08',concat(CURRENT_DATE,'T08:20:08Z')::timestamptz,false,concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,27,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,concat(CURRENT_DATE,'T09:02:40Z')::timestamp,concat(CURRENT_DATE,'T09:02:40Z')::timestamp,NULL,'processed','before_track','U157Z102P',NULL,NULL,NULL,NULL,NULL,NULL,concat(CURRENT_DATE,'T09:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:32Z')::timestamp,3,NULL,NULL,'U400Z101P',9.455,NULL,50.081053,14.429208,'10:20:08',concat(CURRENT_DATE,'T08:20:08Z')::timestamptz,true,concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:32Z')::timestamp,NULL,28,125,NULL,NULL,'U1072Z101P',9,10,NULL,concat(CURRENT_DATE,'T08:19:00Z')::timestamp,concat(CURRENT_DATE,'T08:19:30Z')::timestamp,concat(CURRENT_DATE,'T08:20:40Z')::timestamp,concat(CURRENT_DATE,'T08:21:10Z')::timestamp,NULL,'processed','on_track',NULL,NULL,NULL,NULL,'Můstek',NULL,NULL,concat(CURRENT_DATE,'T09:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:51Z')::timestamp,0,NULL,NULL,'U462Z102P',13.284,NULL,50.09837,14.36282,'10:20:13',concat(CURRENT_DATE,'T08:20:13Z')::timestamptz,true,concat(CURRENT_DATE,'T09:55:10+02:00_991_77_220901_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,29,263,NULL,NULL,'U157Z102P',14,15,NULL,concat(CURRENT_DATE,'T08:20:00Z')::timestamp,concat(CURRENT_DATE,'T08:20:20Z')::timestamp,concat(CURRENT_DATE,'T08:21:50Z')::timestamp,concat(CURRENT_DATE,'T08:22:10Z')::timestamp,NULL,'processed','at_stop','U157Z102P',14,NULL,NULL,'Bořislavka',NULL,NULL,concat(CURRENT_DATE,'T06:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,NULL,'U953Z102P',0,NULL,50.09837,14.36282,'10:20:13',concat(CURRENT_DATE,'T08:20:13Z')::timestamptz,false,concat(CURRENT_DATE,'T11:02:40+02:00_991_124_201230_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,31,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,concat(CURRENT_DATE,'T09:02:40Z')::timestamp,concat(CURRENT_DATE,'T09:02:40Z')::timestamp,NULL,'processed','before_track','U157Z102P',NULL,NULL,NULL,NULL,NULL,NULL,concat(CURRENT_DATE,'T06:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,NULL,NULL,'U306Z101P',0,NULL,50.09837,14.36282,'10:20:13',concat(CURRENT_DATE,'T08:20:13Z')::timestamptz,false,concat(CURRENT_DATE,'T10:32:35+02:00_991_78_220321_5_5'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,30,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,concat(CURRENT_DATE,'T08:32:35Z')::timestamp,concat(CURRENT_DATE,'T08:32:35Z')::timestamp,NULL,'processed','before_track','U157Z102P',NULL,NULL,NULL,NULL,NULL,NULL,concat(CURRENT_DATE,'T06:40:00Z')::timestamp),
	 (concat(CURRENT_DATE,'T09:14:51Z')::timestamp,-13,NULL,NULL,'U400Z101P',9.656,NULL,50.079954,14.43101,'10:20:13',concat(CURRENT_DATE,'T08:20:13Z')::timestamptz,true,concat(CURRENT_DATE,'T10:04:35+02:00_991_294_220901_9_9'),NULL,NULL,NULL,concat(CURRENT_DATE,'T09:14:51Z')::timestamp,NULL,32,139,NULL,NULL,'U1072Z101P',9,10,NULL,concat(CURRENT_DATE,'T08:19:00Z')::timestamptz,concat(CURRENT_DATE,'T08:19:30Z')::timestamptz,concat(CURRENT_DATE,'T08:20:40Z')::timestamptz,concat(CURRENT_DATE,'T08:21:10Z')::timestamptz,NULL,'processed','on_track',NULL,NULL,NULL,NULL,'Můstek',NULL,NULL,NULL);
