Merge pull request #59 from globekeeper/daniel/public-visibility

🐛 Migration to have the correct composite primary key in roomserver_p…
This commit is contained in:
Daniel Aloni 2023-01-04 15:40:49 +02:00 committed by GitHub
commit 8dd9640727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,13 @@ func UpPulishedAppservice(ctx context.Context, tx *sql.Tx) error {
if err != nil {
return fmt.Errorf("failed to execute upgrade: %w", err)
}
_, err = tx.ExecContext(ctx, `
ALTER TABLE roomserver_published DROP CONSTRAINT IF EXISTS roomserver_published_pkey;
ALTER TABLE roomserver_published ADD PRIMARY KEY (room_id, appservice_id, network_id);
`)
if err != nil {
return fmt.Errorf("failed to execute upgrade: %w", err)
}
return nil
}