2021-07-04 16:56:07 +02:00
|
|
|
<?php
|
|
|
|
|
2022-02-12 01:06:44 +01:00
|
|
|
use App\Payment\Status;
|
2021-07-04 16:56:07 +02:00
|
|
|
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()
|
|
|
|
{
|
2022-03-11 20:19:17 +01:00
|
|
|
Schema::create('statuses', function ($table) {
|
2021-07-04 16:56:07 +02:00
|
|
|
$table->id();
|
|
|
|
$table->string('name');
|
|
|
|
$table->boolean('is_bill');
|
|
|
|
$table->boolean('is_remember');
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::create('payments', function (Blueprint $table) {
|
|
|
|
$table->id();
|
|
|
|
$table->string('nr');
|
|
|
|
$table->foreignId('subscription_id')->constrained();
|
|
|
|
$table->foreignId('status_id')->constrained();
|
|
|
|
$table->foreignId('member_id')->constrained();
|
2022-02-12 01:06:44 +01:00
|
|
|
$table->datetime('last_remembered_at')->nullable();
|
2021-07-04 16:56:07 +02:00
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('payments');
|
2023-06-29 12:57:06 +02:00
|
|
|
Schema::dropIfExists('statuses');
|
2021-07-04 16:56:07 +02:00
|
|
|
}
|
|
|
|
}
|