l4d.tools/db/schema.rb
2026-01-18 17:42:32 +01:00

113 lines
5 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.1].define(version: 2026_01_18_162630) do
create_table "activities", force: :cascade do |t|
t.string "action", null: false
t.datetime "created_at", null: false
t.text "details"
t.integer "resource_id"
t.string "resource_type", null: false
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["user_id", "created_at"], name: "index_activities_on_user_id_and_created_at"
t.index ["user_id"], name: "index_activities_on_user_id"
end
create_table "config_options", force: :cascade do |t|
t.string "config_key", null: false
t.string "config_value", null: false
t.datetime "created_at", null: false
t.integer "server_template_id", null: false
t.datetime "updated_at", null: false
t.index ["server_template_id", "config_key"], name: "index_config_options_on_server_template_id_and_config_key", unique: true
t.index ["server_template_id"], name: "index_config_options_on_server_template_id"
end
create_table "overlays", force: :cascade do |t|
t.datetime "created_at", null: false
t.text "description"
t.string "name", null: false
t.string "overlay_type", default: "system", null: false
t.string "path", null: false
t.datetime "updated_at", null: false
t.integer "user_id"
t.index ["user_id", "name"], name: "index_overlays_on_user_id_and_name", unique: true
t.index ["user_id"], name: "index_overlays_on_user_id"
end
create_table "server_templates", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "name", null: false
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["user_id", "name"], name: "index_server_templates_on_user_id_and_name", unique: true
t.index ["user_id"], name: "index_server_templates_on_user_id"
end
create_table "servers", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "last_health_check_at"
t.string "name", null: false
t.integer "port", null: false
t.string "rcon_password"
t.integer "server_template_id", null: false
t.integer "status", default: 0, null: false
t.string "unit_file_path"
t.datetime "updated_at", null: false
t.integer "user_id", null: false
t.index ["port"], name: "index_servers_on_port", unique: true
t.index ["server_template_id"], name: "index_servers_on_server_template_id"
t.index ["user_id", "name"], name: "index_servers_on_user_id_and_name", unique: true
t.index ["user_id"], name: "index_servers_on_user_id"
end
create_table "startup_params", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "param_key", null: false
t.string "param_value", null: false
t.integer "server_template_id", null: false
t.datetime "updated_at", null: false
t.index ["server_template_id", "param_key"], name: "index_startup_params_on_server_template_id_and_param_key", unique: true
t.index ["server_template_id"], name: "index_startup_params_on_server_template_id"
end
create_table "template_overlays", force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "overlay_id", null: false
t.integer "position", null: false
t.integer "server_template_id", null: false
t.datetime "updated_at", null: false
t.index ["overlay_id"], name: "index_template_overlays_on_overlay_id"
t.index ["server_template_id", "overlay_id"], name: "index_template_overlays_unique", unique: true
t.index ["server_template_id", "position"], name: "index_template_overlays_position", unique: true
t.index ["server_template_id"], name: "index_template_overlays_on_server_template_id"
end
create_table "users", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "steam_id", null: false
t.string "steam_username", null: false
t.datetime "updated_at", null: false
t.index ["steam_id"], name: "index_users_on_steam_id", unique: true
end
add_foreign_key "activities", "users"
add_foreign_key "config_options", "server_templates"
add_foreign_key "overlays", "users"
add_foreign_key "server_templates", "users"
add_foreign_key "servers", "server_templates"
add_foreign_key "servers", "users"
add_foreign_key "startup_params", "server_templates"
add_foreign_key "template_overlays", "overlays"
add_foreign_key "template_overlays", "server_templates"
end