From d2a5d363674d2a147234280ed0b552aba6acd32d Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 24 Feb 2014 16:38:57 +0000 Subject: [PATCH] for contact db update --- Toolkit/Contacts/Database/data/contact.sql | 63 ---------------- .../Contacts/Database/data/contact_inq.sql | 74 ------------------- .../Contacts/Database/data/news_response.sql | 44 ----------- Toolkit/Contacts/Database/data/query_db.sql | 36 --------- Toolkit/Contacts/Database/dbDump.sh | 2 +- Toolkit/Contacts/Database/loadData.sql | 4 +- 6 files changed, 4 insertions(+), 219 deletions(-) diff --git a/Toolkit/Contacts/Database/data/contact.sql b/Toolkit/Contacts/Database/data/contact.sql index 2289ff9..1f9d70c 100644 --- a/Toolkit/Contacts/Database/data/contact.sql +++ b/Toolkit/Contacts/Database/data/contact.sql @@ -11,52 +11,6 @@ SET escape_string_warning = off; SET search_path = public, pg_catalog; -SET default_tablespace = ''; - -SET default_with_oids = true; - --- --- Name: contact; Type: TABLE; Schema: public; Owner: postgres; Tablespace: --- - -CREATE TABLE contact ( - id integer DEFAULT nextval(('"contact_id_seq"'::text)::regclass) NOT NULL, - create_date date DEFAULT now(), - fname text, - lname text, - address text, - city text, - state text, - zip text, - country text, - phone text, - fax text, - email text, - user_agent text, - remote_addr text, - mail_ok boolean, - referred_by integer, - unit_size integer, - questions text, - arrive_date date, - depart_date date, - other text, - interest text, - contestant boolean, - contact_type text, - number_of_golfers text, - number_of_non_golfers text, - number_of_couples text, - number_of_singles text, - number_of_golfers_2 text, - tee_time text, - phone2 text, - courses text -); - - -ALTER TABLE public.contact OWNER TO postgres; - -- -- Data for Name: contact; Type: TABLE DATA; Schema: public; Owner: postgres -- @@ -7176,23 +7130,6 @@ INSERT INTO contact (id, create_date, fname, lname, address, city, state, zip, c INSERT INTO contact (id, create_date, fname, lname, address, city, state, zip, country, phone, fax, email, user_agent, remote_addr, mail_ok, referred_by, unit_size, questions, arrive_date, depart_date, other, interest, contestant, contact_type, number_of_golfers, number_of_non_golfers, number_of_couples, number_of_singles, number_of_golfers_2, tee_time, phone2, courses) VALUES (10166, '2014-02-23', 'Don', 'Henderson', '15530 Oporto st', 'Livonia', 'MI', '48154', NULL, '7344217835', NULL, 'Dhenders323@aol.com', 'Mozilla/5.0 (iPad; CPU OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53', '162.239.252.135', true, NULL, NULL, NULL, NULL, NULL, NULL, ':10:12:11:22:', NULL, ':2:', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); --- --- Name: contact_id_key; Type: INDEX; Schema: public; Owner: postgres; Tablespace: --- - -CREATE UNIQUE INDEX contact_id_key ON contact USING btree (id); - - --- --- Name: contact; Type: ACL; Schema: public; Owner: postgres --- - -REVOKE ALL ON TABLE contact FROM PUBLIC; -REVOKE ALL ON TABLE contact FROM postgres; -GRANT ALL ON TABLE contact TO postgres; -GRANT ALL ON TABLE contact TO nobody; - - -- -- PostgreSQL database dump complete -- diff --git a/Toolkit/Contacts/Database/data/contact_inq.sql b/Toolkit/Contacts/Database/data/contact_inq.sql index ae391d1..1abb511 100644 --- a/Toolkit/Contacts/Database/data/contact_inq.sql +++ b/Toolkit/Contacts/Database/data/contact_inq.sql @@ -11,52 +11,6 @@ SET escape_string_warning = off; SET search_path = public, pg_catalog; -SET default_tablespace = ''; - -SET default_with_oids = true; - --- --- Name: contact_inq; Type: TABLE; Schema: public; Owner: postgres; Tablespace: --- - -CREATE TABLE contact_inq ( - id integer NOT NULL, - header text, - pos integer, - description text, - image text -); - - -ALTER TABLE public.contact_inq OWNER TO postgres; - --- --- Name: contact_inq_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE contact_inq_id_seq - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.contact_inq_id_seq OWNER TO postgres; - --- --- Name: contact_inq_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE contact_inq_id_seq OWNED BY contact_inq.id; - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY contact_inq ALTER COLUMN id SET DEFAULT nextval('contact_inq_id_seq'::regclass); - - -- -- Data for Name: contact_inq; Type: TABLE DATA; Schema: public; Owner: postgres -- @@ -88,34 +42,6 @@ INSERT INTO contact_inq (id, header, pos, description, image) VALUES (29, 'Boati SELECT pg_catalog.setval('contact_inq_id_seq', 29, true); --- --- Name: contact_inq_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: --- - -ALTER TABLE ONLY contact_inq - ADD CONSTRAINT contact_inq_pkey PRIMARY KEY (id); - - --- --- Name: contact_inq; Type: ACL; Schema: public; Owner: postgres --- - -REVOKE ALL ON TABLE contact_inq FROM PUBLIC; -REVOKE ALL ON TABLE contact_inq FROM postgres; -GRANT ALL ON TABLE contact_inq TO postgres; -GRANT ALL ON TABLE contact_inq TO nobody; - - --- --- Name: contact_inq_id_seq; Type: ACL; Schema: public; Owner: postgres --- - -REVOKE ALL ON SEQUENCE contact_inq_id_seq FROM PUBLIC; -REVOKE ALL ON SEQUENCE contact_inq_id_seq FROM postgres; -GRANT ALL ON SEQUENCE contact_inq_id_seq TO postgres; -GRANT ALL ON SEQUENCE contact_inq_id_seq TO nobody; - - -- -- PostgreSQL database dump complete -- diff --git a/Toolkit/Contacts/Database/data/news_response.sql b/Toolkit/Contacts/Database/data/news_response.sql index af0d477..89e7c7f 100644 --- a/Toolkit/Contacts/Database/data/news_response.sql +++ b/Toolkit/Contacts/Database/data/news_response.sql @@ -11,33 +11,6 @@ SET escape_string_warning = off; SET search_path = public, pg_catalog; -SET default_tablespace = ''; - -SET default_with_oids = true; - --- --- Name: news_response; Type: TABLE; Schema: public; Owner: postgres; Tablespace: --- - -CREATE TABLE news_response ( - id integer DEFAULT nextval(('"news_response_id_seq"'::text)::regclass) NOT NULL, - subject text, - response text, - mailout date, - coupon text, - image1 text, - image2 text, - image3 text, - coupon_link text, - image text, - image_link text, - image2_link text, - image3_link text -); - - -ALTER TABLE public.news_response OWNER TO postgres; - -- -- Data for Name: news_response; Type: TABLE DATA; Schema: public; Owner: postgres -- @@ -45,23 +18,6 @@ ALTER TABLE public.news_response OWNER TO postgres; INSERT INTO news_response (id, subject, response, mailout, coupon, image1, image2, image3, coupon_link, image, image_link, image2_link, image3_link) VALUES (1, 'Last minute deal!!', '

It is incredibly beautiful outside with perfectly blue skies! We want you to come visit with us this weekend to take advantage of a special offer.

Call us before the end of the day tomorrow (Thursday) and we will give you:

Don''t forget these great reasons to visit us this winter:

It is so great out today! We can''t wait to hear from you!!

Debby, Dan, Chris and Nikki
1-800-748-0245

', NULL, '', NULL, '', '', '', '', '', '', ''); --- --- Name: news_response_id_key; Type: INDEX; Schema: public; Owner: postgres; Tablespace: --- - -CREATE UNIQUE INDEX news_response_id_key ON news_response USING btree (id); - - --- --- Name: news_response; Type: ACL; Schema: public; Owner: postgres --- - -REVOKE ALL ON TABLE news_response FROM PUBLIC; -REVOKE ALL ON TABLE news_response FROM postgres; -GRANT ALL ON TABLE news_response TO postgres; -GRANT ALL ON TABLE news_response TO nobody; - - -- -- PostgreSQL database dump complete -- diff --git a/Toolkit/Contacts/Database/data/query_db.sql b/Toolkit/Contacts/Database/data/query_db.sql index e96300c..6d17c14 100644 --- a/Toolkit/Contacts/Database/data/query_db.sql +++ b/Toolkit/Contacts/Database/data/query_db.sql @@ -11,25 +11,6 @@ SET escape_string_warning = off; SET search_path = public, pg_catalog; -SET default_tablespace = ''; - -SET default_with_oids = true; - --- --- Name: query_db; Type: TABLE; Schema: public; Owner: postgres; Tablespace: --- - -CREATE TABLE query_db ( - id integer DEFAULT nextval(('"query_db_id_seq"'::text)::regclass) NOT NULL, - query_name character varying(8000), - query character varying(8000), - file character varying(100), - delimiter character varying(100) -); - - -ALTER TABLE public.query_db OWNER TO postgres; - -- -- Data for Name: query_db; Type: TABLE DATA; Schema: public; Owner: postgres -- @@ -44,23 +25,6 @@ INSERT INTO query_db (id, query_name, query, file, delimiter) VALUES (2, '(curre ORDER BY lname,fname', '', ''); --- --- Name: query_db_id_key; Type: INDEX; Schema: public; Owner: postgres; Tablespace: --- - -CREATE UNIQUE INDEX query_db_id_key ON query_db USING btree (id); - - --- --- Name: query_db; Type: ACL; Schema: public; Owner: postgres --- - -REVOKE ALL ON TABLE query_db FROM PUBLIC; -REVOKE ALL ON TABLE query_db FROM postgres; -GRANT ALL ON TABLE query_db TO postgres; -GRANT ALL ON TABLE query_db TO nobody; - - -- -- PostgreSQL database dump complete -- diff --git a/Toolkit/Contacts/Database/dbDump.sh b/Toolkit/Contacts/Database/dbDump.sh index f265bfd..a0b08a6 100755 --- a/Toolkit/Contacts/Database/dbDump.sh +++ b/Toolkit/Contacts/Database/dbDump.sh @@ -10,6 +10,6 @@ tables[2]=query_db tables[3]=news_response for i in ${tables[@]}; do - $pgDump -h $dbHost $dbName -t ${i} -f ./data/${i}.sql + $pgDump -h $dbHost $dbName -a -t ${i} -f ./data/${i}.sql echo ${i} done diff --git a/Toolkit/Contacts/Database/loadData.sql b/Toolkit/Contacts/Database/loadData.sql index 643f24b..7035002 100644 --- a/Toolkit/Contacts/Database/loadData.sql +++ b/Toolkit/Contacts/Database/loadData.sql @@ -1,6 +1,8 @@ -- -- Data -- +DELETE FROM contact; \i ./data/contact.sql -\i ./data/contact_inq.sql +-- DELETE FROM contact_inq; +-- \i ./data/contact_inq.sql -- 2.17.1