Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions samples/StateMachine/Trax.Samples.StateMachine.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@

var connectionString =
builder.Configuration.GetConnectionString("TraxDatabase")
?? "Host=localhost;Port=5432;Database=trax_statemachine;Username=trax;Password=trax123";

// Create the sample database + snapshot tables before AddTrax (see SnapshotSchema).
await SnapshotSchema.EnsureAsync(connectionString);
?? "Host=localhost;Port=5432;Database=trax;Username=trax;Password=trax123";

builder.Services.AddLogging(logging => logging.AddConsole());

Expand All @@ -75,7 +72,9 @@
builder.Services.AddScoped<ISnapshotPrincipal, TraxCallerSnapshotPrincipal>();
builder.Services.AddScoped<ICharge, LoggingCharge>();

// The snapshot store's DbContext (snapshot_draft + effect_claim tables).
// The snapshot store's DbContext. The snapshot_draft + effect_claim tables are created by the
// Trax migration set: UsePostgres above runs DbUp, which applies 040_state_machine_snapshots.sql.
// Nothing here creates tables — `docker compose up -d` (a `trax` database) is all that's needed.
builder.Services.AddDbContext<SnapshotDbContext>(options => options.UseNpgsql(connectionString));

builder.Services.AddTraxGraphQL(graphql => graphql);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"TraxDatabase": "Host=localhost;Port=5432;Database=trax_statemachine;Username=trax;Password=trax123"
"TraxDatabase": "Host=localhost;Port=5432;Database=trax;Username=trax;Password=trax123"
},
"Logging": {
"LogLevel": {
Expand Down
Loading