Skip to content

Instantly share code, notes, and snippets.

@gbrl
Created June 21, 2016 03:16
Show Gist options
  • Save gbrl/3d1dd97a093582e22313bdfbc5864318 to your computer and use it in GitHub Desktop.
Save gbrl/3d1dd97a093582e22313bdfbc5864318 to your computer and use it in GitHub Desktop.
CREATE TABLE users (
phone char(13),
active boolean,
frequency integer,
news_weight integer,
entertainment_weight integer,
facts_weight integer,
romance_weight integer,
);
CREATE TABLE prompts (
content text,
category char(13),
domain varchar,
url varchar,
ups integer
);
CREATE TABLE bursts (
user_id integer,
prompt_ids integer[],
sent boolean default FALSE,
sent_at date,
created_at date
);
CREATE TABLE histories (
user_id integer,
prompt_id integer
);
And add an ID column to bursts
ALTER TABLE bursts ADD COLUMN id SERIAL PRIMARY KEY;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment