v12.0.0 - initial commit
This commit is contained in:
commit
e2c49ea43c
1145 changed files with 97211 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
var db = require('./db')
|
||||
var { defaultMachineGroup } = require('../lib/constants')
|
||||
|
||||
exports.up = function (next) {
|
||||
const sql = [
|
||||
`create table machine_groups (
|
||||
id uuid PRIMARY KEY,
|
||||
name text UNIQUE NOT NULL
|
||||
)`,
|
||||
`insert into machine_groups (id, name) VALUES ('${defaultMachineGroup.uuid}','${defaultMachineGroup.name}')`,
|
||||
`alter table devices add column machine_group_id uuid references machine_groups (id) DEFAULT '${defaultMachineGroup.uuid}' NOT NULL`,
|
||||
]
|
||||
db.runAll(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue