Skip to content

Commit

Permalink
feat: Add migration for payment methods table with
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 11, 2024
1 parent 1ca198e commit 6be6fbb
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

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

class CreatePaymentMethodsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('payment_methods', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id');
$table->string('name');
$table->text('details');
$table->boolean('is_default')->default(false);

$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down()
{
Schema::table('payment_methods', function (Blueprint $table) {
$table->dropForeign(['user_id']);
});
Schema::dropIfExists('payment_methods');
}
}

0 comments on commit 6be6fbb

Please sign in to comment.