# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2025_03_01_095356) do

  create_table "access_control_list_layer_nines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "policy"
    t.string "protocol"
    t.string "src_ip"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "acl_group_id"
    t.string "policy_ly7"
    t.string "src_domainly7"
    t.string "src_bitmaskly7"
    t.string "application"
    t.string "host_iprange"
    t.string "port"
    t.string "application_value"
    t.string "src_uplink_type"
    t.string "src_uplink_typely7"
    t.string "src_iply7"
  end

  create_table "access_control_lists", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "policy"
    t.string "protocol"
    t.string "src_ip"
    t.string "scr_bitmask"
    t.string "src_port"
    t.integer "acl_group_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "dst_ip"
    t.string "dst_bitmask"
    t.string "dst_port"
    t.string "src_uplink_type", default: "All"
    t.string "dst_uplink_type", default: "All"
    t.string "policy_ly7"
    t.string "application"
    t.string "host_iprange"
    t.string "port"
    t.string "form_type"
    t.string "application_value"
    t.string "src_domainly7"
    t.string "src_bitmaskly7"
    t.string "form_type2"
    t.boolean "is_enabled"
    t.boolean "log"
    t.integer "priority"
    t.string "src_mac"
  end

  create_table "acl_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "group_name"
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.integer "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "tagging_lists"
    t.string "logging"
    t.integer "clone_id"
  end

  create_table "acl_inventories", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "acl_group_id"
    t.integer "router_inventory_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "activities", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "trackable_type"
    t.bigint "trackable_id"
    t.string "owner_type"
    t.bigint "owner_id"
    t.string "key"
    t.text "parameters"
    t.string "recipient_type"
    t.bigint "recipient_id"
    t.integer "organisation_id"
    t.integer "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "assumed_by"
    t.integer "router_inventory_id"
    t.index ["organisation_id", "created_at"], name: "index_activities_on_organisation_id_and_created_at"
    t.index ["owner_id", "owner_type"], name: "index_activities_on_owner_id_and_owner_type"
    t.index ["owner_type", "owner_id"], name: "index_activities_on_owner_type_and_owner_id"
    t.index ["recipient_type", "recipient_id"], name: "index_activities_on_recipient_type_and_recipient_id"
    t.index ["trackable_id", "trackable_type"], name: "index_activities_on_trackable_id_and_trackable_type"
    t.index ["trackable_type", "trackable_id"], name: "index_activities_on_trackable_type_and_trackable_id"
  end

  create_table "air_quality_configs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "organisation_id"
    t.boolean "is_enabled"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "alert_rules", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "alert_on"
    t.string "condition"
    t.string "value"
    t.integer "alert_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "clone_id"
  end

  create_table "alerts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.text "message"
    t.string "category"
    t.string "severity_color"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "location_network_id"
    t.text "actions"
    t.string "subject"
    t.integer "clone_id"
  end

  create_table "alerts_notification_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "alert_id"
    t.integer "notification_group_id"
  end

  create_table "ap_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.text "vendor_details"
    t.string "vendor_id"
    t.integer "location_network_id"
    t.integer "wlan_group_id"
  end

  create_table "ap_metadata", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "project_name"
    t.string "location_name"
    t.text "notes"
    t.integer "router_inventory_id"
    t.string "latitude"
    t.string "longitude"
    t.text "scanned_data"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "assume_user_details", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "token"
    t.integer "assume_user_id"
    t.integer "token_validity"
    t.boolean "status", default: true
    t.bigint "user_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["user_id"], name: "index_assume_user_details_on_user_id"
  end

  create_table "client_communications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "source_interface"
    t.string "destination_interface"
    t.string "policy"
    t.integer "firewall_config_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "priority"
    t.integer "unidir", default: 0
  end

  create_table "commands", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.text "aps"
    t.string "commands"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "status"
    t.text "result"
  end

  create_table "commands_router_inventories", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "command_id"
    t.integer "router_inventory_id"
    t.index ["command_id", "router_inventory_id"], name: "commands_router_inventories_c_id_ri_id"
    t.index ["command_id"], name: "index_commands_router_inventories_on_command_id"
    t.index ["router_inventory_id"], name: "commands_router_inventories_ri_id"
  end

  create_table "config_mappings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "configurable_type"
    t.bigint "configurable_id"
    t.string "resourceable_type"
    t.bigint "resourceable_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["configurable_id", "configurable_type"], name: "index_config_mappings_on_configurable_id_and_configurable_type"
    t.index ["configurable_type", "configurable_id"], name: "index_config_mappings_on_configurable_type_and_configurable_id"
    t.index ["resourceable_id", "resourceable_type"], name: "index_config_mappings_on_resourceable_id_and_resourceable_type"
    t.index ["resourceable_type", "resourceable_id"], name: "index_config_mappings_on_resourceable_type_and_resourceable_id"
  end

  create_table "customer_credit_cards", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "card_number"
    t.integer "exp_date"
    t.integer "exp_month"
    t.integer "cvv"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "del_data_fm_monitorings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "firewall_configs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "firewall_rules", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "gateway_configs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "organisation_id"
    t.string "gateway_type"
    t.string "gateway"
    t.string "config_hash"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.boolean "is_enabled"
  end

  create_table "hardware_categories", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "label"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "hardware_parts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "part_number"
    t.string "internal_name"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.boolean "wifi_uplink", default: false
    t.boolean "usb", default: false
    t.integer "wired_count", default: 1
    t.integer "port_count"
    t.string "vendor_type"
    t.string "hardware_category"
    t.integer "hardware_category_id"
  end

  create_table "hotspot20s", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.boolean "hotspot_2_0", default: false
    t.string "operator_name"
    t.string "venue_name"
    t.string "venue_operator_language_code"
    t.text "venue_type"
    t.string "network_type"
    t.boolean "internet", default: false
    t.text "domain_list"
    t.text "roaming_consortium_oi"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "network_ssid_id"
  end

  create_table "init_templates", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "organisation_id"
    t.integer "user_id"
    t.string "name"
    t.string "template_type"
    t.text "details"
    t.string "ap_mac_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.boolean "is_default", default: false
  end

  create_table "integration_types", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "api_key"
    t.integer "organisation_id"
    t.string "org_id"
    t.string "vendor_name"
    t.text "details", size: :long
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "level"
    t.string "name"
  end

  create_table "location_networks", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "network_name"
    t.string "network_type"
    t.string "network_configuration"
    t.integer "cloned_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "organisation_id"
    t.string "timezone"
    t.boolean "aggregation_flag"
    t.integer "hb_freq", default: 5
    t.boolean "presence", default: false
    t.text "presence_url", size: :long
    t.string "vendor_network_id"
    t.string "vendor_type"
    t.text "vendor_details"
    t.integer "integration_type_id"
    t.string "heartbeat_url"
    t.boolean "network_template", default: false
    t.boolean "template_adherence", default: true
    t.boolean "enable_policy"
  end

  create_table "loggings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "logging_type"
    t.string "is_enabled"
    t.string "upload_type"
    t.integer "location_network_id"
    t.string "extra_data"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "clone_id"
    t.index ["location_network_id"], name: "index_loggings_on_location_network_id"
  end

  create_table "master_router_inventories", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "mac_id"
    t.bigint "hardware_part_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "wan_mac_address"
    t.string "serial"
    t.integer "integration_type_id"
    t.index ["hardware_part_id"], name: "index_master_router_inventories_on_hardware_part_id"
  end

  create_table "media", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "attachable_type"
    t.bigint "attachable_id"
    t.string "media_file_name"
    t.string "media_content_type"
    t.bigint "media_file_size"
    t.datetime "media_updated_at"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["attachable_type", "attachable_id"], name: "index_media_on_attachable_type_and_attachable_id"
  end

  create_table "monitoring_data", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "nai_realms", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "realm_name"
    t.string "realm_format"
    t.string "authentication"
    t.text "gpp_plmn_id"
    t.integer "hotspot20_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "network_ssids", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "ssid_name"
    t.string "ssid_mode"
    t.string "nat"
    t.boolean "is_enabled"
    t.boolean "is_hidden"
    t.boolean "is_isolate"
    t.string "security_mode"
    t.string "wpa_algorithm"
    t.string "key_renewal_interval"
    t.string "wpa_key"
    t.integer "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "acl_mac"
    t.string "mac_filter_policy"
    t.text "acl_mac_list"
    t.integer "vlan_id"
    t.string "captive_portal"
    t.text "splash_url"
    t.string "wallgarden"
    t.text "walled_garden_range"
    t.string "overwrite_success_url"
    t.text "success_url"
    t.string "dhcp_range_start"
    t.string "dhcp_range_end"
    t.string "dhcp_relay_server"
    t.string "dhcp_lease_time"
    t.string "auth_radius_id"
    t.string "acc_radius_id"
    t.string "acc_radius_enabled"
    t.string "ip_address"
    t.string "subnet_mask"
    t.string "ssid_qos"
    t.boolean "enable_ssid_qos"
    t.string "per_user_qos"
    t.string "radio_band", default: "2.4"
    t.integer "max_association", default: 0
    t.boolean "wds_enabled", default: false
    t.string "dns_mode", default: "1"
    t.string "dns_primary"
    t.string "dns_secondary"
    t.string "wna", default: "1"
    t.text "dhcp_mappings", size: :long
    t.string "default_interim_time", default: "300"
    t.string "default_idle_timeout", default: "1800"
    t.string "uplink_priority", default: "1"
    t.string "dhcp_ranges"
    t.string "psk_type"
    t.integer "mac_auth", default: 0
    t.text "dhcp_options", size: :long
    t.boolean "power_save", default: false
    t.boolean "band_steering", default: false
    t.string "roaming_mode", default: "0"
    t.string "hotspot_mode", default: "0"
    t.json "radio_bands"
    t.text "vendor_details"
    t.boolean "ssid_802_11_k", default: false
    t.string "ssid_802_11_w"
    t.string "multi_psk", default: "local"
    t.text "multi_psk_options", size: :long
    t.boolean "uam_secret", default: false
    t.string "uam_secret_key"
    t.boolean "radius_gw_proxy", default: false
    t.integer "clone_id"
    t.index ["location_network_id"], name: "index_network_ssids_on_location_network_id"
  end

  create_table "network_ssids_wlan_groups", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.bigint "network_ssid_id"
    t.bigint "wlan_group_id"
    t.index ["network_ssid_id"], name: "index_network_ssids_wlan_groups_on_network_ssid_id"
    t.index ["wlan_group_id"], name: "index_network_ssids_wlan_groups_on_wlan_group_id"
  end

  create_table "notification_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "notification_type"
    t.string "mobile"
    t.string "email"
    t.integer "organisation_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "clone_id"
  end

  create_table "ntp_servers", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.boolean "is_enabled"
    t.text "urls"
    t.integer "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "organisations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "organisation_name"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "no_of_aps", default: 200
    t.text "sms_config"
    t.string "organisation_logo_file_name"
    t.string "organisation_logo_content_type"
    t.bigint "organisation_logo_file_size"
    t.datetime "organisation_logo_updated_at"
    t.string "organisation_domain"
    t.string "organisation_support_email"
    t.boolean "branding", default: false
    t.string "header_bg_color"
    t.string "sidebar_bg_color"
    t.string "footer_bg_color"
    t.string "live_domain"
    t.string "footer_font_bg_color"
    t.string "heartbeat_url"
    t.text "organisation_settings", size: :long
  end

  create_table "payment_invoices", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "payment_status", default: "new"
    t.datetime "invoiced_on"
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.string "invoice_number"
    t.string "stripeToken"
    t.integer "purchase_order_id"
    t.string "amount"
    t.string "transcation_id"
    t.string "failure_message"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "ordered_by"
    t.string "customer_id"
    t.string "customer_email"
  end

  create_table "pf_inventories", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "portforwarding_group_id"
    t.integer "router_inventory_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "port_forwardings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "rule_name"
    t.string "protocol"
    t.string "external_port"
    t.string "ip_address"
    t.string "internal_port"
    t.integer "portforwarding_group_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "portforwarding_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "group_name"
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.integer "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "tagging_lists"
  end

  create_table "purchase_order_items", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "purchase_order_id"
    t.integer "itemable_id"
    t.string "itemable_type"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "purchase_orders", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "payment_status", default: "new"
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.integer "sim_rate_plan_id"
    t.string "mac_id"
    t.string "amount"
    t.string "imei"
    t.string "plan_description"
    t.boolean "auto_recharge"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "ordered_by"
  end

  create_table "radio_managements", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.boolean "client_steering"
    t.boolean "assoc_steering"
    t.boolean "auto_channel_balancing"
    t.integer "required_probe_snr"
    t.integer "required_roam_snr"
    t.integer "load_kick_threshold"
    t.integer "radio_profile_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "radio_profiles", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "country_code"
    t.bigint "organisation_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "location_network_id"
    t.string "vendor_network_id"
    t.text "vendor_details"
    t.integer "clone_id"
    t.index ["organisation_id"], name: "index_radio_profiles_on_organisation_id"
  end

  create_table "radio_settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "band"
    t.integer "channel"
    t.integer "power"
    t.integer "radio_profile_id"
    t.boolean "is_disable", default: false
    t.boolean "country_ie", default: true
    t.string "require_mode"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "bandwidth"
    t.boolean "channel_utlilization"
    t.integer "maximum_clients"
    t.string "multiple_bssid"
    t.string "beacon_rate"
    t.integer "beacon_interval"
    t.integer "dtim_period"
    t.string "multicast"
    t.string "ema"
    t.integer "bss_color"
    t.text "vendor_details"
    t.text "valid_auto_channel", size: :long
  end

  create_table "radius", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "radius_accountings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "radius_configurations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "radius_name"
    t.string "radius_ip"
    t.string "radius_port"
    t.string "radius_secret"
    t.string "type"
    t.integer "organisation_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "vendor_details"
    t.integer "clone_id"
  end

  create_table "reports", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "title"
    t.datetime "from_time"
    t.datetime "to_time"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "location_network_id"
    t.integer "flag"
    t.string "path"
    t.integer "scheduled_report_id"
    t.string "download_type"
    t.index ["location_network_id"], name: "index_reports_on_location_network_id"
  end

  create_table "roamings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "message_exchange"
    t.string "domain_identifier"
    t.string "pmk_r1_type"
    t.string "pmk_r0_type"
    t.string "pmk_r1_key_holder"
    t.boolean "generate_psk", default: false
    t.string "pmk_r0_key_holder"
    t.integer "network_ssid_id"
    t.integer "organisation_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "roles", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "resource_type"
    t.bigint "resource_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
    t.index ["name"], name: "index_roles_on_name"
    t.index ["resource_type", "resource_id"], name: "index_roles_on_resource_type_and_resource_id"
  end

  create_table "router_inventories", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "mac_id"
    t.string "router_serial_number"
    t.integer "location_network_id"
    t.integer "user_id"
    t.integer "organisation_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "name"
    t.text "notes"
    t.text "address"
    t.string "gre"
    t.string "dhcp_relay"
    t.string "ip_type"
    t.string "ip"
    t.string "subnet_mask"
    t.string "gateway"
    t.string "primary_dns"
    t.string "secondary_dns"
    t.string "channel"
    t.string "enable_gre_on_lan"
    t.string "enable_dhcp_on_lan"
    t.integer "snmp_config_id"
    t.string "power"
    t.string "dhcp_start_range"
    t.string "dhcp_end_range"
    t.string "city"
    t.string "country"
    t.string "zipcode"
    t.string "latitude"
    t.string "longitude"
    t.string "region_name"
    t.boolean "presence", default: false
    t.string "wl_association"
    t.string "wl_wpa_key"
    t.string "wl_band"
    t.string "wl_ssid_name"
    t.boolean "wds_enabled", default: false
    t.string "uplink_type", default: "1"
    t.integer "wl_ssid_uniqe_id"
    t.integer "hardware_part_id"
    t.string "state"
    t.string "address2"
    t.string "mo_service"
    t.string "mo_apn"
    t.string "mo_device"
    t.string "mo_username"
    t.string "mo_password"
    t.boolean "enable_lb", default: false
    t.integer "retry_count", default: 5
    t.integer "retry_interval", default: 10
    t.string "retry_ip1"
    t.string "retry_ip2"
    t.string "sim_iccid"
    t.string "sim_imei"
    t.text "presence_url"
    t.string "kernal_version"
    t.boolean "is_auto_provisioned", default: false
    t.boolean "enable_pci", default: false
    t.string "ttl", default: "0"
    t.string "operator"
    t.string "operator_band"
    t.string "serial"
    t.string "model"
    t.text "vendor_details"
    t.integer "ap_group_id"
    t.string "vendor_type", default: "pronto"
    t.index ["location_network_id"], name: "index_router_inventories_on_location_network_id"
    t.index ["mac_id"], name: "index_router_inventories_on_mac_id"
  end

  create_table "scheduled_reports", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "title"
    t.datetime "from_time"
    t.datetime "to_time"
    t.integer "location_network_id"
    t.string "scheduled_on"
    t.datetime "last_generated"
    t.string "flag"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "scheduled_reports_notification_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "scheduled_report_id"
    t.integer "notification_group_id"
  end

  create_table "sessions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "email"
    t.datetime "logged_in_time"
    t.datetime "last_active_at"
    t.bigint "assume_user_detail_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["assume_user_detail_id"], name: "index_sessions_on_assume_user_detail_id"
  end

  create_table "sim_managements", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "mac_id"
    t.string "plan_type"
    t.string "iccid"
    t.string "imei"
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.integer "rate_plan_id"
    t.integer "sim_rate_plan_id"
    t.string "activated_on"
    t.string "is_active", default: "false"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "data_limit"
    t.string "sid"
    t.boolean "auto_recharge"
    t.string "current_status"
  end

  create_table "sim_payments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "stripeToken"
    t.string "amount"
    t.string "invoice_number"
    t.integer "organisation_id"
    t.integer "sim_management_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "sim_rate_plans", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "plan_description"
    t.string "amount"
    t.string "plan_id"
    t.string "plan_type"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "data_plan"
  end

  create_table "snmp_configs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "router_inventory_id"
    t.integer "location_network_id"
    t.integer "organisation_id"
    t.string "server_ip"
    t.string "server_port"
    t.string "server_community"
    t.string "ro_community"
    t.string "rw_community"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "tagging_lists"
  end

  create_table "sqms", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.boolean "is_enabled"
    t.string "uplink"
    t.integer "download_speed"
    t.integer "upload_speed"
    t.string "queuing_disciplines"
    t.string "queue_setup_script"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "organisation_id"
    t.text "tagging_lists"
  end

  create_table "static_routes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "routing_name"
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.integer "location_network_id"
    t.string "tagging_lists"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "static_routing_lists", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "network"
    t.string "bitmask"
    t.string "gateway"
    t.integer "static_route_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
  end

  create_table "switch_configurations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "organisation_id"
    t.integer "location_network_id"
    t.string "switch_model"
    t.integer "hardware_part_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "sw_mac_oui", size: :long
    t.integer "clone_id"
  end

  create_table "switch_port_configurations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "port_number"
    t.string "name"
    t.boolean "port_status"
    t.string "link_negotiation"
    t.integer "speed"
    t.integer "power"
    t.boolean "poe"
    t.string "vlan"
    t.boolean "port_isolation"
    t.integer "switch_configuration_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "native_vlan", default: 1
    t.boolean "rstp", default: false
    t.string "port_type"
    t.boolean "acl_mac", default: false
    t.string "mac_filter_policy"
    t.text "acl_mac_list"
    t.integer "clone_id"
    t.index ["switch_configuration_id"], name: "index_switch_port_configurations_on_switch_configuration_id"
  end

  create_table "taggings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.bigint "tag_id"
    t.string "taggable_type"
    t.bigint "taggable_id"
    t.string "tagger_type"
    t.bigint "tagger_id"
    t.string "context", limit: 128
    t.datetime "created_at"
    t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
    t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id"
    t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id"
  end

  create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.integer "taggings_count", default: 0
    t.index ["name"], name: "index_tags_on_name", unique: true
  end

  create_table "template_policies", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.text "unlock_controls", size: :long
    t.boolean "disable_unlock_controls", default: false
    t.bigint "location_network_id", null: false
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.index ["location_network_id"], name: "index_template_policies_on_location_network_id"
  end

  create_table "unities", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "role_id"
    t.integer "user_id"
    t.integer "location_network_id"
    t.string "current_network"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "permission"
    t.string "locatable_type"
    t.bigint "locatable_id"
    t.index ["locatable_type", "locatable_id"], name: "index_unities_on_locatable_type_and_locatable_id"
    t.index ["location_network_id"], name: "index_unities_on_location_network_id"
    t.index ["user_id"], name: "index_unities_on_user_id"
  end

  create_table "upgrade_data", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "version"
    t.text "url", size: :long
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "upload_time", size: :long
    t.boolean "is_released", default: false
    t.integer "organisation_id"
  end

  create_table "upgrades", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "version"
    t.text "aps"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "organisation_id"
    t.integer "router_inventory_id"
    t.string "status"
    t.string "upgrade_type"
    t.string "schedule_type"
    t.datetime "schedule_at"
    t.string "time_zone"
    t.string "worker_job_id"
    t.boolean "save_prev_config", default: true
    t.index ["router_inventory_id"], name: "index_upgrades_on_router_inventory_id"
  end

  create_table "uplinks", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "router_inventory_id"
    t.string "wl_association"
    t.boolean "wds_enabled", default: false
    t.string "wl_wpa_key"
    t.string "wl_band"
    t.string "wl_ssid_name"
    t.integer "wl_ssid_uniqe_id"
    t.string "mo_service"
    t.string "mo_apn"
    t.string "mo_device"
    t.string "mo_username"
    t.string "mo_password"
    t.string "ip_type"
    t.string "ip"
    t.string "subnet_mask"
    t.string "gateway"
    t.string "uplink_type", default: "1"
    t.string "primary_dns"
    t.string "secondary_dns"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "load_balance_percentage", default: 0
    t.boolean "is_primary", default: false
    t.string "uplink_name"
    t.string "mo_proto_key"
    t.boolean "mo_is_advanced", default: false
    t.string "pppoe_username"
    t.string "pppoe_password"
    t.string "dns_mode", default: "1"
    t.boolean "is_deleted", default: false
    t.string "last_mobile_status"
    t.string "last_seen_ip"
    t.integer "hb_type", default: 1
    t.integer "hb_interval", default: 5
    t.string "uplink_module", default: "1"
    t.string "ttl", default: "0"
    t.string "operator"
    t.text "operator_band"
    t.string "nt"
    t.string "mm"
    t.string "cid"
    t.string "lac"
    t.string "lat"
    t.string "lng"
    t.string "default_lbc"
    t.string "eid"
    t.string "imsi"
    t.text "mwan3_cfg"
    t.index ["is_deleted", "router_inventory_id"], name: "index_uplinks_on_is_deleted_and_router_inventory_id"
  end

  create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "email", default: "", null: false
    t.string "encrypted_password", default: "", null: false
    t.string "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer "sign_in_count", default: 0, null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string "current_sign_in_ip"
    t.string "last_sign_in_ip"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "full_name"
    t.string "phone_number"
    t.string "company_name"
    t.string "is_admin"
    t.integer "organisation_id"
    t.string "organisation_access"
    t.string "confirmation_token"
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
    t.string "unconfirmed_email"
    t.integer "role_id"
    t.boolean "approved", default: false, null: false
    t.boolean "is_super_admin", default: false
    t.string "access_token"
    t.string "network_tags"
    t.text "claimed_devices", size: :long
    t.string "user_type"
    t.index ["approved"], name: "index_users_on_approved"
    t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
    t.index ["email"], name: "index_users_on_email", unique: true
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  end

  create_table "users_notification_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "user_id"
    t.integer "notification_group_id"
  end

  create_table "users_roles", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.bigint "user_id"
    t.bigint "role_id"
    t.index ["role_id"], name: "index_users_roles_on_role_id"
    t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
    t.index ["user_id"], name: "index_users_roles_on_user_id"
  end

  create_table "v_lans", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "organisation_id"
    t.integer "network_ssid_id"
    t.string "v_lan_id"
    t.string "ip_type"
    t.string "ip_address"
    t.string "net_mask"
    t.string "dhcp_start_range"
    t.string "dhcp_end_range"
    t.string "dns1"
    t.string "dns2"
    t.string "gateway"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "enable_gre_on_v_lan"
    t.string "enable_dhcp_on_v_lan"
    t.string "name"
    t.string "dns_mode"
    t.string "dhcp_relay_server"
    t.text "dhcp_mappings", size: :long
    t.text "dhcp_ranges", size: :long
    t.string "dhcp_lease_time"
    t.string "nat", default: "1"
    t.string "wna", default: "1"
    t.string "captive_portal"
    t.text "splash_url"
    t.string "wallgarden"
    t.text "walled_garden_range"
    t.string "overwrite_success_url", default: "false"
    t.text "success_url"
    t.string "auth_radius_id"
    t.string "acc_radius_id"
    t.string "acc_radius_enabled"
    t.string "per_user_qos"
    t.string "default_interim_time", default: "300"
    t.string "default_idle_timeout", default: "1800"
    t.integer "location_network_id"
    t.boolean "active_scan", default: false
    t.integer "mac_auth", default: 0
    t.string "uplink_priority", default: "1"
    t.text "dhcp_options", size: :long
    t.string "uam_secret_key"
    t.boolean "uam_secret", default: false
    t.string "qos_bw", default: "0"
    t.boolean "enable_vlan_qos", default: false
    t.string "vlan_qos"
    t.integer "clone_id"
    t.index ["network_ssid_id"], name: "index_v_lans_on_network_ssid_id"
  end

  create_table "vpn_configs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "ike_time"
    t.string "l_subnet"
    t.string "remote_ip"
    t.string "remote_nw_ip"
    t.string "remote_nw_subnet"
    t.string "pre_shared_key"
    t.string "ike"
    t.string "esp"
    t.string "is_enabled"
    t.integer "location_network_id"
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.boolean "is_server", default: true
    t.boolean "enable_server_client", default: false
    t.string "tunnel_connection"
    t.string "pass_through"
    t.boolean "enable_gateway"
    t.string "gateway_ip"
    t.boolean "enable_nat"
    t.string "vpn_name"
    t.string "protocol"
    t.string "private_key"
    t.string "public_key"
    t.string "address"
    t.string "dns_servers"
    t.string "peer_public_key"
    t.string "peer_pre_shared_key"
    t.string "end_point"
    t.text "allowed_ips", size: :long
    t.string "local_ip"
    t.string "local_port"
    t.string "wireguard"
    t.string "listener_port"
    t.string "mtu"
    t.text "server_peer", size: :long
    t.boolean "wireguard_enable_gateway"
    t.string "wireguard_gateway_ip"
    t.boolean "wireguard_enable_nat"
    t.string "psk"
    t.string "end_point_ip"
    t.string "end_point_port"
    t.string "wireguard_passthrough"
    t.text "server_p_allowed_ips", size: :long
  end

  create_table "webhook_endpoints", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "url", null: false
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.integer "notification_group_id"
    t.string "name"
    t.boolean "enabled", default: true
    t.string "shared_key"
  end

  create_table "webhook_events", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "webhook_endpoint_id", null: false
    t.string "event", null: false
    t.text "payload", null: false
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.text "response", size: :long
    t.integer "location_network_id"
    t.integer "organisation_id"
    t.boolean "is_test", default: false
    t.index ["webhook_endpoint_id"], name: "index_webhook_events_on_webhook_endpoint_id"
  end

  create_table "wired_configs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.string "mode", default: "0"
    t.string "nat", default: "1"
    t.boolean "is_enabled", default: true
    t.integer "location_network_id"
    t.string "acl_mac"
    t.string "mac_filter_policy"
    t.text "acl_mac_list"
    t.string "captive_portal"
    t.text "splash_url"
    t.string "wallgarden"
    t.text "walled_garden_range"
    t.string "overwrite_success_url", default: "false"
    t.text "success_url"
    t.string "dhcp_range_start"
    t.string "dhcp_range_end"
    t.string "dhcp_relay_server"
    t.string "dhcp_lease_time"
    t.string "auth_radius_id"
    t.string "acc_radius_id"
    t.string "acc_radius_enabled"
    t.string "ip_address"
    t.string "subnet_mask"
    t.string "ssid_qos"
    t.boolean "enable_ssid_qos"
    t.string "per_user_qos"
    t.integer "max_association", default: 0
    t.datetime "created_at", precision: 6, null: false
    t.datetime "updated_at", precision: 6, null: false
    t.string "dns_mode", default: "1"
    t.string "dns_primary"
    t.string "dns_secondary"
    t.string "wna", default: "0"
    t.text "dhcp_mappings", size: :long
    t.string "default_interim_time", default: "300"
    t.string "default_idle_timeout", default: "1800"
    t.text "port_configs", size: :long
    t.string "custom_port"
    t.string "enabled", default: "1"
    t.string "dhcp_ranges"
    t.integer "clone_id"
    t.index ["location_network_id"], name: "index_wired_configs_on_location_network_id"
  end

  create_table "wired_configs_v_lans", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.integer "wired_config_id"
    t.integer "v_lan_id"
  end

  create_table "wlan_groups", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.text "vendor_details"
    t.string "vendor_id"
    t.integer "location_network_id"
  end

  add_foreign_key "template_policies", "location_networks"
end
