Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Sep 13, 2023
1 parent aea10c8 commit 80164f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/datastore/datastore_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ func (r *Repository) Update(ctx context.Context, dataStore DataStore) (DataStore
}
defer tx.Rollback()

_, err = tx.ExecContext(ctx, deleteQuery, DataStoreSingleID)
query, params := sqlutil.Tenant(ctx, deleteQuery, DataStoreSingleID)
_, err = tx.ExecContext(ctx, query, params...)
if err != nil {
return DataStore{}, fmt.Errorf("datastore repository sql exec delete: %w", err)
}
Expand Down
3 changes: 3 additions & 0 deletions server/migrations/33_add_composite_pkey.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE data_stores
DROP CONSTRAINT data_stores_pkey,
ADD PRIMARY KEY (id);
3 changes: 3 additions & 0 deletions server/migrations/33_add_composite_pkey.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE data_stores
DROP CONSTRAINT data_stores_pkey,
ADD PRIMARY KEY (id, tenant_id);

0 comments on commit 80164f7

Please sign in to comment.