mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Update migrations to include index.
This commit is contained in:
parent
b999a8f0fb
commit
73bc5372c0
@ -21,8 +21,9 @@ class ChangesForV321 extends Migration
|
||||
Schema::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 Migration
|
||||
public 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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user