-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec1439e
commit e55c848
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
exports.up = function (db, cb) { | ||
db.runSql( | ||
` | ||
CREATE TABLE IF NOT EXISTS action_states | ||
( | ||
id SERIAL PRIMARY KEY NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), | ||
state VARCHAR(255) NOT NULL, | ||
details VARCHAR(255), | ||
action_id INTEGER NOT NULL, | ||
observable_event_id INTEGER NOT NULL, | ||
FOREIGN KEY (observable_event_id) references observable_events(id), | ||
FOREIGN KEY (action_id) references actions(id) | ||
); | ||
`, | ||
cb, | ||
); | ||
}; | ||
|
||
exports.down = function (db, cb) { | ||
db.runSql( | ||
` | ||
DROP INDEX IF EXISTS idx_state_to_observable_event_id; | ||
DROP TABLE IF EXISTS action_states; | ||
`, | ||
cb, | ||
); | ||
}; |