- Downgraded `aws-sdk-s3` to version 1.170 and updated `aws-sdk-core` to 3.211 to maintain compatibility with existing code. - Updated various column types in the database schema from `integer` to `bigint` to handle larger values and improve data integrity. - Modified the `sync_geo_data.rake` task to use `find_or_create_by` for `Country`, improving the logic for ensuring unique countries based on ISO code. These changes enhance dependency management and improve schema robustness while maintaining functionality.
254 lines
9.1 KiB
Ruby
Generated
254 lines
9.1 KiB
Ruby
Generated
# 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[8.0].define(version: 2025_02_08_052634) do
|
|
# These are extensions that must be enabled in order to support this database
|
|
enable_extension "pg_catalog.plpgsql"
|
|
|
|
create_table "active_admin_comments", force: :cascade do |t|
|
|
t.string "namespace"
|
|
t.text "body"
|
|
t.string "resource_type"
|
|
t.bigint "resource_id"
|
|
t.string "author_type"
|
|
t.bigint "author_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["author_type", "author_id"], name: "index_active_admin_comments_on_author"
|
|
t.index ["namespace"], name: "index_active_admin_comments_on_namespace"
|
|
t.index ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource"
|
|
end
|
|
|
|
create_table "active_storage_attachments", force: :cascade do |t|
|
|
t.string "name", null: false
|
|
t.string "record_type", null: false
|
|
t.bigint "record_id", null: false
|
|
t.bigint "blob_id", null: false
|
|
t.datetime "created_at", null: false
|
|
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
|
end
|
|
|
|
create_table "active_storage_blobs", force: :cascade do |t|
|
|
t.string "key", null: false
|
|
t.string "filename", null: false
|
|
t.string "content_type"
|
|
t.text "metadata"
|
|
t.string "service_name", null: false
|
|
t.bigint "byte_size", null: false
|
|
t.string "checksum"
|
|
t.datetime "created_at", null: false
|
|
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
|
end
|
|
|
|
create_table "active_storage_variant_records", force: :cascade do |t|
|
|
t.bigint "blob_id", null: false
|
|
t.string "variation_digest", null: false
|
|
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
|
end
|
|
|
|
create_table "admin_users", 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.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["email"], name: "index_admin_users_on_email", unique: true
|
|
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
|
|
end
|
|
|
|
create_table "ahoy_events", force: :cascade do |t|
|
|
t.bigint "visit_id"
|
|
t.bigint "user_id"
|
|
t.string "name"
|
|
t.text "properties"
|
|
t.datetime "time"
|
|
t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time"
|
|
t.index ["user_id"], name: "index_ahoy_events_on_user_id"
|
|
t.index ["visit_id"], name: "index_ahoy_events_on_visit_id"
|
|
end
|
|
|
|
create_table "ahoy_visits", force: :cascade do |t|
|
|
t.string "visit_token"
|
|
t.string "visitor_token"
|
|
t.bigint "user_id"
|
|
t.string "ip"
|
|
t.text "user_agent"
|
|
t.text "referrer"
|
|
t.string "referring_domain"
|
|
t.text "landing_page"
|
|
t.string "browser"
|
|
t.string "os"
|
|
t.string "device_type"
|
|
t.string "country"
|
|
t.string "region"
|
|
t.string "city"
|
|
t.float "latitude"
|
|
t.float "longitude"
|
|
t.string "utm_source"
|
|
t.string "utm_medium"
|
|
t.string "utm_term"
|
|
t.string "utm_content"
|
|
t.string "utm_campaign"
|
|
t.string "app_version"
|
|
t.string "os_version"
|
|
t.string "platform"
|
|
t.datetime "started_at"
|
|
t.index ["user_id"], name: "index_ahoy_visits_on_user_id"
|
|
t.index ["visit_token"], name: "index_ahoy_visits_on_visit_token", unique: true
|
|
t.index ["visitor_token", "started_at"], name: "index_ahoy_visits_on_visitor_token_and_started_at"
|
|
end
|
|
|
|
create_table "cities", force: :cascade do |t|
|
|
t.string "name"
|
|
t.float "latitude"
|
|
t.float "longitude"
|
|
t.boolean "active", default: false
|
|
t.integer "priority"
|
|
t.string "timezone"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.string "slug"
|
|
t.bigint "country_id", null: false
|
|
t.string "state_code"
|
|
t.string "country_code"
|
|
t.boolean "flag", default: true
|
|
t.string "wiki_data_id"
|
|
t.bigint "state_id"
|
|
t.index ["country_id"], name: "index_cities_on_country_id"
|
|
t.index ["slug"], name: "index_cities_on_slug", unique: true
|
|
t.index ["state_id"], name: "index_cities_on_state_id"
|
|
end
|
|
|
|
create_table "countries", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "code"
|
|
t.string "slug"
|
|
t.bigint "region_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.string "iso3"
|
|
t.string "numeric_code"
|
|
t.string "iso2"
|
|
t.string "phonecode"
|
|
t.string "capital"
|
|
t.string "currency"
|
|
t.string "currency_name"
|
|
t.string "currency_symbol"
|
|
t.string "tld"
|
|
t.string "native"
|
|
t.string "subregion"
|
|
t.string "nationality"
|
|
t.text "timezones"
|
|
t.text "translations"
|
|
t.decimal "latitude", precision: 10, scale: 8
|
|
t.decimal "longitude", precision: 11, scale: 8
|
|
t.string "emoji"
|
|
t.string "emoji_u"
|
|
t.boolean "flag", default: true
|
|
t.string "wiki_data_id"
|
|
t.bigint "subregion_id"
|
|
t.index ["code"], name: "index_countries_on_code", unique: true
|
|
t.index ["region_id"], name: "index_countries_on_region_id"
|
|
t.index ["slug"], name: "index_countries_on_slug", unique: true
|
|
t.index ["subregion_id"], name: "index_countries_on_subregion_id"
|
|
end
|
|
|
|
create_table "friendly_id_slugs", force: :cascade do |t|
|
|
t.string "slug", null: false
|
|
t.integer "sluggable_id", null: false
|
|
t.string "sluggable_type", limit: 50
|
|
t.string "scope"
|
|
t.datetime "created_at"
|
|
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
|
|
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
|
|
t.index ["sluggable_type", "sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_type_and_sluggable_id"
|
|
end
|
|
|
|
create_table "regions", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "code"
|
|
t.string "slug"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.text "translations"
|
|
t.boolean "flag", default: true
|
|
t.string "wiki_data_id"
|
|
t.index ["code"], name: "index_regions_on_code", unique: true
|
|
t.index ["slug"], name: "index_regions_on_slug", unique: true
|
|
end
|
|
|
|
create_table "states", force: :cascade do |t|
|
|
t.string "name"
|
|
t.string "code"
|
|
t.bigint "country_id"
|
|
t.string "country_code"
|
|
t.string "fips_code"
|
|
t.string "iso2"
|
|
t.string "state_type"
|
|
t.integer "level"
|
|
t.integer "parent_id"
|
|
t.decimal "latitude", precision: 10, scale: 8
|
|
t.decimal "longitude", precision: 11, scale: 8
|
|
t.boolean "flag"
|
|
t.string "wiki_data_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["country_id"], name: "index_states_on_country_id"
|
|
end
|
|
|
|
create_table "subregions", force: :cascade do |t|
|
|
t.string "name", null: false
|
|
t.text "translations"
|
|
t.bigint "region_id", null: false
|
|
t.boolean "flag", default: true
|
|
t.string "wiki_data_id"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.index ["region_id"], name: "index_subregions_on_region_id"
|
|
end
|
|
|
|
create_table "weather_arts", force: :cascade do |t|
|
|
t.bigint "city_id", null: false
|
|
t.date "weather_date"
|
|
t.string "description"
|
|
t.decimal "temperature"
|
|
t.decimal "feeling_temp"
|
|
t.decimal "humidity"
|
|
t.string "wind_scale"
|
|
t.decimal "wind_speed"
|
|
t.decimal "precipitation"
|
|
t.decimal "pressure"
|
|
t.decimal "visibility"
|
|
t.decimal "cloud"
|
|
t.text "prompt"
|
|
t.datetime "created_at", null: false
|
|
t.datetime "updated_at", null: false
|
|
t.string "slug"
|
|
t.index ["city_id", "weather_date"], name: "index_weather_arts_on_city_id_and_weather_date"
|
|
t.index ["city_id"], name: "index_weather_arts_on_city_id"
|
|
t.index ["slug"], name: "index_weather_arts_on_slug", unique: true
|
|
end
|
|
|
|
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
|
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
|
add_foreign_key "cities", "countries"
|
|
add_foreign_key "cities", "states"
|
|
add_foreign_key "countries", "regions"
|
|
add_foreign_key "countries", "subregions"
|
|
add_foreign_key "states", "countries"
|
|
add_foreign_key "subregions", "regions"
|
|
add_foreign_key "weather_arts", "cities"
|
|
end
|