Skip to content

Instantly share code, notes, and snippets.

@thelinuxlich
Created June 18, 2014 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thelinuxlich/9969d465d07e11ed9c39 to your computer and use it in GitHub Desktop.
Save thelinuxlich/9969d465d07e11ed9c39 to your computer and use it in GitHub Desktop.
Why Koa rox
module.exports = function(r, logger) {
return function * create_database(next) {
yield r.dbDrop("aidax");
yield r.dbCreate("aidax");
yield[
r.tableCreate("clients"),
r.tableCreate("errors"),
r.tableCreate("forms"),
r.tableCreate("hits"),
r.tableCreate("interactions"),
r.tableCreate("scrolls"),
r.tableCreate("sessions"),
r.tableCreate("timings"),
r.tableCreate("visitors")
];
yield r.table("clients").insert({
key: "YOUR_KEY",
domains: []
});
yield next;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment