Added account_classes migration and model.

This commit is contained in:
Lukas Halbritter
2018-09-07 10:35:38 +02:00
parent 105c04865c
commit f62a100376
2 changed files with 55 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class AccountClass extends Model
{
//
}
@@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccountClassesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('account_classes', function (Blueprint $table) {
$table->increments('id');
// Name of the account class
$table->string('name');
// The type of the account class.
$table->integer('io_type')->unsigned();
$table->foreign('io_type')->references('id')->on('io_types')
->onDelete('no action');
// The scope of the account class.
$table->integer('scope')->unsigned();
$table->foreign('scope')->references('id')->on('scopes')
->onDelete('no action');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('account_classes');
}
}