You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -77,11 +87,11 @@ EXCEPTION WHEN duplicate_table THEN
77
87
END $$;
78
88
79
89
-- COMMENT ON is idempotent and intentionally outside the DO block.
80
-
COMMENT ON TABLE reference."license_statuses" IS 'Lookup table for license lifecycle states. EXPIRED is intentionally omitted: expiry is a derived state computed at query time from app."licenses"."expires_at". Storing it redundantly would risk inconsistency.';
81
-
COMMENT ON COLUMN reference."license_statuses"."code" IS 'Machine-readable status code (PK). Self-documents FK references in app."licenses". Examples: ACTIVE, REVOKED.';
82
-
COMMENT ON COLUMN reference."license_statuses"."description" IS 'Human-readable explanation of this license state for developers and operators.';
90
+
COMMENT ON TABLE "reference"."license_statuses" IS 'Lookup table for license lifecycle states. EXPIRED is intentionally omitted: expiry is a derived state computed at query time from "app"."licenses"."expires_at". Storing it redundantly would risk inconsistency.';
91
+
COMMENT ON COLUMN "reference"."license_statuses"."code" IS 'Machine-readable status code (PK). Self-documents FK references in "app"."licenses". Examples: ACTIVE, REVOKED.';
92
+
COMMENT ON COLUMN "reference"."license_statuses"."description" IS 'Human-readable explanation of this license state for developers and operators.';
83
93
84
-
INSERT INTO reference."license_statuses" ("code", "description")
COMMENT ON TABLE reference."session_statuses" IS 'Lookup table for session lifecycle states. Derived states (grace period exceeded, license expired) are computed at query time, not stored.';
108
-
COMMENT ON COLUMN reference."session_statuses"."code" IS 'Machine-readable status code (PK). Values: ACTIVE, REVOKED, ZOMBIE, CLEANUP.';
109
-
COMMENT ON COLUMN reference."session_statuses"."description" IS 'Human-readable explanation of this session state for developers and operators.';
117
+
COMMENT ON TABLE "reference"."session_statuses" IS 'Lookup table for session lifecycle states. Derived states (grace period exceeded, license expired) are computed at query time, not stored.';
118
+
COMMENT ON COLUMN "reference"."session_statuses"."code" IS 'Machine-readable status code (PK). Values: ACTIVE, REVOKED, ZOMBIE, CLEANUP.';
119
+
COMMENT ON COLUMN "reference"."session_statuses"."description" IS 'Human-readable explanation of this session state for developers and operators.';
110
120
111
-
INSERT INTO reference."session_statuses" ("code", "description")
COMMENT ON TABLE reference."heartbeat_resp_statuses" IS 'Lookup table for heartbeat response codes returned by the server to the SDK. The server selects a code based on current license and session state; the SDK takes a mandatory action based on the code received.';
136
-
COMMENT ON COLUMN reference."heartbeat_resp_statuses"."code" IS 'Machine-readable response code (PK). Values: CONTINUE, REFRESH, REVOKED, EXPIRED, ERROR.';
137
-
COMMENT ON COLUMN reference."heartbeat_resp_statuses"."description" IS 'Human-readable description of the response code and the SDK action it mandates.';
145
+
COMMENT ON TABLE "reference"."heartbeat_resp_statuses" IS 'Lookup table for heartbeat response codes returned by the server to the SDK. The server selects a code based on current license and session state; the SDK takes a mandatory action based on the code received.';
146
+
COMMENT ON COLUMN "reference"."heartbeat_resp_statuses"."code" IS 'Machine-readable response code (PK). Values: CONTINUE, REFRESH, REVOKED, EXPIRED, ERROR.';
147
+
COMMENT ON COLUMN "reference"."heartbeat_resp_statuses"."description" IS 'Human-readable description of the response code and the SDK action it mandates.';
138
148
139
-
INSERT INTO reference."heartbeat_resp_statuses" ("code", "description")
('CONTINUE', 'License is valid and the session is healthy. SDK should continue normal protected operation with no state change.'),
142
152
('REFRESH', 'The vendor has modified the license configuration since the last heartbeat (e.g. expiry extended, max_grace_secs changed, metadata updated). SDK must re-fetch the current license state and apply it before continuing.'),
@@ -154,19 +164,19 @@ ON CONFLICT ("code") DO NOTHING;
COMMENT ON TABLE reference."error_codes" IS 'Canonical lookup table for business error codes used in API responses and SDK error handling. HTTP status code mapping is handled exclusively in application code and is decoupled from this table.';
166
-
COMMENT ON COLUMN reference."error_codes"."code" IS 'Machine-readable error code constant (PK). Referenced by API responses, SDK error handlers, and log entries.';
167
-
COMMENT ON COLUMN reference."error_codes"."description" IS 'Human-readable explanation of the error condition for developers and operators.';
175
+
COMMENT ON TABLE "reference"."error_codes" IS 'Canonical lookup table for business error codes used in API responses and SDK error handling. HTTP status code mapping is handled exclusively in application code and is decoupled from this table.';
176
+
COMMENT ON COLUMN "reference"."error_codes"."code" IS 'Machine-readable error code constant (PK). Referenced by API responses, SDK error handlers, and log entries.';
177
+
COMMENT ON COLUMN "reference"."error_codes"."description" IS 'Human-readable explanation of the error condition for developers and operators.';
168
178
169
-
INSERT INTO reference."error_codes" ("code", "description")
COMMENT ON TABLE reference."actions" IS 'Lookup table for auditable action verbs recorded in audit."auditLogs". Codes are broadly resource-agnostic; the affected resource is captured in audit junction tables (audit."auditLogLicenses", audit."auditLogSessions", etc.). HEARTBEAT_ERROR is an intentional exception: it is heartbeat-specific by nature.';
207
-
COMMENT ON COLUMN reference."actions"."code" IS 'Machine-readable action verb (PK). Examples: CREATED, MODIFIED, REVOKED, DELETED.';
208
-
COMMENT ON COLUMN reference."actions"."description" IS 'Human-readable description of what this action represents in the system.';
223
+
COMMENT ON TABLE "reference"."actions" IS 'Lookup table for auditable action verbs recorded in "audit"."audit_logs". Codes are broadly resource-agnostic; the affected resource is captured in audit junction tables ("audit"."audit_log_licenses", "audit"."audit_log_sessions", etc.). Exceptions (HEARTBEAT_ERROR, PASSWORD_CHANGED, TOKEN_ROTATED, etc.) are heartbeat- or auth-flow-specific by nature and are documented in the migration file header.';
224
+
COMMENT ON COLUMN "reference"."actions"."code" IS 'Machine-readable action verb (PK). Examples: CREATED, MODIFIED, REVOKED, DELETED.';
225
+
COMMENT ON COLUMN "reference"."actions"."description" IS 'Human-readable description of what this action represents in the system.';
209
226
210
-
INSERT INTO reference."actions" ("code", "description")
0 commit comments