Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

schwifty-migration

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schwifty-migration

A hapi plugin to aid migration for schwifty models

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

schwifty-migration

An Objection.js model migration tool for use during development

Build Status Coverage Status Security Status

Getting Started

  • Run npm install
  • Install the right version of 'schwifty'
npm install git+https://github.com/BigRoomStudios/schwifty.git#add-schwifty-migration
  • Install 'schwifty-migration'
npm install git+https://github.com/BigRoomStudios/schwifty-migration.git
  • Create an npm 'migrate' script so that schwifty's migrationsMode plugin option is set to either 'create' or 'alter'.

Ex.

// package.json
"scripts": {
    "migrate": "MIGRATE=alter npm start"
}
  • Now Go to where schwifty gets registered on your server (server/manifest.js for example), and add the migrationsMode plugin option.

Ex.

$base: {
    migrateOnStart: true,
+   migrationsMode: process.env.MIGRATE,
    knex: {
        client: 'sqlite3',
        useNullAsDefault: true,
        connection: {
            filename: ':memory:'
        }
    }
}
  • If all goes well, the process will stop and the generated migration file location will be printed to the console. It'll look like this:
//////////////////////////
/////// Success! /////////
Generated new migration file:

/Users/$(whoami)/path/to/migrations/20170817143549_schwifty-migration.js
  • Pro-tip: Triple click the line with the filepath, copy, then run atom + paste in terminal to edit the file in Atom.

Keywords

hapi

FAQs

Package last updated on 14 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts