mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 07:53:16 +00:00
Update migrations to include index.
This commit is contained in:
@@ -21,8 +21,9 @@ class ChangesForV321 extends Migration
|
|||||||
Schema::rename('piggy_bank_events', 'piggybank_events');
|
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 `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('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.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
@@ -31,7 +32,8 @@ class ChangesForV321 extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::rename('limits', '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 `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`'));
|
DB::update(DB::Raw('ALTER TABLE `transactions` DROP `piggybank_id`'));
|
||||||
Schema::rename('piggybank_events', 'piggy_bank_events');
|
Schema::rename('piggybank_events', 'piggy_bank_events');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user