Advertisement
tomjerry741

New subscription module

Nov 25th, 2020 (edited)
1,286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5.  
  6. class AddColumnsToUsersTable extends Migration
  7. {
  8.     /**
  9.      * Run the migrations.
  10.      */
  11.     public function up()
  12.     {
  13.         Schema::table('users', function (Blueprint $table) {
  14.             $table->string('mollie_customer_id')->nullable();
  15.             $table->string('mollie_mandate_id')->nullable();
  16.             $table->decimal('tax_percentage', 6, 4)->default(0); // optional
  17.             $table->dateTime('trial_ends_at')->nullable(); // optional
  18.             $table->text('extra_billing_information')->nullable(); // optional
  19.         });
  20.     }
  21.  
  22.     /**
  23.      * Reverse the migrations.
  24.      */
  25.     public function down()
  26.     {
  27.         Schema::table('users', function (Blueprint $table) {
  28.             $table->dropColumn('mollie_customer_id');
  29.             $table->dropColumn('mollie_mandate_id');
  30.             $table->dropColumn('tax_percentage');
  31.             $table->dropColumn('trial_ends_at');
  32.             $table->dropColumn('extra_billing_information');
  33.         });
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement