Add trips
This commit is contained in:
14
db/migrate/20230509092845_create_trips.rb
Normal file
14
db/migrate/20230509092845_create_trips.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ROM::SQL.migration do
|
||||
change do
|
||||
create_table :trips do
|
||||
primary_key :id
|
||||
column :name, :text, null: false
|
||||
column :start_date, :date, null: false
|
||||
column :end_date, :date, null: false
|
||||
# column :latitude, :float, null: false
|
||||
# column :longitude, :float, null: false
|
||||
end
|
||||
end
|
||||
end
|
10
db/migrate/20230509094041_create_post_trips.rb
Normal file
10
db/migrate/20230509094041_create_post_trips.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ROM::SQL.migration do
|
||||
change do
|
||||
create_table :post_trips do
|
||||
foreign_key :post_id, :posts, null: false
|
||||
foreign_key :trip_id, :trips, null: false
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user