This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
columns = ctx.map(m => m.cs().columns.map(c => c.name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promise = require('bluebird') | |
const _ = require('lodash') | |
const argv = require('minimist')(process.argv.slice(2)) | |
const config = require('../config/database.json')[argv.e] | |
const options = { promiseLib: promise } | |
const pgp = require('pg-promise')(options) | |
const db = pgp(config) | |
const sql = require('../sql') | |
module.exports = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 1, | |
"leads": [ | |
{ | |
"id": 1, | |
"name": "Mike Cox", | |
"type": "lead", | |
"proj_name": "Proj 1" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE projs ( | |
id serial PRIMARY KEY, | |
parent_id integer, | |
type text, | |
proj_name text, | |
proj_desc text, | |
proj_loc text, | |
proj_start date, | |
proj_duration integer, | |
attributes jsonb, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO projects | |
(type, proj_name, proj_desc, proj_loc, proj_start, proj_duration) | |
VALUES | |
('project', 'Proj 1', 'project one stuff', 'ruby mountains', '2015-01-01', 3), | |
('project', 'Proj 2', 'project two stuff', 'ruby mountains', '2015-01-01', 2), | |
('project', 'Proj 3', 'project three stuff', 'ruby mountains', '2015-10-01', 4), | |
('stage', 'Proj 1, Stage 1', 'stage 1 proj 1', 'southern ruby', '2015-01-01', 1), | |
('stage', 'Proj 1, Stage 2', 'stage 1 proj 2', 'southern ruby', '2016-01-01', 1), | |
('stage', 'Proj 1, Stage 3', 'stage 1 proj 3', 'southern ruby', '2017-01-01', 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE projects ( | |
id serial PRIMARY KEY, | |
type text, | |
proj_name text, | |
proj_desc text, | |
proj_loc text, | |
proj_start date, | |
proj_duration integer, | |
attributes jsonb, | |
created_at timestamp with time zone DEFAULT now(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const sql = require('../sql').elements | |
const helpers = require('pg-promise')().helpers | |
const cs = new helpers.ColumnSet([ | |
'?id', | |
{ | |
name: 'animal_id' | |
}, { | |
name: 'species_id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="card"> | |
<h4 class="card-header" @click="toggleVisibility('')"> | |
"" | |
</h4> | |
<div class="card-block" v-if=""> | |
<div class="p-card" v-for="" v-bind:class="{ 'p-card-odd': oddIndex(index) }"> | |
<div class="p-card-header"> | |
<button type="button" class="close" @click="deleteDynElement('', index)"> | |
<span>×</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1.4 example | |
-- restaurants | |
CREATE TABLE lu_franchises ( | |
id char(3) PRIMARY KEY, | |
franchise varchar(30) | |
); | |
-- creating lookup table | |
INSERT INTO lu_franchises(id, franchise) | |
VALUES |