fix typo with isntance and timestamps
This commit is contained in:
parent
6d44a5de5e
commit
d0bc63a0de
@ -1,7 +1,7 @@
|
|||||||
exports.up = async knex => {
|
exports.up = async knex => {
|
||||||
return knex.schema.createTable('accounts', table => {
|
return knex.schema.createTable('accounts', table => {
|
||||||
table.uuid('id').primary();
|
table.uuid('id').primary();
|
||||||
table.timestamps();
|
table.timestamps(true, true);
|
||||||
table.string('name', 42).notNullable().unique();
|
table.string('name', 42).notNullable().unique();
|
||||||
table.string('password').notNullable();
|
table.string('password').notNullable();
|
||||||
table.string('token', 64).notNullable();
|
table.string('token', 64).notNullable();
|
||||||
|
|||||||
@ -4,14 +4,14 @@ exports.up = async knex => {
|
|||||||
await knex.schema.createTable('games', table => {
|
await knex.schema.createTable('games', table => {
|
||||||
table.uuid('id').primary();
|
table.uuid('id').primary();
|
||||||
table.index('id');
|
table.index('id');
|
||||||
table.timestamps();
|
table.timestamps(true, true);
|
||||||
table.binary('data').notNullable();
|
table.binary('data').notNullable();
|
||||||
});
|
});
|
||||||
|
|
||||||
await knex.schema.createTable('instances', async table => {
|
await knex.schema.createTable('instances', async table => {
|
||||||
table.uuid('id').primary();
|
table.uuid('id').primary();
|
||||||
table.index('id');
|
table.index('id');
|
||||||
table.timestamps();
|
table.timestamps(true, true);
|
||||||
|
|
||||||
table.binary('data').notNullable();
|
table.binary('data').notNullable();
|
||||||
table.boolean('open')
|
table.boolean('open')
|
||||||
|
|||||||
@ -2,7 +2,7 @@ exports.up = async knex => {
|
|||||||
await knex.schema.createTable('zones', async (table) => {
|
await knex.schema.createTable('zones', async (table) => {
|
||||||
table.uuid('id').primary();
|
table.uuid('id').primary();
|
||||||
table.index('id');
|
table.index('id');
|
||||||
table.timestamps();
|
table.timestamps(true, true);
|
||||||
|
|
||||||
table.binary('data').notNullable();
|
table.binary('data').notNullable();
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ pub fn instance_write(instance: Instance, tx: &mut Transaction) -> Result<Instan
|
|||||||
let instance_bytes = to_vec(&instance)?;
|
let instance_bytes = to_vec(&instance)?;
|
||||||
|
|
||||||
let query = "
|
let query = "
|
||||||
UPDATE instance
|
UPDATE instances
|
||||||
SET data = $1
|
SET data = $1
|
||||||
WHERE id = $2
|
WHERE id = $2
|
||||||
RETURNING id, data;
|
RETURNING id, data;
|
||||||
@ -84,7 +84,7 @@ pub fn instance_write(instance: Instance, tx: &mut Transaction) -> Result<Instan
|
|||||||
pub fn instance_get(tx: &mut Transaction, instance_id: Uuid) -> Result<Instance, Error> {
|
pub fn instance_get(tx: &mut Transaction, instance_id: Uuid) -> Result<Instance, Error> {
|
||||||
let query = "
|
let query = "
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM instance
|
FROM instances
|
||||||
WHERE id = $1;
|
WHERE id = $1;
|
||||||
";
|
";
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ pub fn instance_get(tx: &mut Transaction, instance_id: Uuid) -> Result<Instance,
|
|||||||
pub fn instance_get_open(tx: &mut Transaction) -> Result<Instance, Error> {
|
pub fn instance_get_open(tx: &mut Transaction) -> Result<Instance, Error> {
|
||||||
let query = "
|
let query = "
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM instance
|
FROM instances
|
||||||
WHERE open = true;
|
WHERE open = true;
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user