-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.rb
More file actions
109 lines (98 loc) · 4.02 KB
/
schema.rb
File metadata and controls
109 lines (98 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# 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: 2026_01_14_100000) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
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 "bookings", force: :cascade do |t|
t.bigint "car_id", null: false
t.integer "customer_id"
t.datetime "start_date"
t.datetime "end_date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["car_id"], name: "index_bookings_on_car_id"
end
create_table "cars", force: :cascade do |t|
t.bigint "category_id", null: false
t.string "reference"
t.string "model"
t.string "brand"
t.integer "year"
t.integer "nb_seats"
t.boolean "is_manual"
t.json "options"
t.integer "rent_company_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["category_id"], name: "index_cars_on_category_id"
end
create_table "cars_checks", force: :cascade do |t|
t.bigint "car_id", null: false
t.bigint "check_id", null: false
t.index ["car_id"], name: "index_cars_checks_on_car_id"
t.index ["check_id"], name: "index_cars_checks_on_check_id"
end
create_table "categories", force: :cascade do |t|
t.string "label"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "checks", force: :cascade do |t|
t.string "garage_name"
t.date "date"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "users", force: :cascade do |t|
t.string "firstname"
t.string "lastname"
t.string "email"
t.string "password"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "active", default: false
t.boolean "verified", default: true
t.integer "status", default: 0
t.integer "role", default: 1
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 "bookings", "cars"
add_foreign_key "cars", "categories"
add_foreign_key "cars_checks", "cars"
add_foreign_key "cars_checks", "checks"
end