Differential D1102 Diff 2866 src/database/migrations/2020_03_16_100000_create_transactions_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2020_03_16_100000_create_transactions_table.php
- This file was moved from src/database/migrations/2020_03_16_100000_create_payments.php.
<?php | <?php | ||||
use Illuminate\Support\Facades\Schema; | use Illuminate\Support\Facades\Schema; | ||||
use Illuminate\Database\Schema\Blueprint; | use Illuminate\Database\Schema\Blueprint; | ||||
use Illuminate\Database\Migrations\Migration; | use Illuminate\Database\Migrations\Migration; | ||||
class CreatePayments extends Migration | // phpcs:ignore | ||||
class CreateTransactionsTable extends Migration | |||||
{ | { | ||||
/** | /** | ||||
* Run the migrations. | * Run the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function up() | public function up() | ||||
{ | { | ||||
Schema::create( | Schema::create( | ||||
'payments', | 'transactions', | ||||
function (Blueprint $table) { | function (Blueprint $table) { | ||||
$table->string('id', 16)->primary(); | $table->string('id', 36)->primary(); | ||||
$table->string('wallet_id', 36); | $table->string('wallet_id', 36); | ||||
$table->string('status', 16); | |||||
$table->integer('amount'); | $table->integer('amount'); | ||||
$table->text('description'); | $table->text('description'); | ||||
$table->string('mollie_id', 16)->nullable(); | |||||
$table->string('mollie_status', 16)->nullable(); | |||||
$table->timestamps(); | $table->timestamps(); | ||||
$table->softDeletes(); | |||||
$table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | $table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function down() | public function down() | ||||
{ | { | ||||
Schema::dropIfExists('payments'); | Schema::dropIfExists('transactions'); | ||||
} | } | ||||
} | } |