Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Update migrations to include index.
James Cole73bc5372c01f
diff --git a/app/database/migrations/2014_12_13_190730_changes_for_v321.php b/app/database/migrations/2014_12_13_190730_changes_for_v321.phpindex 11aaaa8d14..08cc62071e 100644--- a/app/database/migrations/2014_12_13_190730_changes_for_v321.php+++ b/app/database/migrations/2014_12_13_190730_changes_for_v321.php@@ -21,8 +21,9 @@ class ChangesForV321 extends MigrationSchema::rename('piggy_bank_events', 'piggybank_events');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`;'));+ DB::update(DB::Raw('CREATE INDEX `transactions_piggybank_id_foreign` ON `transactions` (`piggybank_id`)'));+ DB::update(DB::Raw('ALTER TABLE `transactions` ADD FOREIGN KEY (`piggybank_id`) REFERENCES `piggybanks`(`id`);'));}-/*** Run the migrations.*@@ -31,7 +32,8 @@ class ChangesForV321 extends Migrationpublic function up(){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 `limit_repetitions` ALGORITHM = INPLACE, CHANGE `limit_id` `budget_limit_id` INT UNSIGNED NOT null'));+ DB::update(DB::Raw('ALTER TABLE `transactions` DROP FOREIGN KEY `transactions_piggybank_id_foreign`'));DB::update(DB::Raw('ALTER TABLE `transactions` DROP `piggybank_id`'));Schema::rename('piggybank_events', 'piggy_bank_events');