fix typo with isntance and timestamps

This commit is contained in:
ntr 2019-02-22 16:34:57 +11:00
parent 6d44a5de5e
commit d0bc63a0de
4 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
exports.up = async knex => {
return knex.schema.createTable('accounts', table => {
table.uuid('id').primary();
table.timestamps();
table.timestamps(true, true);
table.string('name', 42).notNullable().unique();
table.string('password').notNullable();
table.string('token', 64).notNullable();

View File

@ -4,14 +4,14 @@ exports.up = async knex => {
await knex.schema.createTable('games', table => {
table.uuid('id').primary();
table.index('id');
table.timestamps();
table.timestamps(true, true);
table.binary('data').notNullable();
});
await knex.schema.createTable('instances', async table => {
table.uuid('id').primary();
table.index('id');
table.timestamps();
table.timestamps(true, true);
table.binary('data').notNullable();
table.boolean('open')

View File

@ -2,7 +2,7 @@ exports.up = async knex => {
await knex.schema.createTable('zones', async (table) => {
table.uuid('id').primary();
table.index('id');
table.timestamps();
table.timestamps(true, true);
table.binary('data').notNullable();

View File

@ -65,7 +65,7 @@ pub fn instance_write(instance: Instance, tx: &mut Transaction) -> Result<Instan
let instance_bytes = to_vec(&instance)?;
let query = "
UPDATE instance
UPDATE instances
SET data = $1
WHERE id = $2
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> {
let query = "
SELECT *
FROM instance
FROM instances
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> {
let query = "
SELECT *
FROM instance
FROM instances
WHERE open = true;
";