Skip to content

Commit

Permalink
افزایش طول فیلد id
Browse files Browse the repository at this point in the history
  • Loading branch information
hpakdaman authored Apr 5, 2017
1 parent c80f6f0 commit c0d614d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions migrations/2017_04_05_103357_alter_id_in_transactions_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterIdInTransactionsTable extends Migration
{

function getTable()
{
return config('gateway.table', 'gateway_transactions');
}

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
\Illuminate\Support\Facades\DB::statement("update `" . $this->getTable() . "` set `payment_date`=null WHERE `payment_date`=0;");
\Illuminate\Support\Facades\DB::statement("ALTER TABLE `" . $this->getTable() . "` CHANGE `id` `id` BIGINT UNSIGNED NOT NULL;");
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
\Illuminate\Support\Facades\DB::statement("ALTER TABLE `" . $this->getTable() . "` CHANGE `id` `id` INT(10) UNSIGNED NOT NULL;");
}
}

0 comments on commit c0d614d

Please sign in to comment.