Advertisement
safriansah

laravel-crud-migrasi

Sep 27th, 2020
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6.  
  7. class CreateTransactionsTable extends Migration
  8. {
  9.     /**
  10.      * Run the migrations.
  11.      *
  12.      * @return void
  13.      */
  14.     public function up()
  15.     {
  16.         Schema::create('transactions', function (Blueprint $table) {
  17.             $table->id();
  18.             $table->bigInteger('id_user');
  19.             $table->string('title');
  20.             $table->bigInteger('amount');
  21.             $table->char('type', 2);
  22.             $table->boolean('status');
  23.             $table->string('date');
  24.             $table->timestamps();
  25.             $table->softDeletes();
  26.         });
  27.     }
  28.  
  29.     /**
  30.      * Reverse the migrations.
  31.      *
  32.      * @return void
  33.      */
  34.     public function down()
  35.     {
  36.         Schema::dropIfExists('transactions');
  37.     }
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement