0.0.1-rc.10 • Published 6 years ago

snake-on-koa v0.0.1-rc.10

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

snake-on-koa

npm

QuickStart

Install

$ npm i snake-on-koa -g

Create Project

$ snake new my-project [-d mysql]
$ cd my-project
$ npm install
$ node run start

default: db is sqlite3

Create Controller

$ snake generate controller admin/orders [index show update delete]

Create Model

$ snake generate model order user:references title:string:index amount:decimal

Op DB

$ [NODE_ENV=development] snake db:create
$ [NODE_ENV=development] snake db:migrate
$ [NODE_ENV=development] snake db:drop

Modify Table | Migration

$ snake generate migration addColumnBirthdayAndAgeToUsers birthday:date age:integer:index
$ snake g migration renameColumnBirthdayToBirthFromUsers
$ snake g migration removeColumnBirthdayFromUsers
$ snake g migration removeIndexAgeFromUsers
$ snake g migration dropTableUsers