Skip to content

Commit

Permalink
Updated migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
aneshas committed Apr 26, 2023
1 parent dcddd24 commit fe106b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected IntegrationTest()
{
var conn = NpgsqlDataSource.Create(CreateDb());

new EventStoreMigrator(conn.CreateConnection()).EnsureEventStoreCreated();
new EventStoreMigrator(conn).EnsureEventStoreCreated();

EventStore = new EventStore(conn);
OffsetTracker = new PostgresOffsetTracker(conn);
Expand Down
6 changes: 3 additions & 3 deletions Tactical.DDD.EventSourcing.Postgres/EventStoreMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ namespace Tactical.DDD.EventSourcing.Postgres
{
public sealed class EventStoreMigrator
{
private readonly NpgsqlConnection _conn;
private readonly NpgsqlDataSource _conn;

public EventStoreMigrator(NpgsqlConnection conn)
public EventStoreMigrator(NpgsqlDataSource conn)
{
_conn = conn;
}

public void EnsureEventStoreCreated() =>
_conn.Execute(Script());
_conn.CreateConnection().Execute(Script());

private string Script()
{
Expand Down

0 comments on commit fe106b8

Please sign in to comment.