Skip to content

Instantly share code, notes, and snippets.

@bradfordw
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradfordw/c7fa988dc420892d57c9 to your computer and use it in GitHub Desktop.
Save bradfordw/c7fa988dc420892d57c9 to your computer and use it in GitHub Desktop.
MySQL
create table webmasters (
id int(11) unsigned primary key auto_increment not null,
email varchar(255) not null,
password varchar(255) not null);
create table stats (
id int(11) unsigned primary key auto_increment not null,
webmaster_id int(11) unsigned not null,
widget_id int(11) unsigned not null,
uniq int(11) unsigned null default 0,
raw int(11) unsigned null default 0,
sales int(11) unsigned null default 0,
date date not null);
PostgreSQL
CREATE TABLE webmasters
(
id serial NOT NULL,
password character varying(255) NOT NULL,
email character varying(255) NOT NULL,
CONSTRAINT webmasters_pkey PRIMARY KEY (id),
CONSTRAINT webmasters_email_key UNIQUE (email)
)
CREATE TABLE stats
(
id serial NOT NULL,
webmaster_id integer NOT NULL,
widget_id integer NOT NULL,
uniq integer NOT NULL,
"raw" integer NOT NULL,
sales integer NOT NULL,
date date NOT NULL,
CONSTRAINT stats_pkey PRIMARY KEY (id)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment