Drop explicit transaction from store_node_tokens_as_encrypted_value (#3280)

Migrations are executed in transactions anyway, and creating a savepoint can cause
spurious failures on databases that don't support transactional DDL (like
MySQL and MariaDB) when it attempts to commit a savepoint that was silently
not created because there wasn't an active transaction after some DDL was
executed.

While a better solution might involve splitting this migration into several so each
one is only DDL or only data manipulation, I don't think that can be done very
easily while maintaining compatibility with existing deployments.

Fixes #3229.
This commit is contained in:
Peter Marheine 2021-04-21 13:37:11 +10:00 committed by GitHub
parent b0995f6458
commit db64f54010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,6 @@ class StoreNodeTokensAsEncryptedValue extends Migration
$table->text('daemon_token')->change();
});
DB::transaction(function () {
/** @var \Illuminate\Contracts\Encryption\Encrypter $encrypter */
$encrypter = Container::getInstance()->make(Encrypter::class);
@ -45,7 +44,6 @@ class StoreNodeTokensAsEncryptedValue extends Migration
$datum->id,
]);
}
});
Schema::table('nodes', function (Blueprint $table) {
$table->unique(['uuid']);