From b4c9c5b14e8547fa5e841b1fbe6cf659f8eb1e14 Mon Sep 17 00:00:00 2001 From: ale Date: Tue, 12 Mar 2024 17:53:06 -0300 Subject: [PATCH] chanchullo de atributos --- ...24_03_11_224041_create_productos_table.php | 6 ++++ ...2_195543_add_categoria_id_to_productos.php | 28 ------------------- 2 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 database/migrations/2024_03_12_195543_add_categoria_id_to_productos.php diff --git a/database/migrations/2024_03_11_224041_create_productos_table.php b/database/migrations/2024_03_11_224041_create_productos_table.php index e524043..9449563 100644 --- a/database/migrations/2024_03_11_224041_create_productos_table.php +++ b/database/migrations/2024_03_11_224041_create_productos_table.php @@ -13,7 +13,13 @@ public function up(): void { Schema::create('productos', function (Blueprint $table) { $table->id(); + $table->string('name', 100); + $table->double('price', 15, 2); + $table->unsignedBigInteger('categoria_id'); + $table->boolean('solidario'); + $table->boolean('bono'); $table->timestamps(); + $table->foreign('categoria_id')->references('id')->on('categorias'); }); } diff --git a/database/migrations/2024_03_12_195543_add_categoria_id_to_productos.php b/database/migrations/2024_03_12_195543_add_categoria_id_to_productos.php deleted file mode 100644 index 6b5d249..0000000 --- a/database/migrations/2024_03_12_195543_add_categoria_id_to_productos.php +++ /dev/null @@ -1,28 +0,0 @@ -unsignedBigInteger('categoria_id')->after('id'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('productos', function (Blueprint $table) { - $table->dropColumn('categoria_id'); - }); - } -};