mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 12:16:54 +00:00
fix(db): add FK constraints, indexes, transaction fixes, and hook_executions tenant isolation (migrations 082-083) (#1246)
Co-authored-by: Bruno Clermont <bruno.clermont@gmail.com>
This commit is contained in:
1 parent
c31dd21934
commit
756c4dce71
12 files changed
+397
-27
No files matched your search
@@ -438,6 +438,7 @@ func (d *stdDispatcher) writeExec(ctx context.Context, cfg HookConfig, ev Event,
|
||||
exec := HookExecution{
|
||||
ID: uuid.New(),
|
||||
HookID: &hookID,
|
||||
TenantID: &ev.TenantID,
|
||||
SessionID: ev.SessionID,
|
||||
Event: ev.HookEvent,
|
||||
InputHash: inputHash,
|
||||
|
||||
@@ -186,7 +186,8 @@ type HookConfig struct {
|
||||
// error_detail (BYTEA) is AES-256-GCM encrypted before storage.
|
||||
type HookExecution struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
HookID *uuid.UUID `json:"hook_id,omitempty"` // NULL when hook deleted (ON DELETE SET NULL)
|
||||
HookID *uuid.UUID `json:"hook_id,omitempty"` // NULL when hook deleted (ON DELETE SET NULL)
|
||||
TenantID *uuid.UUID `json:"tenant_id,omitempty"`
|
||||
SessionID string `json:"session_id"`
|
||||
Event HookEvent `json:"event"`
|
||||
InputHash string `json:"input_hash"` // canonical-JSON sha256, 64 hex chars
|
||||
|
||||
Reference in new issue
Block a user