Skip to content

Instantly share code, notes, and snippets.

@andreybolonin
Last active May 28, 2019 14:07
Show Gist options
  • Save andreybolonin/fae9e9917a5acf1708f553e1753fbc91 to your computer and use it in GitHub Desktop.
Save andreybolonin/fae9e9917a5acf1708f553e1753fbc91 to your computer and use it in GitHub Desktop.
CREATE SEQUENCE article_id_seq;
CREATE TABLE article (
id int NOT NULL DEFAULT nextval('article_id_seq'),
name varchar(255) NOT NULL,
description text NOT NULL,
created_at TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
ALTER SEQUENCE article_id_seq
OWNED BY article.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment