Sessions carry an org; listing, reading and writing a session, its messages and its turns are limited to the caller's org. Another org's session reads as not found and cannot be overwritten or appended to. Sessions from before orgs belong to the system org.
13 lines
371 B
SQL
13 lines
371 B
SQL
-- A chat session belongs to one org; its messages and turns are reached only
|
|
-- through it. Sessions from before orgs belong to the system org.
|
|
|
|
-- +goose Up
|
|
|
|
ALTER TABLE sessions ADD COLUMN org_id text NOT NULL DEFAULT 'org-sys';
|
|
CREATE INDEX idx_sessions_org ON sessions (org_id);
|
|
|
|
-- +goose Down
|
|
|
|
DROP INDEX idx_sessions_org;
|
|
ALTER TABLE sessions DROP COLUMN org_id;
|