Rezervacije

This commit is contained in:
2024-08-06 14:16:40 +02:00
parent 8d5a410c60
commit 6d5509856f
58 changed files with 1052 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
class CreateCustomers < ActiveRecord::Migration[7.1]
def change
create_table :customers do |t|
t.string :name
t.string :phone
t.text :notes
t.string :email
t.integer :birthyear
t.timestamps
end
end
end

View File

@@ -0,0 +1,5 @@
class AddCompanyIdToCustomers < ActiveRecord::Migration[7.1]
def change
add_column :customers, :company_id, :integer
end
end

View File

@@ -0,0 +1,10 @@
class CreatePlaces < ActiveRecord::Migration[7.1]
def change
create_table :places do |t|
t.string :name
t.references :company, null: false, foreign_key: true
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
class CreateReservations < ActiveRecord::Migration[7.1]
def change
create_table :reservations do |t|
t.references :company, null: false, foreign_key: true
t.references :customer, null: false, foreign_key: true
t.references :place, null: false, foreign_key: true
t.string :title
t.text :description
t.datetime :start_time
t.datetime :end_time
t.timestamps
end
end
end