From c30e1c197369509fd7a9ff28b5f9faca41d48b6f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 19 Mar 2023 10:39:40 +0100 Subject: [PATCH] Better accuracy for database. Does not affect current users. --- .../2016_06_16_000002_create_main_tables.php | 22 +++++++++---------- .../2016_12_22_150431_changes_for_v430.php | 2 +- .../2017_04_13_163623_changes_for_v440.php | 4 ++-- .../2017_06_02_105232_changes_for_v450.php | 2 +- .../2018_06_08_200526_changes_for_v475.php | 4 ++-- ...2019_12_28_191351_make_locations_table.php | 4 ++-- .../2020_03_13_201950_changes_for_v520.php | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/database/migrations/2016_06_16_000002_create_main_tables.php b/database/migrations/2016_06_16_000002_create_main_tables.php index 6b06669502..7f364d2cf8 100644 --- a/database/migrations/2016_06_16_000002_create_main_tables.php +++ b/database/migrations/2016_06_16_000002_create_main_tables.php @@ -99,7 +99,7 @@ class CreateMainTables extends Migration $table->integer('user_id', false, true); $table->integer('account_type_id', false, true); $table->string('name', 1024); - $table->decimal('virtual_balance', 36, 24)->nullable(); + $table->decimal('virtual_balance', 32, 12)->nullable(); $table->string('iban', 255)->nullable(); $table->boolean('active')->default(1); $table->boolean('encrypted')->default(0); @@ -135,7 +135,7 @@ class CreateMainTables extends Migration $table->softDeletes(); $table->integer('account_id', false, true); $table->string('name', 1024); - $table->decimal('targetamount', 36, 24); + $table->decimal('targetamount', 32, 12); $table->date('startdate')->nullable(); $table->date('targetdate')->nullable(); $table->integer('order', false, true)->default(0); @@ -155,7 +155,7 @@ class CreateMainTables extends Migration $table->integer('piggy_bank_id', false, true); $table->date('startdate')->nullable(); $table->date('targetdate')->nullable(); - $table->decimal('currentamount', 36, 24); + $table->decimal('currentamount', 32, 12); $table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade'); } ); @@ -202,8 +202,8 @@ class CreateMainTables extends Migration $table->integer('user_id', false, true); $table->string('name', 1024); $table->string('match', 1024); - $table->decimal('amount_min', 36, 24); - $table->decimal('amount_max', 36, 24); + $table->decimal('amount_min', 32, 12); + $table->decimal('amount_max', 32, 12); $table->date('date'); $table->string('repeat_freq', 30); $table->smallInteger('skip', false, true)->default(0); @@ -247,7 +247,7 @@ class CreateMainTables extends Migration $table->timestamps(); $table->integer('budget_id', false, true); $table->date('startdate'); - $table->decimal('amount', 36, 24); + $table->decimal('amount', 32, 12); $table->string('repeat_freq', 30); $table->boolean('repeats')->default(0); $table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade'); @@ -263,7 +263,7 @@ class CreateMainTables extends Migration $table->integer('budget_limit_id', false, true); $table->date('startdate'); $table->date('enddate'); - $table->decimal('amount', 36, 24); + $table->decimal('amount', 32, 12); $table->foreign('budget_limit_id')->references('id')->on('budget_limits')->onDelete('cascade'); } ); @@ -463,8 +463,8 @@ class CreateMainTables extends Migration $table->string('tagMode', 1024); $table->date('date')->nullable(); $table->text('description')->nullable(); - $table->decimal('latitude', 36, 24)->nullable(); - $table->decimal('longitude', 36, 24)->nullable(); + $table->decimal('latitude', 12, 8)->nullable(); + $table->decimal('longitude', 12, 8)->nullable(); $table->smallInteger('zoomLevel', false, true)->nullable(); // link user id to users table @@ -575,7 +575,7 @@ class CreateMainTables extends Migration $table->integer('piggy_bank_id', false, true); $table->integer('transaction_journal_id', false, true)->nullable(); $table->date('date'); - $table->decimal('amount', 36, 24); + $table->decimal('amount', 32, 12); $table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade'); $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null'); @@ -593,7 +593,7 @@ class CreateMainTables extends Migration $table->integer('account_id', false, true); $table->integer('transaction_journal_id', false, true); $table->string('description', 1024)->nullable(); - $table->decimal('amount', 36, 24); + $table->decimal('amount', 32, 12); $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); diff --git a/database/migrations/2016_12_22_150431_changes_for_v430.php b/database/migrations/2016_12_22_150431_changes_for_v430.php index 579001ebc6..f478647289 100644 --- a/database/migrations/2016_12_22_150431_changes_for_v430.php +++ b/database/migrations/2016_12_22_150431_changes_for_v430.php @@ -54,7 +54,7 @@ class ChangesForV430 extends Migration $table->softDeletes(); $table->integer('user_id', false, true); $table->integer('transaction_currency_id', false, true); - $table->decimal('amount', 36, 24); + $table->decimal('amount', 32, 12); $table->date('start_date'); $table->date('end_date'); diff --git a/database/migrations/2017_04_13_163623_changes_for_v440.php b/database/migrations/2017_04_13_163623_changes_for_v440.php index 9d62b05037..79204d198b 100644 --- a/database/migrations/2017_04_13_163623_changes_for_v440.php +++ b/database/migrations/2017_04_13_163623_changes_for_v440.php @@ -72,8 +72,8 @@ class ChangesForV440 extends Migration $table->integer('from_currency_id', false, true); $table->integer('to_currency_id', false, true); $table->date('date'); - $table->decimal('rate', 36, 24); - $table->decimal('user_rate', 36, 24)->nullable(); + $table->decimal('rate', 32, 12); + $table->decimal('user_rate', 32, 12)->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade'); diff --git a/database/migrations/2017_06_02_105232_changes_for_v450.php b/database/migrations/2017_06_02_105232_changes_for_v450.php index 1caf09aa77..706a75fe39 100644 --- a/database/migrations/2017_06_02_105232_changes_for_v450.php +++ b/database/migrations/2017_06_02_105232_changes_for_v450.php @@ -73,7 +73,7 @@ class ChangesForV450 extends Migration Schema::table( 'transactions', static function (Blueprint $table) { - $table->decimal('foreign_amount', 36, 24)->nullable()->after('amount'); + $table->decimal('foreign_amount', 32, 12)->nullable()->after('amount'); } ); diff --git a/database/migrations/2018_06_08_200526_changes_for_v475.php b/database/migrations/2018_06_08_200526_changes_for_v475.php index 6e7053056e..17c6f86898 100644 --- a/database/migrations/2018_06_08_200526_changes_for_v475.php +++ b/database/migrations/2018_06_08_200526_changes_for_v475.php @@ -92,8 +92,8 @@ class ChangesForV475 extends Migration $table->integer('source_id', false, true); $table->integer('destination_id', false, true); - $table->decimal('amount', 36, 24); - $table->decimal('foreign_amount', 36, 24)->nullable(); + $table->decimal('amount', 32, 12); + $table->decimal('foreign_amount', 32, 12)->nullable(); $table->string('description', 1024); $table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade'); diff --git a/database/migrations/2019_12_28_191351_make_locations_table.php b/database/migrations/2019_12_28_191351_make_locations_table.php index 65c6dc91b0..ff945896e7 100644 --- a/database/migrations/2019_12_28_191351_make_locations_table.php +++ b/database/migrations/2019_12_28_191351_make_locations_table.php @@ -60,8 +60,8 @@ class MakeLocationsTable extends Migration $table->integer('locatable_id', false, true); $table->string('locatable_type', 255); - $table->decimal('latitude', 36, 24)->nullable(); - $table->decimal('longitude', 36, 24)->nullable(); + $table->decimal('latitude', 12, 8)->nullable(); + $table->decimal('longitude', 12, 8)->nullable(); $table->smallInteger('zoom_level', false, true)->nullable(); } ); diff --git a/database/migrations/2020_03_13_201950_changes_for_v520.php b/database/migrations/2020_03_13_201950_changes_for_v520.php index 1ee987937a..cf864c4c12 100644 --- a/database/migrations/2020_03_13_201950_changes_for_v520.php +++ b/database/migrations/2020_03_13_201950_changes_for_v520.php @@ -59,7 +59,7 @@ class ChangesForV520 extends Migration $table->integer('budget_id', false, true); $table->integer('transaction_currency_id', false, true); $table->tinyInteger('auto_budget_type', false, true)->default(1); - $table->decimal('amount', 36, 24); + $table->decimal('amount', 32, 12); $table->string('period', 50); $table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');