zones migration
This commit is contained in:
parent
aa97f82d82
commit
aa27c281e4
28
ops/migrations/20181228162012_zones.js
Normal file
28
ops/migrations/20181228162012_zones.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
exports.up = async knex => {
|
||||||
|
await knex.schema.createTable('zones', async (table) => {
|
||||||
|
table.uuid('id').primary();
|
||||||
|
table.index('id');
|
||||||
|
table.timestamps();
|
||||||
|
|
||||||
|
table.binary('data').notNullable();
|
||||||
|
|
||||||
|
table.boolean('active')
|
||||||
|
.defaultTo(true)
|
||||||
|
.notNullable();
|
||||||
|
|
||||||
|
table.uuid('account').notNullable()
|
||||||
|
table.foreign('account')
|
||||||
|
.references('id')
|
||||||
|
.inTable('accounts')
|
||||||
|
.onDelete('CASCADE');
|
||||||
|
|
||||||
|
table.index('account');
|
||||||
|
|
||||||
|
await knex.schema.raw(
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
'CREATE UNIQUE INDEX zones_account_active ON zones (account) WHERE active = true;'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = async () => {};
|
||||||
@ -316,7 +316,7 @@ impl Rpc {
|
|||||||
return Ok(cryps_list);
|
return Ok(cryps_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn zone_create(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
fn zone_create(_data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||||
// let _msg = from_slice::<ZoneCreateMsg>(&data).or(Err(err_msg("invalid params")))?;
|
// let _msg = from_slice::<ZoneCreateMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||||
|
|
||||||
let response = RpcResponse {
|
let response = RpcResponse {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user