ctrlpanel/database/migrations/2022_05_30_085900_rename_credits_product.php
2023-01-05 17:03:31 +00:00

36 lines
827 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::rename('credit_products', 'shop_products');
Schema::table('payments', function (Blueprint $table) {
$table->renameColumn('credit_product_id', 'shop_item_product_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::rename('shop_products', 'credit_products');
Schema::table('payments', function (Blueprint $table) {
$table->renameColumn('shop_item_product_id', 'credit_product_id');
});
}
};