This commit is contained in:
2024-09-11 23:02:25 -03:00
parent 2dd0587393
commit 7de1b5279a
6 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,7 @@
class CreateViajes < ActiveRecord::Migration[7.2]
def change
create_table :viajes do |t|
t.belongs_to :ruta
t.string :direccion_partida
t.string :direccion_llegada
t.integer :kms

View File

@ -1,6 +1,7 @@
class CreateEntregas < ActiveRecord::Migration[7.2]
def change
create_table :entregas do |t|
t.belongs_to :viaje
t.string :nombre_recibe # Quien recibe
t.text :carga # Detalles de la carga, serializado
t.timestamps

View File

@ -1,6 +1,7 @@
class CreateRetiros < ActiveRecord::Migration[7.2]
def change
create_table :retiros do |t|
t.belongs_to :viaje
t.string :nombre_entrega # Quien entrega
t.text :carga # Detalles de la carga, serializado
t.timestamps

6
db/schema.rb generated
View File

@ -12,17 +12,21 @@
ActiveRecord::Schema[7.2].define(version: 2024_09_11_233430) do
create_table "entregas", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.bigint "viaje_id"
t.string "nombre_recibe"
t.text "carga"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["viaje_id"], name: "index_entregas_on_viaje_id"
end
create_table "retiros", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.bigint "viaje_id"
t.string "nombre_entrega"
t.text "carga"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["viaje_id"], name: "index_retiros_on_viaje_id"
end
create_table "ruta", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
@ -31,10 +35,12 @@ ActiveRecord::Schema[7.2].define(version: 2024_09_11_233430) do
end
create_table "viajes", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.bigint "ruta_id"
t.string "direccion_partida"
t.string "direccion_llegada"
t.integer "kms"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["ruta_id"], name: "index_viajes_on_ruta_id"
end
end

View File

@ -10,6 +10,6 @@ class RutaTest < ActiveSupport::TestCase
test "get" do
ruta = Ruta.find(1)
assert Ruta.id === 1
assert ruta.id === 1
end
end

View File

@ -11,5 +11,11 @@ module ActiveSupport
fixtures :all
# Add more helper methods to be used by all tests here...
def ruta_get_url
"/ruta"
end
def ruta_add_url
"/ruta"
end
end
end