Skip to content

Commit

Permalink
Sync changes from TRS DB into DQT reporting database
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Aug 7, 2024
1 parent 62b88f5 commit 9266eef
Show file tree
Hide file tree
Showing 15 changed files with 4,911 additions and 44 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ just install-tools
Install Postgres then set a connection string configuration entry in user secrets for running the apps and another for running the tests.
Note you should use a different database for tests as the test database will be cleared down whenever tests are run.

The server's `wal_level` must be set to `logical`:
```
ALTER SYSTEM SET wal_level = logical;
```
You may have to restart the server after amending this configuration.

e.g.
```shell
just set-secret ConnectionStrings:DefaultConnection "Host=localhost;Username=postgres;Password=your_postgres_password;Database=trs"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
using TeachingRecordSystem.Core.Services.DqtReporting;

#nullable disable

namespace TeachingRecordSystem.Core.DataStore.Postgres.Migrations
{
/// <inheritdoc />
public partial class DqtReportingSyncPublication : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql($"CREATE PUBLICATION {DqtReportingService.TrsDbPublicationName} FOR TABLE qualifications;");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql($"DROP PUBLICATION {DqtReportingService.TrsDbPublicationName};");
}
}
}
Loading

0 comments on commit 9266eef

Please sign in to comment.