Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2020_04_21_100000_create_wallet_settings.php
- This file was copied 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 | class CreateWalletSettings extends Migration | ||||
{ | { | ||||
/** | /** | ||||
* Run the migrations. | * Run the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function up() | public function up() | ||||
{ | { | ||||
Schema::create( | Schema::create( | ||||
'payments', | 'wallet_settings', | ||||
function (Blueprint $table) { | function (Blueprint $table) { | ||||
$table->string('id', 16)->primary(); | $table->bigIncrements('id'); | ||||
$table->string('wallet_id', 36); | $table->string('wallet_id'); | ||||
$table->string('status', 16); | $table->string('key'); | ||||
$table->integer('amount'); | $table->string('value'); | ||||
$table->text('description'); | |||||
$table->timestamps(); | $table->timestamps(); | ||||
$table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | $table->foreign('wallet_id')->references('id')->on('wallets')->onDelete('cascade'); | ||||
$table->unique(['wallet_id', 'key']); | |||||
} | } | ||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function down() | public function down() | ||||
{ | { | ||||
Schema::dropIfExists('payments'); | Schema::dropIfExists('wallet_settings'); | ||||
} | } | ||||
} | } |