Files
vault171/db/schema.rb
David Böhm b7f0c35378
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
Added some models
User
Item
Department
Categorie
AssignmentLog
Room
2026-05-21 15:36:23 +02:00

110 lines
3.9 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_05_21_125254) do
create_table "assignment_logs", force: :cascade do |t|
t.datetime "assigned_at"
t.datetime "created_at", null: false
t.integer "item_id"
t.datetime "returned_at"
t.integer "room_id"
t.datetime "updated_at", null: false
t.integer "user_id"
t.index ["item_id"], name: "index_assignment_logs_on_item_id"
t.index ["room_id"], name: "index_assignment_logs_on_room_id"
t.index ["user_id"], name: "index_assignment_logs_on_user_id"
end
create_table "categories", force: :cascade do |t|
t.datetime "created_at", null: false
t.text "description"
t.string "name"
t.datetime "updated_at", null: false
end
create_table "departments", force: :cascade do |t|
t.string "code"
t.datetime "created_at", null: false
t.string "name"
t.datetime "updated_at", null: false
end
create_table "events", force: :cascade do |t|
t.string "action", null: false
t.datetime "created_at", null: false
t.string "ip_address"
t.datetime "updated_at", null: false
t.string "user_agent"
t.integer "user_id", null: false
t.index ["user_id"], name: "index_events_on_user_id"
end
create_table "items", force: :cascade do |t|
t.integer "category_id"
t.datetime "created_at", null: false
t.string "name"
t.text "notes"
t.decimal "price", precision: 8, scale: 2
t.integer "room_id"
t.string "serial_number"
t.string "sku"
t.string "sticker_id"
t.datetime "updated_at", null: false
t.integer "user_id"
t.index ["category_id"], name: "index_items_on_category_id"
t.index ["room_id"], name: "index_items_on_room_id"
t.index ["serial_number"], name: "index_items_on_serial_number", unique: true
t.index ["sticker_id"], name: "index_items_on_sticker_id", unique: true
t.index ["user_id"], name: "index_items_on_user_id"
end
create_table "rooms", force: :cascade do |t|
t.string "building"
t.datetime "created_at", null: false
t.string "floor"
t.string "name"
t.datetime "updated_at", null: false
end
create_table "sessions", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "ip_address"
t.datetime "updated_at", null: false
t.string "user_agent"
t.integer "user_id", null: false
t.index ["user_id"], name: "index_sessions_on_user_id"
end
create_table "users", force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "department_id"
t.string "email", null: false
t.string "first_name"
t.string "last_name"
t.string "password_digest", null: false
t.datetime "updated_at", null: false
t.boolean "verified", default: false, null: false
t.index ["department_id"], name: "index_users_on_department_id"
t.index ["email"], name: "index_users_on_email", unique: true
end
add_foreign_key "assignment_logs", "items"
add_foreign_key "assignment_logs", "rooms"
add_foreign_key "assignment_logs", "users"
add_foreign_key "events", "users"
add_foreign_key "items", "categories"
add_foreign_key "items", "rooms"
add_foreign_key "items", "users"
add_foreign_key "sessions", "users"
add_foreign_key "users", "departments"
end