| @@ 16-50 (lines=35) @@ | ||
| 13 | use Illuminate\Database\Schema\Blueprint; |
|
| 14 | use Illuminate\Database\Migrations\Migration; |
|
| 15 | ||
| 16 | class CreateExpenseTable extends Migration |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * Run the migrations. |
|
| 20 | * |
|
| 21 | * @return void |
|
| 22 | */ |
|
| 23 | public function up() |
|
| 24 | { |
|
| 25 | Schema::create('expense', function (Blueprint $table) { |
|
| 26 | $table->bigIncrements('id'); |
|
| 27 | ||
| 28 | $table->integer('expense_category'); |
|
| 29 | $table->string('expense_title')->nullable(); |
|
| 30 | $table->integer('amount')->nullable(); |
|
| 31 | $table->text('notes')->nullable(); |
|
| 32 | $table->date('date'); |
|
| 33 | ||
| 34 | ||
| 35 | ||
| 36 | ||
| 37 | $table->timestamps(); |
|
| 38 | }); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Reverse the migrations. |
|
| 43 | * |
|
| 44 | * @return void |
|
| 45 | */ |
|
| 46 | public function down() |
|
| 47 | { |
|
| 48 | Schema::dropIfExists('expense'); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 16-50 (lines=35) @@ | ||
| 13 | use Illuminate\Database\Schema\Blueprint; |
|
| 14 | use Illuminate\Database\Migrations\Migration; |
|
| 15 | ||
| 16 | class CreateIncomeTable extends Migration |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * Run the migrations. |
|
| 20 | * |
|
| 21 | * @return void |
|
| 22 | */ |
|
| 23 | public function up() |
|
| 24 | { |
|
| 25 | Schema::create('income', function (Blueprint $table) { |
|
| 26 | $table->bigIncrements('id'); |
|
| 27 | ||
| 28 | $table->integer('incomecategory'); |
|
| 29 | $table->string('income_title')->nullable(); |
|
| 30 | $table->integer('amount')->nullable(); |
|
| 31 | $table->text('notes')->nullable(); |
|
| 32 | $table->date('date'); |
|
| 33 | ||
| 34 | ||
| 35 | ||
| 36 | ||
| 37 | $table->timestamps(); |
|
| 38 | }); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * Reverse the migrations. |
|
| 43 | * |
|
| 44 | * @return void |
|
| 45 | */ |
|
| 46 | public function down() |
|
| 47 | { |
|
| 48 | Schema::dropIfExists('income'); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 16-49 (lines=34) @@ | ||
| 13 | use Illuminate\Database\Schema\Blueprint; |
|
| 14 | use Illuminate\Database\Migrations\Migration; |
|
| 15 | ||
| 16 | class CreateLedgerTable extends Migration |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * Run the migrations. |
|
| 20 | * |
|
| 21 | * @return void |
|
| 22 | */ |
|
| 23 | public function up() |
|
| 24 | { |
|
| 25 | Schema::create('ledger', function (Blueprint $table) { |
|
| 26 | $table->bigIncrements('id'); |
|
| 27 | $table->string('transaction_id'); |
|
| 28 | $table->string('transaction_type'); // exp or inc |
|
| 29 | $table->string('transaction_type_category'); |
|
| 30 | $table->integer('amount'); |
|
| 31 | $table->integer('balance')->default(); // always gets deducted when expense is added optinal |
|
| 32 | ||
| 33 | ||
| 34 | ||
| 35 | ||
| 36 | $table->timestamps(); |
|
| 37 | }); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Reverse the migrations. |
|
| 42 | * |
|
| 43 | * @return void |
|
| 44 | */ |
|
| 45 | public function down() |
|
| 46 | { |
|
| 47 | Schema::dropIfExists('ledger'); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||