Last active
December 28, 2015 10:19
-
-
Save charyorde/7485159 to your computer and use it in GitHub Desktop.
Create postgres table
This file contains 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 jivevideoviewhistory | |
( | |
objectid integer NOT NULL, | |
objecttype integer NOT NULL, | |
dateviewed bigint NOT NULL, | |
viewcount bigint DEFAULT 0, | |
userid bigint, | |
expirydate bigint NOT NULL, | |
CONSTRAINT jivevideoviewhistory_pkey PRIMARY KEY (objectid, objecttype) | |
) | |
WITH ( | |
OIDS=FALSE | |
); | |
ALTER TABLE jivevideoviewhistory | |
OWNER TO postgres; | |
// with autoincrement field | |
CREATE TABLE jivevideoviewhistory | |
( | |
viewhistid serial NOT NULL, | |
objectid bigint, | |
objecttype integer, | |
dateviewed bigint NOT NULL, | |
viewcount bigint NOT NULL, | |
userid bigint NOT NULL, | |
expirydate bigint NOT NULL | |
) | |
WITH ( | |
OIDS=FALSE | |
); | |
ALTER TABLE | |
jivevideoviewhistory | |
OWNER TO postgres; | |
// stable | |
CREATE TABLE jivevideoviewhistory | |
( | |
viewhistid serial NOT NULL, | |
objectid bigint, | |
objecttype integer, | |
dateviewed bigint NOT NULL, | |
viewcount bigint NOT NULL, | |
userid bigint NOT NULL, | |
expirydate bigint NOT NULL, | |
CONSTRAINT jivevideoviewhistory_pkey PRIMARY KEY (viewhistid) | |
) | |
WITH ( | |
OIDS=FALSE | |
); | |
ALTER TABLE jivevideoviewhistory | |
OWNER TO postgres; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment