Realciones
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user