INSERT INTO handa_db.bulletin_recipient(id, bulletin_id, contact_id, status, created_at, updated_at)
SELECT * FROM db_handa.h_bulletin_recipients;

INSERT INTO handa_db.bulletins(id, bulletin_type_id, message, is_auto, created_at, updated_at)
SELECT * FROM db_handa.h_bulletins;

UPDATE db_handa.h_contacts SET updated_at = created_at WHERE updated_at < '0000-01-01 00:00:00';
INSERT INTO handa_db.contacts(id, full_name, number, is_active, created_at, updated_at)
SELECT c_id as id, CONCAT(c_fname," ",c_mname," ",c_lname) as full_name, c_number as number, is_active, created_at, updated_at FROM db_handa.h_contacts;

INSERT INTO handa_db.contact_groups(id, contact_id, group_id, created_at)
SELECT * FROM db_handa.h_contact_groups;

INSERT INTO handa_db.sensors(id, address, latitude, longitude, elevation, device_type, device_id, is_active, created_at, updated_at)
SELECT ss_id as id, ss_address as address, ss_latitude as latitude, ss_longitude as longitude, ss_elevation as elevation, ss_type as device_type, dev_id as device_id, is_active, created_at, updated_at FROM db_handa.h_sensors;

INSERT INTO handa_db.inbox(id, mobile_number, message, status, is_read, created_at, updated_at)
SELECT sl_id as id, sl_number as mobile_number, sl_message as message, sl_status as status, is_read, created_at, updated_at FROM db_handa.h_sms_logs;

-- INSERT INTO handa_db.sensor_data(id, sensor_id, date, rain_value, rain_intensity, rain_duration, air_temperature, air_pressure, wind_speed, wind_direction, air_humidity, waterlevel)
-- SELECT * FROM db_handa.h_data;