42 lines
959 B
PHP
42 lines
959 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateSubscriptionsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('fees', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->unsignedInteger('nami_id');
|
|
});
|
|
|
|
Schema::create('subscriptions', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->unsignedInteger('amount');
|
|
$table->foreignId('fee_id')->constrained();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('subscriptions');
|
|
Schema::dropIfExists('fees');
|
|
}
|
|
}
|