From 1e9b41325569384605c8db6dcebf97208dff5e06 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:21:12 -0300 Subject: [PATCH 1/8] dependencia para renombrar columnas --- composer.json | 1 + composer.lock | 395 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 395 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3ba83fd..b4a654b 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,7 @@ "license": "MIT", "require": { "php": "^8.1", + "doctrine/dbal": "^3.8", "guzzlehttp/guzzle": "^7.2", "inertiajs/inertia-laravel": "^0.6.8", "laravel/framework": "^10.10", diff --git a/composer.lock b/composer.lock index 1ce6e31..f25f7f3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8d183499e584f55de945d0a59ab769e7", + "content-hash": "58bdc4fc7c5dfbc1a71d9f335386c5b2", "packages": [ { "name": "bacon/bacon-qr-code", @@ -309,6 +309,350 @@ }, "time": "2022-10-27T11:44:00+00:00" }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.8.6", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "b7411825cf7efb7e51f9791dea19d86e43b399a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/b7411825cf7efb7e51f9791dea19d86e43b399a1", + "reference": "b7411825cf7efb7e51f9791dea19d86e43b399a1", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.11.5", + "phpstan/phpstan-strict-rules": "^1.6", + "phpunit/phpunit": "9.6.19", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.10.1", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", + "vimeo/psalm": "4.30.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.8.6" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2024-06-19T10:38:17+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2024-05-22T20:47:39+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.10", @@ -3125,6 +3469,55 @@ }, "time": "2022-06-13T21:57:56+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, { "name": "psr/clock", "version": "1.0.0", From 8205748637fa531b5ac53770886d763bca9f9e26 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:22:42 -0300 Subject: [PATCH 2/8] traduccion barrio --- app/Models/Barrio.php | 2 +- database/seeders/BarrioSeeder.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Barrio.php b/app/Models/Barrio.php index 9c48da6..d321a2f 100644 --- a/app/Models/Barrio.php +++ b/app/Models/Barrio.php @@ -13,7 +13,7 @@ class Barrio extends Model * @var array */ protected $fillable = [ - 'name', + 'nombre', ]; /** diff --git a/database/seeders/BarrioSeeder.php b/database/seeders/BarrioSeeder.php index 1d59a25..e1e99e5 100644 --- a/database/seeders/BarrioSeeder.php +++ b/database/seeders/BarrioSeeder.php @@ -17,11 +17,11 @@ class BarrioSeeder extends Seeder public function run(): void { $prueba_id = Region::create([ - 'name' => 'PRUEBA', + 'nombre' => 'PRUEBA', ])->id; Barrio::create([ - 'name'=>'PRUEBA','region_id'=>$prueba_id, 'created_at'=>Date::now() + 'nombre'=>'PRUEBA','region_id'=>$prueba_id, 'created_at'=>Date::now() ]); } } From dde8b7f826606d66e5abf9a33c815ba8cd041f5e Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:23:00 -0300 Subject: [PATCH 3/8] traduccion categoria --- app/Models/Categoria.php | 2 +- database/seeders/CaracteristicaSeeder.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Models/Categoria.php b/app/Models/Categoria.php index 66993d1..128e0c8 100644 --- a/app/Models/Categoria.php +++ b/app/Models/Categoria.php @@ -13,7 +13,7 @@ class Categoria extends Model * @var array */ protected $fillable = [ - 'name', + 'nombre', ]; /** diff --git a/database/seeders/CaracteristicaSeeder.php b/database/seeders/CaracteristicaSeeder.php index 1b6bef7..94d1ce3 100644 --- a/database/seeders/CaracteristicaSeeder.php +++ b/database/seeders/CaracteristicaSeeder.php @@ -15,10 +15,10 @@ class CaracteristicaSeeder extends Seeder public function run(): void { DB::table('caracteristicas')->insert([ - ['name' => 'SIN GLUTEN', 'key' => 'S-G', 'created_at' => Date::now(), 'updated_at' => Date::now()], - ['name' => 'SIN SAL AGREGADA', 'key' => 'S-S', 'created_at' => Date::now(), 'updated_at' => Date::now()], - ['name' => 'SIN AZÚCAR AGREGADA', 'key' => 'S-A', 'created_at' => Date::now(), 'updated_at' => Date::now()], - ['name' => 'SIN PRODUCTOS DE ORIGEN ANIMAL', 'key' => 'S-P-A', 'created_at' => Date::now(), 'updated_at' => Date::now()], + ['nombre' => 'SIN GLUTEN', 'codigo' => 'S-G', 'created_at' => Date::now(), 'updated_at' => Date::now()], + ['nombre' => 'SIN SAL AGREGADA', 'codigo' => 'S-S', 'created_at' => Date::now(), 'updated_at' => Date::now()], + ['nombre' => 'SIN AZÚCAR AGREGADA', 'codigo' => 'S-A', 'created_at' => Date::now(), 'updated_at' => Date::now()], + ['nombre' => 'SIN PRODUCTOS DE ORIGEN ANIMAL', 'codigo' => 'S-P-A', 'created_at' => Date::now(), 'updated_at' => Date::now()], ]); } } From 0045bc6f138a4aeafa0692d938d36c722dc5b826 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:23:07 -0300 Subject: [PATCH 4/8] traduccion pedido --- app/Models/Pedido.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Pedido.php b/app/Models/Pedido.php index 31bd7be..c2d4bd2 100644 --- a/app/Models/Pedido.php +++ b/app/Models/Pedido.php @@ -13,7 +13,7 @@ class Pedido extends Model * @var array */ protected $fillable = [ - 'name', + 'nombre', ]; /** From 8e0ac9953d79dc0fbc6b52fa76863b057a96bf88 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:23:14 -0300 Subject: [PATCH 5/8] traduccion producto --- app/Models/Producto.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Producto.php b/app/Models/Producto.php index 6c3e62d..4ed0a10 100644 --- a/app/Models/Producto.php +++ b/app/Models/Producto.php @@ -13,7 +13,7 @@ class Producto extends Model * @var array */ protected $fillable = [ - 'name', 'price', 'solidario', 'bono', 'categoria_id' + 'nombre', 'precio', 'solidario', 'bono', 'categoria_id' ]; /** From 2a35fd85a95c6b1c61969c55eb1bf51489649ed3 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:23:19 -0300 Subject: [PATCH 6/8] traduccion region --- app/Models/Region.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Region.php b/app/Models/Region.php index 53ddecb..bdd475e 100644 --- a/app/Models/Region.php +++ b/app/Models/Region.php @@ -20,7 +20,7 @@ class Region extends Model * @var array */ protected $fillable = [ - 'name', + 'nombre', ]; /** From ccfdb4bf11ef216696ce7e2308e3002436ae0d88 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:23:24 -0300 Subject: [PATCH 7/8] traduccion canasta --- database/seeders/CanastaSeeder.php | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/database/seeders/CanastaSeeder.php b/database/seeders/CanastaSeeder.php index a61c3aa..477af5e 100644 --- a/database/seeders/CanastaSeeder.php +++ b/database/seeders/CanastaSeeder.php @@ -38,14 +38,14 @@ public function run(): void if (!in_array($tipo, $tipos)) { if (!Str::contains($tipo,'¿') && ($tipo != 'T')) { - $currentCategoria = Categoria::firstOrCreate(['name' => $tipo]); + $currentCategoria = Categoria::firstOrCreate(['nombre' => $tipo]); } } else { $parsed = $this->parseAndFormatName($record[$productoColumn]); $productosToInsert[] = [ - 'name' => $parsed['name'], - 'price' => $record[$precioColumn], + 'nombre' => $parsed['nombre'], + 'precio' => $record[$precioColumn], 'solidario' => $parsed['solidario'], 'bono' => $tipo == 'B', 'categoria_id' => $currentCategoria->id, @@ -54,7 +54,7 @@ public function run(): void ]; $caracteristicasToInsert[] = [ - 'name' => $parsed['name'], + 'nombre' => $parsed['nombre'], 'caracteristicas' => $parsed['caracteristicas'] ]; } @@ -70,39 +70,39 @@ public function run(): void /** * Returns an array data parsed from productoColumn. * - * @return array{solidario: bool, name: string, caracteristicas: array(Caracteristica)} + * @return array{solidario: bool, nombre: string, caracteristicas: array(Caracteristica)} */ private function parseAndFormatName($productoColumn): array { $solidario = Str::contains($productoColumn, '*'); - $name = Str::replace('*','',$productoColumn); + $nombre = Str::replace('*','',$productoColumn); $caracteristicas = []; - if (Str::contains($name, 'S-G')) - $caracteristicas[] = Caracteristica::where('key','S-G')->first()->id; - if (Str::contains($name, 'S-A')) - $caracteristicas[] = Caracteristica::where('key','S-A')->first()->id; - if (Str::contains($name, 'S-S')) - $caracteristicas[] = Caracteristica::where('key','S-S')->first()->id; - if (Str::contains($name, 'S-P-A')) - $caracteristicas[] = Caracteristica::where('key','S-P-A')->first()->id; + if (Str::contains($nombre, 'S-G')) + $caracteristicas[] = Caracteristica::where('codigo','S-G')->first()->id; + if (Str::contains($nombre, 'S-A')) + $caracteristicas[] = Caracteristica::where('codigo','S-A')->first()->id; + if (Str::contains($nombre, 'S-S')) + $caracteristicas[] = Caracteristica::where('codigo','S-S')->first()->id; + if (Str::contains($nombre, 'S-P-A')) + $caracteristicas[] = Caracteristica::where('codigo','S-P-A')->first()->id; if ($caracteristicas) { - $name = Str::replaceMatches('/\(S\-.*\)/', '', $name); + $nombre = Str::replaceMatches('/\(S\-.*\)/', '', $nombre); } return [ 'solidario' => $solidario, - 'name' => trim($name), + 'nombre' => trim($nombre), 'caracteristicas' => $caracteristicas ]; } private function insertCaracteristicas($caracteristicasToInsert) : void { - foreach ($caracteristicasToInsert as $key => $item) { - $name = $item['name']; - $match = Producto::where('name',$name)->first(); + foreach ($caracteristicasToInsert as $codigo => $item) { + $nombre = $item['nombre']; + $match = Producto::where('nombre',$nombre)->first(); if ($match) { - foreach ($item['caracteristicas'] as $key => $caracteristica) { + foreach ($item['caracteristicas'] as $codigo => $caracteristica) { DB::table('productos_caracteristicas')->insert([ 'producto_id' => $match->id, 'caracteristica_id' => $caracteristica, From ea5cdeb9343a75d495e12ae7a654dc348e25ce55 Mon Sep 17 00:00:00 2001 From: ale Date: Wed, 3 Jul 2024 19:23:37 -0300 Subject: [PATCH 8/8] traduccion columnas --- .../2024_07_03_215823_traduccion.php | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 database/migrations/2024_07_03_215823_traduccion.php diff --git a/database/migrations/2024_07_03_215823_traduccion.php b/database/migrations/2024_07_03_215823_traduccion.php new file mode 100644 index 0000000..926a361 --- /dev/null +++ b/database/migrations/2024_07_03_215823_traduccion.php @@ -0,0 +1,62 @@ +renameColumn('name', 'nombre'); + }); + Schema::table('categorias', function (Blueprint $table) { + $table->renameColumn('name', 'nombre'); + }); + Schema::table('pedidos', function (Blueprint $table) { + $table->renameColumn('name', 'nombre'); + }); + Schema::table('regiones', function (Blueprint $table) { + $table->renameColumn('name', 'nombre'); + }); + Schema::table('caracteristicas', function (Blueprint $table) { + $table->renameColumn('name', 'nombre'); + $table->renameColumn('key', 'codigo'); + }); + Schema::table('productos', function (Blueprint $table) { + $table->renameColumn('name', 'nombre'); + $table->renameColumn('price', 'precio'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('barrios', function (Blueprint $table) { + $table->renameColumn('nombre', 'name'); + }); + Schema::table('categorias', function (Blueprint $table) { + $table->renameColumn('nombre', 'name'); + }); + Schema::table('pedidos', function (Blueprint $table) { + $table->renameColumn('nombre', 'name'); + }); + Schema::table('regiones', function (Blueprint $table) { + $table->renameColumn('nombre', 'name'); + }); + Schema::table('caracteristicas', function (Blueprint $table) { + $table->renameColumn('nombre', 'name'); + $table->renameColumn('codigo', 'key'); + }); + Schema::table('productos', function (Blueprint $table) { + $table->renameColumn('nombre', 'name'); + $table->renameColumn('precio', 'price'); + }); + } +};