From aea7c21e8cf058949596e9e1d3b15b391d15a5cc Mon Sep 17 00:00:00 2001 From: Aldarien Date: Wed, 11 Sep 2024 20:42:56 -0300 Subject: [PATCH] Realciones --- db/migrate/20240911231722_create_ruta.rb | 1 + db/migrate/20240911231807_create_viajes.rb | 3 +++ db/migrate/20240911233401_create_entregas.rb | 1 + db/migrate/20240911233430_create_retiros.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/db/migrate/20240911231722_create_ruta.rb b/db/migrate/20240911231722_create_ruta.rb index 12c478d..a4cc96f 100644 --- a/db/migrate/20240911231722_create_ruta.rb +++ b/db/migrate/20240911231722_create_ruta.rb @@ -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 diff --git a/db/migrate/20240911231807_create_viajes.rb b/db/migrate/20240911231807_create_viajes.rb index b13472a..9bb5fad 100644 --- a/db/migrate/20240911231807_create_viajes.rb +++ b/db/migrate/20240911231807_create_viajes.rb @@ -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 diff --git a/db/migrate/20240911233401_create_entregas.rb b/db/migrate/20240911233401_create_entregas.rb index 8357d2e..2d72783 100644 --- a/db/migrate/20240911233401_create_entregas.rb +++ b/db/migrate/20240911233401_create_entregas.rb @@ -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 diff --git a/db/migrate/20240911233430_create_retiros.rb b/db/migrate/20240911233430_create_retiros.rb index ab759a9..071feaa 100644 --- a/db/migrate/20240911233430_create_retiros.rb +++ b/db/migrate/20240911233430_create_retiros.rb @@ -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