# 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[7.0].define(version: 2022_11_27_130223) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "actions", force: :cascade do |t| t.bigint "batch_id", null: false t.string "actionable_type", null: false t.bigint "actionable_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["actionable_type", "actionable_id"], name: "index_actions_on_actionable" t.index ["batch_id"], name: "index_actions_on_batch_id" end create_table "batches", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "commands", force: :cascade do |t| t.string "name" t.string "description" t.string "default" t.bigint "datatype_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["datatype_id"], name: "index_commands_on_datatype_id" end create_table "datatypes", force: :cascade do |t| t.string "name" t.string "regex" t.integer "specifity" t.boolean "is_nestable", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "executions", force: :cascade do |t| t.bigint "command_id", null: false t.string "value" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["command_id"], name: "index_executions_on_command_id" end create_table "key_binds", force: :cascade do |t| t.bigint "setup_id", null: false t.bigint "key_id", null: false t.bigint "batch_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["batch_id"], name: "index_key_binds_on_batch_id" t.index ["key_id"], name: "index_key_binds_on_key_id" t.index ["setup_id"], name: "index_key_binds_on_setup_id" end create_table "keys", force: :cascade do |t| t.string "title" t.string "short" t.string "ingame" t.string "keycap" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "menu_options", force: :cascade do |t| t.bigint "menu_id", null: false t.bigint "batch_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["batch_id"], name: "index_menu_options_on_batch_id" t.index ["menu_id"], name: "index_menu_options_on_menu_id" end create_table "menus", force: :cascade do |t| t.string "name" t.bigint "setup_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["setup_id"], name: "index_menus_on_setup_id" end create_table "setups", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "wheel_options", force: :cascade do |t| t.bigint "wheel_id", null: false t.bigint "batch_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["batch_id"], name: "index_wheel_options_on_batch_id" t.index ["wheel_id"], name: "index_wheel_options_on_wheel_id" end create_table "wheels", force: :cascade do |t| t.string "name" t.bigint "setup_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["setup_id"], name: "index_wheels_on_setup_id" end add_foreign_key "actions", "batches" add_foreign_key "commands", "datatypes" add_foreign_key "executions", "commands" add_foreign_key "key_binds", "batches" add_foreign_key "key_binds", "keys" add_foreign_key "key_binds", "setups" add_foreign_key "menu_options", "batches" add_foreign_key "menu_options", "menus" add_foreign_key "menus", "setups" add_foreign_key "wheel_options", "batches" add_foreign_key "wheel_options", "wheels" add_foreign_key "wheels", "setups" end