| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('transactions', function (Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | $table->integer('user_id')->unsigned(); |
||
| 19 | $table->timestamp('transaction_date')->nullable(); |
||
| 20 | $table->integer('status_id')->unsigned()->nullable(); |
||
| 21 | $table->integer('type_id')->unsigned(); |
||
| 22 | $table->string('account_name'); // should not be linked through a FK since a account can be deleted anytime |
||
| 23 | $table->string('to_account_name')->nullable(); |
||
| 24 | $table->string('payee_name'); |
||
| 25 | $table->string('category_name'); |
||
| 26 | $table->string('sub_category_name')->nullable(); |
||
| 27 | $table->decimal('amount'); |
||
| 28 | $table->text('notes')->nullable(); |
||
| 29 | $table->softDeletes(); |
||
| 30 | $table->timestamps(); |
||
| 31 | }); |
||
| 32 | |||
| 33 | Schema::table('transactions', function (Blueprint $table) { |
||
| 34 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); |
||
| 35 | $table->foreign('status_id')->references('id')->on('transaction_status'); |
||
| 36 | $table->foreign('type_id')->references('id')->on('transaction_types'); |
||
| 37 | }); |
||
| 38 | } |
||
| 39 | |||
| 50 |