Add trips

This commit is contained in:
2023-05-09 21:51:44 +10:00
parent ebdf051b82
commit 7988ffc76d
37 changed files with 651 additions and 2 deletions

View 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

View 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