Added account_classes migration and model.
This commit is contained in:
@@ -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');
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user