1+ CREATE TABLE IF NOT EXISTS actions(
2+ -- The ID of the action.
3+ id INTEGER PRIMARY KEY ,
4+
5+ -- The session ID of the session that this action is associated with.
6+ -- This may be null for actions that are not coupled to a session.
7+ session_id BIGINT REFERENCES sessions(id) ON DELETE CASCADE ,
8+
9+ -- The account ID of the account that this action is associated with.
10+ -- This may be null for actions that are not coupled to an account.
11+ account_id BIGINT REFERENCES accounts(id) ON DELETE CASCADE ,
12+
13+ -- An ID derived from the macaroon used to perform the action.
14+ macaroon_identifier BLOB,
15+
16+ -- The name of the entity who performed the action.
17+ actor_name TEXT ,
18+
19+ -- The name of the feature that the action is being performed by.
20+ feature_name TEXT ,
21+
22+ -- Meta info detailing what caused this action to be executed.
23+ trigger TEXT ,
24+
25+ -- Meta info detailing what the intended outcome of this action will be.
26+ intent TEXT ,
27+
28+ -- Extra structured JSON data that an actor can send along with the
29+ -- action as json.
30+ structured_json_data TEXT ,
31+
32+ -- The method URI that was called.
33+ rpc_method TEXT NOT NULL ,
34+
35+ -- The method parameters of the request in JSON form.
36+ rpc_params_json BLOB,
37+
38+ -- The time at which this action was created.
39+ created_at TIMESTAMP NOT NULL ,
40+
41+ -- The current state of the action.
42+ state SMALLINT NOT NULL ,
43+
44+ -- Human-readable reason for why the action failed.
45+ -- It will only be set if state is ActionStateError (3).
46+ error_reason TEXT
47+ );
48+
49+ CREATE INDEX IF NOT EXISTS actions_state_idx ON actions(state);
50+ CREATE INDEX IF NOT EXISTS actions_session_id_idx ON actions(session_id);
51+ CREATE INDEX IF NOT EXISTS actions_feature_name_idx ON actions(feature_name);
52+ CREATE INDEX IF NOT EXISTS actions_created_at_idx ON actions(created_at);
0 commit comments