%PDF- %PDF-
Direktori : /var/www/html/hr/api/database/migrations/ |
Current File : /var/www/html/hr/api/database/migrations/2020_04_04_220438_create_payments_table.php |
<?php use App\Models\Payment; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePaymentsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('payments', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('project_id') ->index(); $table->foreign('project_id') ->references('id') ->on('projects'); $table->string('status')->default(Payment::PENDING); $table->integer('amount'); $table->date('sent_at'); $table->date('paid_at') ->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('payments'); } }