select 'Initializes all tables if they do not exist' as 'message';

create table if not exists networkmonitor
(
        id integer not null unique,
        user_id varchar,
        timestamp integer,
        google_connection_test varchar,
        http_connection_test varchar,
        network_type varchar,
        mobile_data_network_type varchar,
        sim_state varchar,
        detailed_state varchar,
        is_connected integer,
        is_roaming integer,
        is_available integer,
        is_failover integer,
        data_activity varchar,
        data_state varchar,
        reason varchar,
        extra_info varchar,
        wifi_ssid varchar,
        wifi_bssid varchar,
        wifi_frequency integer,
        wifi_channel integer,
        wifi_signal_strength integer,
        wifi_rssi integer,
        sim_operator varchar,
        sim_mcc varchar,
        sim_mnc varchar,
        network_operator varchar,
        network_mcc varchar,
        network_mnc varchar,
        is_network_metered integer,
        device_latitude REAL,
        device_longitude REAL,
        device_position_accuracy REAL,
        cell_signal_strength integer,
        cell_signal_strength_dbm integer,
        cell_asu_level integer,
        gsm_ber integer,
        lte_rsrq integer,
        cdma_cell_base_station_id integer,
        cdma_cell_latitude integer,
        cdma_cell_longitude integer,
        cdma_cell_network_id integer,
        cdma_cell_system_id integer,
        gsm_full_cell_id integer,
        gsm_rnc integer,
        gsm_short_cell_id integer,
        gsm_cell_lac integer,
        gsm_cell_psc integer,
        network_interface varchar,
        ipv4_address varchar,
        ipv6_address varchar,
        battery_level integer,
        download_speed varchar,
        upload_speed varchar, 
        constraint pk_networkmonitor primary key(id)
);
