Added account types model and migration.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AccountType extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user