diff --git a/app/AccountType.php b/app/AccountType.php new file mode 100644 index 0000000..40238ca --- /dev/null +++ b/app/AccountType.php @@ -0,0 +1,10 @@ +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'); + } +}