-
Notifications
You must be signed in to change notification settings - Fork 104
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
ac34ab3
commit 8e8bf09
Showing
3 changed files
with
48 additions
and
2 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
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
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,33 @@ | ||
var db = require('./db') | ||
|
||
exports.up = function (next) { | ||
var sql = [ | ||
`CREATE TYPE machine_action AS ENUM ( | ||
'rename', | ||
'empty-cash-in-bills', | ||
'reset-cash-out-bills', | ||
'set-cassette-bills', | ||
'unpair', | ||
'reboot', | ||
'shutdown', | ||
'restart-services', | ||
'edit-location', | ||
'delete-location', | ||
'create-location' | ||
)`, | ||
`CREATE TABLE machine_action_logs ( | ||
id UUID PRIMARY KEY, | ||
device_id TEXT NOT NULL REFERENCES devices(device_id), | ||
action machine_action NOT NULL, | ||
values JSONB NOT NULL, | ||
performed_by UUID NOT NULL REFERENCES users(id), | ||
performed_at TIMESTAMPTZ NOT NULL DEFAULT now() | ||
)` | ||
] | ||
|
||
db.multi(sql, next) | ||
} | ||
|
||
exports.down = function (next) { | ||
next() | ||
} |