postgres/index.js
function createTables() {
  return bluebird.all(getComponents().map(component => client.createTable(`components.${component}`)))
    .then(() => bluebird.all(getLayouts().map(layout => client.createTableWithMeta(`layouts.${layout}`))))
    .then(() => client.createTableWithMeta('pages'))
    .then(() => client.raw('CREATE TABLE IF NOT EXISTS ?? ( id TEXT PRIMARY KEY NOT NULL, data TEXT NOT NULL, url TEXT );', ['uris']))
    .then(() => createRemainingTables());
}
function createTables() {
  return bluebird.all(getComponents().map(component => client.createTable(`components.${component}`)))
    .then(() => bluebird.all(getLayouts().map(layout => client.createTableWithMeta(`layouts.${layout}`))))
    .then(() => client.createTableWithMeta('pages'))
    .then(() => client.raw('CREATE TABLE IF NOT EXISTS ?? ( id TEXT PRIMARY KEY NOT NULL, data TEXT NOT NULL, url TEXT );', ['uris']))
    .then(() => createRemainingTables());
}
function createTables ( ) { return bluebird . all ( getComponents ( ) . map ( component => client . createTable ( ` ${ component } ` ) ) ) . then ( ( ) => bluebird . all ( getLayouts ( ) . map ( layout => client . createTableWithMeta ( ` ${ layout } ` ) ) ) ) . then ( ( ) => client . createTableWithMeta ( 'pages' ) ) . then ( ( ) => client . raw ( 'CREATE TABLE IF NOT EXISTS ?? ( id TEXT PRIMARY KEY NOT NULL, data TEXT NOT NULL, url TEXT );' , [ 'uris' ] ) ) . then ( ( ) => createRemainingTables ( ) ) ; }
Create all tables needed

@return {Promise}
Create all tables needed