Skip to content

Instantly share code, notes, and snippets.

@qcom
Created September 15, 2014 22:36
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 qcom/14c7e106d3b96ecd373b to your computer and use it in GitHub Desktop.
Save qcom/14c7e106d3b96ecd373b to your computer and use it in GitHub Desktop.
CREATE TYPE feedback_type AS ENUM('rolloffs', 'waste', 'hauling', 'commerical', 'residential');
CREATE TABLE IF NOT EXISTS company_feedback (
id serial PRIMARY KEY,
company integer REFERENCES companies(id) NOT NULL,
ip text NOT NULL,
"type" feedback_type NOT NULL,
affirmative boolean NOT NULL
);
CREATE UNIQUE INDEX limit_feedback ON company_feedback (company, ip, "type");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment