Calendar is shown

This commit is contained in:
2024-08-24 07:06:09 +02:00
parent e0d9d3a6b9
commit dfaf7dc870
20 changed files with 129 additions and 94 deletions

View File

@@ -1,7 +1,8 @@
class CreateTeams < ActiveRecord::Migration[7.1]
def change
create_table :teams do |t|
t.string :name
t.references :company, null: false, foreign_key: true
t.timestamps
end
end

View File

@@ -0,0 +1,6 @@
class ChangePlaceToTeamInReservations < ActiveRecord::Migration[7.1]
def change
remove_reference :reservations, :place, foreign_key: true
add_reference :reservations, :team, null: false, foreign_key: true
end
end

12
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_08_10_054948) do
ActiveRecord::Schema[7.1].define(version: 2024_08_18_063444) do
create_table "companies", force: :cascade do |t|
t.string "name"
t.string "id_number"
@@ -47,23 +47,27 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_10_054948) do
create_table "reservations", force: :cascade do |t|
t.integer "company_id", null: false
t.integer "customer_id", null: false
t.integer "place_id", null: false
t.datetime "start_time"
t.datetime "end_time"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "team_id", null: false
t.index ["company_id"], name: "index_reservations_on_company_id"
t.index ["customer_id"], name: "index_reservations_on_customer_id"
t.index ["place_id"], name: "index_reservations_on_place_id"
t.index ["team_id"], name: "index_reservations_on_team_id"
end
create_table "teams", force: :cascade do |t|
t.string "name"
t.integer "company_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["company_id"], name: "index_teams_on_company_id"
end
add_foreign_key "places", "companies"
add_foreign_key "reservations", "companies"
add_foreign_key "reservations", "customers"
add_foreign_key "reservations", "places"
add_foreign_key "reservations", "teams"
add_foreign_key "teams", "companies"
end