Skip to content

Instantly share code, notes, and snippets.

@ecthiender
Last active August 13, 2018 06:12
Show Gist options
  • Save ecthiender/0fd7df0207967b2f3bb3cb627790f8e4 to your computer and use it in GitHub Desktop.
Save ecthiender/0fd7df0207967b2f3bb3cb627790f8e4 to your computer and use it in GitHub Desktop.
Sample schema for update mutations
CREATE TABLE author (
id INTEGER PRIMARY KEY,
name TEXT
);
CREATE TABLE article (
id INTEGER PRIMARY KEY,
title TEXT,
content TEXT,
author_id INTEGER,
is_published BOOLEAN DEFAULT FALSE,
published_on TIMESTAMP DEFAULT NOW(),
likes INTEGER DEFAULT 0,
CONSTRAINT author_id_fkey FOREIGN KEY (author_id)
REFERENCES author (id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment