adrema/database/migrations/2017_01_22_235143_create_su...

42 lines
959 B
PHP
Raw Normal View History

2020-04-10 20:32:12 +02:00
<?php
2020-04-12 00:26:44 +02:00
use Illuminate\Database\Migrations\Migration;
2022-02-12 00:41:52 +01:00
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2020-04-10 20:32:12 +02:00
2020-04-12 00:26:44 +02:00
class CreateSubscriptionsTable extends Migration
2020-04-10 20:32:12 +02:00
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
2022-02-12 01:06:44 +01:00
Schema::create('fees', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->unsignedInteger('nami_id');
});
2020-04-12 00:26:44 +02:00
Schema::create('subscriptions', function (Blueprint $table) {
2021-04-10 02:57:10 +02:00
$table->id();
2020-04-10 20:32:12 +02:00
$table->string('name');
2022-02-12 01:06:44 +01:00
$table->unsignedInteger('amount');
$table->foreignId('fee_id')->constrained();
2020-04-10 20:32:12 +02:00
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
2020-04-12 00:26:44 +02:00
Schema::dropIfExists('subscriptions');
2022-02-12 01:06:44 +01:00
Schema::dropIfExists('fees');
2020-04-10 20:32:12 +02:00
}
}