mirror of
https://github.com/bitwarden/server
synced 2026-01-01 16:13:33 +00:00
Add variable for production migration transaction level (#4702)
* Addd variable for production migration transaction level
* Added variable for production migration transaction level with default value
* Clean up comments
* Removed uneeded directive
* Changed time format for timeout on migration
* white space formatting
* white space formatting again
* white space formatting once again
* white space formatting once again
* clean up
* CHnaged to builder.WithoutTransaction()
* Changed to optyion flag from n to nt for notransaction
* Changed to optyion flag from n to no-transaction for without transaction
* Change desription of option
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
(cherry picked from commit b38b537ed1)
This commit is contained in:
@@ -17,13 +17,15 @@ internal class Program
|
||||
[Option('f', "folder", Description = "Folder name of database scripts")]
|
||||
string folderName = MigratorConstants.DefaultMigrationsFolderName,
|
||||
[Option('d', "dry-run", Description = "Print the scripts that will be applied without actually executing them")]
|
||||
bool dryRun = false
|
||||
) => MigrateDatabase(databaseConnectionString, repeatable, folderName, dryRun);
|
||||
bool dryRun = false,
|
||||
[Option("no-transaction", Description = "Run without adding transaction per script or all scripts")]
|
||||
bool noTransactionMigration = false
|
||||
) => MigrateDatabase(databaseConnectionString, repeatable, folderName, dryRun, noTransactionMigration);
|
||||
|
||||
private static bool MigrateDatabase(string databaseConnectionString,
|
||||
bool repeatable = false, string folderName = "", bool dryRun = false)
|
||||
bool repeatable = false, string folderName = "", bool dryRun = false, bool noTransactionMigration = false)
|
||||
{
|
||||
var migrator = new DbMigrator(databaseConnectionString);
|
||||
var migrator = new DbMigrator(databaseConnectionString, noTransactionMigration: noTransactionMigration);
|
||||
bool success;
|
||||
if (!string.IsNullOrWhiteSpace(folderName))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user