Added some models
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

User
Item
Department
Categorie
AssignmentLog
Room
This commit is contained in:
2026-05-21 15:36:23 +02:00
parent 7b02520b6c
commit b7f0c35378
27 changed files with 387 additions and 2 deletions

67
db/schema.rb generated
View File

@@ -10,7 +10,34 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2026_05_20_205436) do
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
@@ -21,6 +48,33 @@ ActiveRecord::Schema[8.1].define(version: 2026_05_20_205436) do
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"
@@ -32,13 +86,24 @@ ActiveRecord::Schema[8.1].define(version: 2026_05_20_205436) do
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