Realciones

This commit is contained in:
2024-09-11 20:42:56 -03:00
parent e5b3a8335e
commit aea7c21e8c
4 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
class CreateRuta < ActiveRecord::Migration[7.2]
def change
create_table :ruta do |t|
t.has_many :viajes
t.timestamps
end
end

View File

@ -1,6 +1,9 @@
class CreateViajes < ActiveRecord::Migration[7.2]
def change
create_table :viajes do |t|
t.belongs_to :ruta
t.has_many :entregas
t.has_many :retiros
t.timestamps
end
end

View File

@ -1,6 +1,7 @@
class CreateEntregas < ActiveRecord::Migration[7.2]
def change
create_table :entregas do |t|
t.belongs_to :viaje
t.timestamps
end
end

View File

@ -1,6 +1,7 @@
class CreateRetiros < ActiveRecord::Migration[7.2]
def change
create_table :retiros do |t|
t.belongs_to :viaje
t.timestamps
end
end