Skip to content

Commit 913a90e

Browse files
authored
Merge pull request #13 from datalust/dev
Release
2 parents 3d122a9 + 85a6fac commit 913a90e

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Piggy uses `$var$` syntax for replaced variables:
6767

6868
```sql
6969
create table $schema$.users (name varchar(140) not null);
70-
insert into users (name) values ('$admin$');
70+
insert into $schema$.users (name) values ('$admin$');
7171
```
7272

7373
Values are inserted using pure text substitution: no escaping or other processing is applied. If no value is supplied for a variable that appears in a script, Piggy will leave the script unchanged (undefined variables will not be replaced with the empty string).

src/Datalust.Piggy/Cli/Commands/UpdateCommand.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
2-
using Datalust.Piggy.Apply;
32
using Datalust.Piggy.Cli.Features;
3+
using Datalust.Piggy.Update;
4+
using Npgsql;
45
using Serilog;
56

67
namespace Datalust.Piggy.Cli.Commands
@@ -50,6 +51,11 @@ protected override int Run()
5051

5152
return 0;
5253
}
54+
catch (PostgresException ex)
55+
{
56+
Log.Fatal("Could not apply change scripts: {Message} ({SqlState})", ex.MessageText, ex.SqlState);
57+
return -1;
58+
}
5359
catch (Exception ex)
5460
{
5561
Log.Fatal(ex, "Could not apply change scripts");

src/Datalust.Piggy/History/AppliedChangeScriptLog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Dapper;
2-
using Datalust.Piggy.Apply;
2+
using Datalust.Piggy.Update;
33
using Npgsql;
44
using Serilog;
55

src/Datalust.Piggy/Update/ChangeScriptFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Datalust.Piggy.Apply
1+
namespace Datalust.Piggy.Update
22
{
33
class ChangeScriptFile
44
{

src/Datalust.Piggy/Update/ChangeScriptFileEnumerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.IO;
33
using System.Linq;
44

5-
namespace Datalust.Piggy.Apply
5+
namespace Datalust.Piggy.Update
66
{
77
static class ChangeScriptFileEnumerator
88
{

src/Datalust.Piggy/Update/UpdateSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Npgsql;
99
using Serilog;
1010

11-
namespace Datalust.Piggy.Apply
11+
namespace Datalust.Piggy.Update
1212
{
1313
static class UpdateSession
1414
{

0 commit comments

Comments
 (0)