mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup.
This commit is contained in:
@@ -46,7 +46,7 @@ class CreatePiggybanksTable extends Migration
|
||||
$table->boolean('remind_me');
|
||||
$table->integer('order')->unsigned();
|
||||
|
||||
// connect account to piggybank.
|
||||
// connect account to piggy bank.
|
||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||
|
||||
// for an account, the name must be unique.
|
||||
|
@@ -3,6 +3,8 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
/**
|
||||
* SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*
|
||||
* Class ChangesForV321
|
||||
*/
|
||||
class ChangesForV321 extends Migration
|
||||
@@ -15,9 +17,9 @@ class ChangesForV321 extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::update(DB::raw('RENAME TABLE `budget_limits` TO `limits`;'));
|
||||
Schema::rename('budget_limits','limits');
|
||||
DB::update(DB::raw('ALTER TABLE `limit_repetitions` ALGORITHM=INPLACE, CHANGE `budget_limit_id` `limit_id` INT UNSIGNED NOT NULL'));
|
||||
|
||||
DB::update(DB::Raw('ALTER TABLE `transactions` ADD `piggybank_id` int(10) unsigned DEFAULT NULL AFTER `account_id`;'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,8 +29,9 @@ class ChangesForV321 extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::update(DB::raw('RENAME TABLE `limits` TO `budget_limits`;'));
|
||||
Schema::rename('limits','budget_limits');
|
||||
DB::update(DB::raw('ALTER TABLE `limit_repetitions` ALGORITHM=INPLACE, CHANGE `limit_id` `budget_limit_id` INT UNSIGNED NOT NULL'));
|
||||
DB::update(DB::Raw('ALTER TABLE `transactions` DROP `piggybank_id`'));
|
||||
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,7 @@ class TestContentSeeder extends Seeder
|
||||
// create two asset accounts.
|
||||
$checking = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Checking account', 'active' => 1]);
|
||||
$savings = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Savings account', 'active' => 1]);
|
||||
/** @noinspection PhpUnusedLocalVariableInspection */
|
||||
$deleteMe = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Delete me', 'active' => 1]);
|
||||
|
||||
// create two budgets:
|
||||
|
Reference in New Issue
Block a user