Added account types model and migration.

This commit is contained in:
Lukas Halbritter
2018-09-07 12:26:52 +02:00
parent 3cf3075292
commit 524378dcae
2 changed files with 53 additions and 0 deletions
@@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccountTypesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('account_types', function (Blueprint $table) {
$table->increments('id');
// The name of the account type
$table->string('name');
// The account class to which the account type belongs
$table->integer('account_class_id')->unsigned();
$table->foreign('account_class_id')->references('id')->on('account_classes')
->onDelete('restrict');
// An unique number of the account type
$table->integer('number')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('account_types');
}
}