0.1.6 • Published 5 years ago

guff v0.1.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Guff extends the functionality of Knex with special column types and extra utilities for building out your schemas (e.g. triggers and functions).

Requirements

const guff = require('guff')

const TABLE = 'accounts'
exports.TABLE = TABLE

exports.up = function (knex, Promise) {
  return guff.createTable(
    knex,
    TABLE, [
      guff.col('uid').primary(),
      guff.col('email').unique().notNullable(),
      guff.col('password', 'text').notNullable(),
      guff.col('key'),
      guff.col('oauth_providers', 'jsonb'),
      guff.col('join_ip', 'ip').notNullable(),
      guff.col('last_ip', 'ip').notNullable(),
      guff.col('activated', 'boolean').defaultTo(false).notNullable(),
      guff.col('created_at'),
      guff.col('updated_at')
    ]
  )
}

exports.down = function (knex) {
  return guff.dropTable(knex, TABLE)
}
0.1.6

5 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.1.0-beta.0

6 years ago