Skip to content

Commit

Permalink
Add params for AddChangefeed
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikvindshoj committed Oct 28, 2024
1 parent a5c7ae5 commit c9d941d
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions dotnet/VippsMobilePay.Changefeed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,9 @@ This package is intended for projects that already use [DbUp](https://dbup.githu

```csharp
var upgradeEngine = DeployChanges.To.SqlDatabase(_connectionString)
.AddChangefeedMigrationSource()
.AddChangefeedMigrationSource(tableName: "EventSource", outbox: true, blocking: false)
.WithScriptsEmbeddedInAssembly(typeof(IDbUpAssemblyMarker).Assembly)
.Build();

var upgradeResult = upgradeEngine.PerformUpgrade();
```

### Important Notes

- This configuration only prepares your database for the required changefeed tables. It does **not** create any tables by itself.
- Each database requires a custom setup for changefeed functionality, including executing a stored procedure provided by `mssql-changefeed`.
- Ensure that `AddChangefeedMigrationSource` appears before `WithScriptsEmbeddedInAssembly` in your chain of commands, as this order is essential for proper execution.

To create the `mssql-changefeed` tables, add the setup script alongside other SQL scripts in your DbUp project. Here’s an example script to initialize changefeed tables:

```sql
DECLARE @RC int
DECLARE @table_name nvarchar(max) = 'EventSource'
DECLARE @outbox bit = 1
DECLARE @blocking bit = 0

EXECUTE @RC = [changefeed].[setup_feed]
@table_name
,@outbox
,@blocking
GO
```
```

0 comments on commit c9d941d

Please sign in to comment.