Skip to content

Commit

Permalink
Don't wrap SQL with a transaction because I can't alter or create sto…
Browse files Browse the repository at this point in the history
…red procedure
  • Loading branch information
titouancreach committed Jan 24, 2023
1 parent 62d257a commit 174f90a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Unitee.Migrate/Migrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,9 @@ public static async Task<Result> MigrateAsync<T>(string connectionString, string
{
var sqlraw = File.ReadAllText(migration.Path);

var sqlWithTrans = $@"
BEGIN TRANSACTION;
{sqlraw}
COMMIT;";

try
{
await conn.ExecuteAsync(sqlWithTrans);
await conn.ExecuteAsync(sqlraw);

conn.Execute("UPDATE schema_migrations SET version = @version, dirty = 0", new { version = $"{migration.MigrationVersion}" });
} catch (SqlException e)
Expand Down

0 comments on commit 174f90a

Please sign in to comment.