Added vehicle scaffold
This commit is contained in:
19
db/migrate/20240820165836_create_vehicles.rb
Normal file
19
db/migrate/20240820165836_create_vehicles.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class CreateVehicles < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :vehicles do |t|
|
||||
t.integer :vehicle_type
|
||||
t.string :car_brand
|
||||
t.string :model
|
||||
t.integer :model_year
|
||||
t.string :fuel_type
|
||||
t.integer :power_ps
|
||||
t.integer :power_kw
|
||||
t.boolean :registered
|
||||
t.string :license_plate
|
||||
t.string :color
|
||||
t.text :note
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
18
db/schema.rb
generated
18
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_08_19_011351) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_08_20_165836) do
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@@ -57,6 +57,22 @@ ActiveRecord::Schema[7.2].define(version: 2024_08_19_011351) do
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
end
|
||||
|
||||
create_table "vehicles", force: :cascade do |t|
|
||||
t.integer "vehicle_type"
|
||||
t.string "car_brand"
|
||||
t.string "model"
|
||||
t.integer "model_year"
|
||||
t.string "fuel_type"
|
||||
t.integer "power_ps"
|
||||
t.integer "power_kw"
|
||||
t.boolean "registered"
|
||||
t.string "license_plate"
|
||||
t.string "color"
|
||||
t.text "note"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
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 "sessions", "users"
|
||||
|
||||
@@ -9,3 +9,4 @@
|
||||
# end
|
||||
|
||||
User.create(email: "admin@admin.de", password_digest: BCrypt::Password.create("admin"), verified: true)
|
||||
Vehicle.create(vehicle_type: :car, car_brand: "VW", model: "Golf 1 Cabrio", model_year: 1992, fuel_type: "Benzin", power_ps: 90, power_kw: 72, registered: true, license_plate: "SWA-DN-10", color: "Tornado Red")
|
||||
Reference in New Issue
Block a user