Skip to content

Commit 19fc7fe

Browse files
committed
Merge pull request #145 from xillibit/patch-11
Couple of changes on postgreSQL tables structure to make it working
2 parents 80ae9ce + f15324f commit 19fc7fe

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

src/meta/sql/crm/postgresql/crm.sql

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,19 @@ CREATE TABLE "#__events" (
200200
"created" timestamp NOT NULL,
201201
"type" varchar(250) NOT NULL,
202202
"assignee_id" int NOT NULL,
203-
"due_date" timestamp NOT NULL,
203+
"due_date" timestamp,
204204
"end_date" date,
205205
"repeats" varchar(255) NOT NULL,
206-
"repeat_end" timestamp NOT NULL,
207-
"start_time" timestamp NOT NULL,
208-
"end_time" timestamp NOT NULL,
206+
"repeat_end" timestamp,
207+
"start_time" timestamp,
208+
"end_time" timestamp,
209209
"all_day" int NOT NULL,
210210
"category_id" int NOT NULL,
211211
"modified" timestamp NOT NULL,
212-
"completed" int NOT NULL,
213-
"actual_close" timestamp NOT NULL,
214-
"excludes" text NOT NULL,
215-
"parent_id" int NOT NULL,
212+
"completed" int DEFAULT 0,
213+
"actual_close" timestamp,
214+
"excludes" text,
215+
"parent_id" int NOT NULL DEFAULT 0,
216216
"published" int DEFAULT 1,
217217
PRIMARY KEY ("id")
218218
);
@@ -286,8 +286,8 @@ CREATE TABLE "#__history" (
286286
"type_id" int,
287287
"user_id" int,
288288
"date" timestamp,
289-
"old_value" text,
290-
"new_value" text,
289+
"old_value" int,
290+
"new_value" int,
291291
"action_type" varchar(250),
292292
"field" varchar(255),
293293
PRIMARY KEY ("id")
@@ -363,7 +363,7 @@ CREATE TABLE "#__people" (
363363
"home_state" varchar(255),
364364
"home_zip" int NOT NULL,
365365
"home_country" varchar(255),
366-
"assignee_id" int NOT NULL,
366+
"assignee_id" int NOT NULL DEFAULT 0,
367367
"fax" varchar(255),
368368
"website" varchar(255),
369369
"facebook_url" varchar(255),
@@ -586,44 +586,44 @@ CREATE TABLE IF NOT EXISTS "#__company_custom_cf" (
586586
"modified" TIMESTAMP WITHOUT TIME ZONE
587587
);
588588

589-
INSERT INTO "#__branding" ("id", "header", "tabs_hover", "tabs_hover_text", "table_header_row", "table_header_text", "link", "link_hover", "assigned", "modified", "site_logo", "feature_btn_bg", "feature_btn_border", "block_btn_border", "site_name") VALUES (1, 'eff6f7', 'd6edf2', '000000', 'd6edf2', '6793a7', '1E759E', '1E759E', 0, '2012-02-21 16:11:03', 'cobalt-3d.png', null, null, null, 'COBALT');
590-
INSERT INTO "#__branding" ("id", "header", "tabs_hover", "tabs_hover_text", "table_header_row", "table_header_text", "link", "link_hover", "assigned", "modified", "site_logo", "feature_btn_bg", "feature_btn_border", "block_btn_border", "site_name") VALUES (2, 'eff6f7', 'd6edf2', '000000', 'd6edf2', '6793a7', '1E759E', '1E759E', 1, '2012-07-18 17:30:10', 'cobalt-3d.png', null, null, null, 'COBALT');
589+
INSERT INTO "#__branding" ("header", "tabs_hover", "tabs_hover_text", "table_header_row", "table_header_text", "link", "link_hover", "assigned", "modified", "site_logo", "feature_btn_bg", "feature_btn_border", "block_btn_border", "site_name") VALUES ('eff6f7', 'd6edf2', '000000', 'd6edf2', '6793a7', '1E759E', '1E759E', 0, '2012-02-21 16:11:03', 'cobalt-3d.png', null, null, null, 'COBALT');
590+
INSERT INTO "#__branding" ("header", "tabs_hover", "tabs_hover_text", "table_header_row", "table_header_text", "link", "link_hover", "assigned", "modified", "site_logo", "feature_btn_bg", "feature_btn_border", "block_btn_border", "site_name") VALUES ('eff6f7', 'd6edf2', '000000', 'd6edf2', '6793a7', '1E759E', '1E759E', 1, '2012-07-18 17:30:10', 'cobalt-3d.png', null, null, null, 'COBALT');
591591
INSERT INTO "#__config" ("id", "timezone", "imap_host", "imap_user", "imap_pass", "users_add", "config_default", "templates_edit", "menu_default", "import_default", "launch_default", "show_help", "import_sample", "currency", "lang_deal", "lang_person", "lang_company", "lang_contact", "lang_lead", "lang_task", "lang_event", "lang_goal", "welcome_message", "time_format") VALUES (1, 'America/New_York', '', '', '', 0, 0, 0, 0, 0, 0, 1, null, '$', 'deal', 'person', 'company', 'contact', 'lead', 'task', 'event', 'goal', 'Hello', 'H:i');
592-
INSERT INTO "#__deal_status" ("id", "name", "ordering", "class") VALUES (1, 'bad', null, 'bad');
593-
INSERT INTO "#__deal_status" ("id", "name", "ordering", "class") VALUES (2, 'good', null, 'good');
594-
INSERT INTO "#__deal_status" ("id", "name", "ordering", "class") VALUES (3, 'question', null, 'question');
595-
INSERT INTO "#__events_categories" ("id", "name", "created", "modified") VALUES (1, 'Call', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
596-
INSERT INTO "#__events_categories" ("id", "name", "created", "modified") VALUES (2, 'Milestone', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
597-
INSERT INTO "#__events_categories" ("id", "name", "created", "modified") VALUES (3, 'Appointment', '2012-02-23 14:32:35', '2012-02-23 14:32:41');
598-
INSERT INTO "#__events_categories" ("id", "name", "created", "modified") VALUES (4, 'Email', '2012-02-23 14:32:45', '2012-02-23 14:32:50');
599-
INSERT INTO "#__events_categories" ("id", "name", "created", "modified") VALUES (5, 'Todo', '2012-02-23 14:32:35', '2012-02-23 14:32:41');
600-
INSERT INTO "#__events_categories" ("id", "name", "created", "modified") VALUES (6, 'Fax', '2012-02-23 14:32:45', '2012-02-23 14:32:50');
592+
INSERT INTO "#__deal_status" ("name", "ordering", "class") VALUES ('bad', null, 'bad');
593+
INSERT INTO "#__deal_status" ("name", "ordering", "class") VALUES ('good', null, 'good');
594+
INSERT INTO "#__deal_status" ("name", "ordering", "class") VALUES ('question', null, 'question');
595+
INSERT INTO "#__events_categories" ("name", "created", "modified") VALUES ('Call', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
596+
INSERT INTO "#__events_categories" ("name", "created", "modified") VALUES ('Milestone', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
597+
INSERT INTO "#__events_categories" ("name", "created", "modified") VALUES ('Appointment', '2012-02-23 14:32:35', '2012-02-23 14:32:41');
598+
INSERT INTO "#__events_categories" ("name", "created", "modified") VALUES ('Email', '2012-02-23 14:32:45', '2012-02-23 14:32:50');
599+
INSERT INTO "#__events_categories" ("name", "created", "modified") VALUES ('Todo', '2012-02-23 14:32:35', '2012-02-23 14:32:41');
600+
INSERT INTO "#__events_categories" ("name", "created", "modified") VALUES ('Fax', '2012-02-23 14:32:45', '2012-02-23 14:32:50');
601601
INSERT INTO "#__menu" ("id", "menu_items", "modified") VALUES (1, 'a:8:{i:0;s:9:"dashboard";i:1;s:5:"deals";i:2;s:6:"people";i:3;s:9:"companies";i:4;s:8:"calendar";i:5;s:9:"documents";i:6;s:5:"goals";i:7;s:7:"reports";}', '2012-07-19 09:19:46');
602-
INSERT INTO "#__notes_categories" ("id", "name", "created", "modified") VALUES (1, 'Phone Call', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
603-
INSERT INTO "#__notes_categories" ("id", "name", "created", "modified") VALUES (2, 'Voicemail', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
604-
INSERT INTO "#__notes_categories" ("id", "name", "created", "modified") VALUES (3, 'Appointments', '1970-01-01 00:00:00', '2012-02-14 10:38:24');
605-
INSERT INTO "#__notes_categories" ("id", "name", "created", "modified") VALUES (4, 'Cold Call', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
606-
INSERT INTO "#__notes_categories" ("id", "name", "created", "modified") VALUES (5, 'Concerns', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
607-
INSERT INTO "#__notes_categories" ("id", "name", "created", "modified") VALUES (6, 'Emails', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
608-
INSERT INTO "#__people_status" ("id", "name", "color", "created", "modified", "ordering") VALUES (1, 'Archived', '199e76', '1970-01-01 00:00:00', '2012-02-21 00:44:15', null);
609-
INSERT INTO "#__people_status" ("id", "name", "color", "created", "modified", "ordering") VALUES (2, 'Hot', 'ff0004', '1970-01-01 00:00:00', '2012-02-17 10:59:07', null);
610-
INSERT INTO "#__people_status" ("id", "name", "color", "created", "modified", "ordering") VALUES (3, 'Warm', '5510b5', '1970-01-01 00:00:00', '2012-02-16 19:58:14', null);
611-
INSERT INTO "#__people_status"("id", "name", "color", "created", "modified", "ordering") VALUES (4, 'Follow-Up', '52b354', '1970-01-01 00:00:00', '2012-02-17 01:46:57', null);
612-
INSERT INTO "#__people_status" ("id", "name", "color", "created", "modified", "ordering") VALUES (5, 'Cold', 'bababa', '1970-01-01 00:00:00', '2012-02-16 19:58:36', null);
613-
INSERT INTO "#__people_tags" ("id", "name", "created", "modified") VALUES (1, 'Decision Makers', '1970-01-01 00:00:00', '2012-02-16 12:30:38');
614-
INSERT INTO "#__people_tags" ("id", "name", "created", "modified") VALUES (2, 'Existing Customer', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
615-
INSERT INTO "#__people_tags" ("id", "name", "created", "modified") VALUES (3, 'Partner', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
616-
INSERT INTO "#__people_tags" ("id", "name", "created", "modified") VALUES (4, 'Vendor', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
617-
INSERT INTO "#__people_tags" ("id", "name", "created", "modified") VALUES (5, 'Vip', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
618-
INSERT INTO "#__sources" ("id", "name", "type", "created", "modified", "cost", "ordering") VALUES (1, 'Cold Call', 'flat', '1970-01-01 00:00:00', '2012-02-16 13:16:55', 20, null);
619-
INSERT INTO "#__sources" ("id", "name", "type", "created", "modified", "cost", "ordering") VALUES (2, 'Import', 'per', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 0, null);
620-
INSERT INTO "#__sources" ("id", "name", "type", "created", "modified", "cost", "ordering") VALUES (3, 'None', 'per', '1970-01-01 00:00:00', '2012-02-14 10:59:48', 26, null);
621-
INSERT INTO "#__sources" ("id", "name", "type", "created", "modified", "cost", "ordering") VALUES (4, 'Referral', 'per', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 0, null);
622-
INSERT INTO "#__sources" ("id", "name", "type", "created", "modified", "cost", "ordering") VALUES (5, 'Trade', 'flat', '1970-01-01 00:00:00', '2012-03-01 14:51:27', 20, null);
623-
INSERT INTO "#__sources" ("id", "name", "type", "created", "modified", "cost", "ordering") VALUES (6, 'Website', 'per', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 0, null);
624-
INSERT INTO "#__stages" ("id", "name", "percent", "created", "modified", "color", "ordering", "won") VALUES (1, 'Qualified Lead', 12, '1970-01-01 00:00:00', '2012-07-11 15:24:01', 'ffa200', null, 0);
625-
INSERT INTO "#__stages" ("id", "name", "percent", "created", "modified", "color", "ordering", "won") VALUES (2, 'Request for Info', 9, '1970-01-01 00:00:00', '2012-07-11 15:24:14', '00ffea', null, 0);
626-
INSERT INTO "#__stages" ("id", "name", "percent", "created", "modified", "color", "ordering", "won") VALUES (3, 'Presentation', 27, '1970-01-01 00:00:00', '2012-07-11 15:23:43', '009dff', null, 0);
627-
INSERT INTO "#__stages" ("id", "name", "percent", "created", "modified", "color", "ordering", "won") VALUES (4, 'Negotiation', 50, '1970-01-01 00:00:00', '2012-07-11 15:23:33', 'ebe238', null, 0);
628-
INSERT INTO "#__stages" ("id", "name", "percent", "created", "modified", "color", "ordering", "won") VALUES (5, 'Won', 100, '1970-01-01 00:00:00', '2012-07-11 15:24:20', '12d900', null, 0);
629-
INSERT INTO "#__stages" ("id", "name", "percent", "created", "modified", "color", "ordering", "won") VALUES (6, 'Lost', 0, '1970-01-01 00:00:00', '2012-07-11 15:23:19', 'cc2121', null, 0);
602+
INSERT INTO "#__notes_categories" ("name", "created", "modified") VALUES ('Phone Call', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
603+
INSERT INTO "#__notes_categories" ("name", "created", "modified") VALUES ('Voicemail', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
604+
INSERT INTO "#__notes_categories" ("name", "created", "modified") VALUES ('Appointments', '1970-01-01 00:00:00', '2012-02-14 10:38:24');
605+
INSERT INTO "#__notes_categories" ("name", "created", "modified") VALUES ('Cold Call', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
606+
INSERT INTO "#__notes_categories" ("name", "created", "modified") VALUES ('Concerns', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
607+
INSERT INTO "#__notes_categories" ("name", "created", "modified") VALUES ('Emails', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
608+
INSERT INTO "#__people_status" ("name", "color", "created", "modified", "ordering") VALUES ('Archived', '199e76', '1970-01-01 00:00:00', '2012-02-21 00:44:15', null);
609+
INSERT INTO "#__people_status" ("name", "color", "created", "modified", "ordering") VALUES ('Hot', 'ff0004', '1970-01-01 00:00:00', '2012-02-17 10:59:07', null);
610+
INSERT INTO "#__people_status" ("name", "color", "created", "modified", "ordering") VALUES ('Warm', '5510b5', '1970-01-01 00:00:00', '2012-02-16 19:58:14', null);
611+
INSERT INTO "#__people_status"("name", "color", "created", "modified", "ordering") VALUES ('Follow-Up', '52b354', '1970-01-01 00:00:00', '2012-02-17 01:46:57', null);
612+
INSERT INTO "#__people_status" ("name", "color", "created", "modified", "ordering") VALUES ('Cold', 'bababa', '1970-01-01 00:00:00', '2012-02-16 19:58:36', null);
613+
INSERT INTO "#__people_tags" ("name", "created", "modified") VALUES ('Decision Makers', '1970-01-01 00:00:00', '2012-02-16 12:30:38');
614+
INSERT INTO "#__people_tags" ("name", "created", "modified") VALUES ('Existing Customer', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
615+
INSERT INTO "#__people_tags" ("name", "created", "modified") VALUES ('Partner', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
616+
INSERT INTO "#__people_tags" ("name", "created", "modified") VALUES ('Vendor', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
617+
INSERT INTO "#__people_tags" ("name", "created", "modified") VALUES ('Vip', '1970-01-01 00:00:00', '1970-01-01 00:00:00');
618+
INSERT INTO "#__sources" ("name", "type", "created", "modified", "cost", "ordering") VALUES ('Cold Call', 'flat', '1970-01-01 00:00:00', '2012-02-16 13:16:55', 20, null);
619+
INSERT INTO "#__sources" ("name", "type", "created", "modified", "cost", "ordering") VALUES ('Import', 'per', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 0, null);
620+
INSERT INTO "#__sources" ("name", "type", "created", "modified", "cost", "ordering") VALUES ('None', 'per', '1970-01-01 00:00:00', '2012-02-14 10:59:48', 26, null);
621+
INSERT INTO "#__sources" ("name", "type", "created", "modified", "cost", "ordering") VALUES ('Referral', 'per', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 0, null);
622+
INSERT INTO "#__sources" ("name", "type", "created", "modified", "cost", "ordering") VALUES ('Trade', 'flat', '1970-01-01 00:00:00', '2012-03-01 14:51:27', 20, null);
623+
INSERT INTO "#__sources" ("name", "type", "created", "modified", "cost", "ordering") VALUES ('Website', 'per', '1970-01-01 00:00:00', '1970-01-01 00:00:00', 0, null);
624+
INSERT INTO "#__stages" ("name", "percent", "created", "modified", "color", "ordering", "won") VALUES ('Qualified Lead', 12, '1970-01-01 00:00:00', '2012-07-11 15:24:01', 'ffa200', null, 0);
625+
INSERT INTO "#__stages" ("name", "percent", "created", "modified", "color", "ordering", "won") VALUES ('Request for Info', 9, '1970-01-01 00:00:00', '2012-07-11 15:24:14', '00ffea', null, 0);
626+
INSERT INTO "#__stages" ("name", "percent", "created", "modified", "color", "ordering", "won") VALUES ('Presentation', 27, '1970-01-01 00:00:00', '2012-07-11 15:23:43', '009dff', null, 0);
627+
INSERT INTO "#__stages" ("name", "percent", "created", "modified", "color", "ordering", "won") VALUES ('Negotiation', 50, '1970-01-01 00:00:00', '2012-07-11 15:23:33', 'ebe238', null, 0);
628+
INSERT INTO "#__stages" ("name", "percent", "created", "modified", "color", "ordering", "won") VALUES ('Won', 100, '1970-01-01 00:00:00', '2012-07-11 15:24:20', '12d900', null, 0);
629+
INSERT INTO "#__stages" ("name", "percent", "created", "modified", "color", "ordering", "won") VALUES ('Lost', 0, '1970-01-01 00:00:00', '2012-07-11 15:23:19', 'cc2121', null, 0);

0 commit comments

Comments
 (0)