fixed beta 1 bugs, 31062, 31063, 31101, 31067, 31065
[com.zyxware.civiwci.git] / sql / install.sql
CommitLineData
6a387a09
M
1-- WCI progress bar.
2CREATE TABLE IF NOT EXISTS civicrm_wci_progress_bar (
1720f579 3 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Custom Progress bar Id.',
6a387a09
M
4 name varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Name of progress bar.',
5 starting_amount float unsigned NULL COMMENT 'Arbitrary starting amount for progress bar.',
10a071d6 6 goal_amount float unsigned NULL COMMENT 'Goal amount for progress bar.',
6a387a09
M
7 PRIMARY KEY (`id`),
8 UNIQUE KEY `unique_wci_name` (`name`)
9) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
10
11-- WCI progress bar formula
12CREATE TABLE IF NOT EXISTS civicrm_wci_progress_bar_formula (
1720f579 13 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Formula entry Id.',
6a387a09
M
14 contribution_page_id int(10) unsigned NOT NULL COMMENT 'Reference contribution page id.',
15 progress_bar_id int(10) unsigned DEFAULT NULL COMMENT 'Custom Progress bar reference id.',
16 percentage float unsigned NULL COMMENT 'Percentage amount.',
17 PRIMARY KEY (`id`),
18 CONSTRAINT FK_civicrm_wci_progress_bar_formula_progress_bar_id FOREIGN KEY (`progress_bar_id`) REFERENCES `civicrm_wci_progress_bar`(`id`) ON DELETE SET NULL
19) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
20
21-- WCI widget
22CREATE TABLE IF NOT EXISTS civicrm_wci_widget (
1720f579 23 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Widget Id.',
6a387a09
M
24 title varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title.',
25 logo_image varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Image url of widget logo image.',
26 image varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Url of widget image.',
27 button_title varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Contribute/Donate button title.',
28 button_link_to int(10) unsigned DEFAULT NULL COMMENT 'Contribution/Donation page reference.',
29 progress_bar_id int(10) unsigned DEFAULT NULL COMMENT 'Custom Progress bar reference.',
30 description text DEFAULT NULL COMMENT 'Widget description.',
31 email_signup_group_id int(10) unsigned DEFAULT NULL COMMENT 'Group reference for email newsletter signup.',
32 size_variant varchar(25) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget size variant.',
33 color_title varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title color.',
1720f579 34 color_title_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title background color.',
6a387a09 35 color_progress_bar varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Progress bar color.',
1720f579 36 color_widget_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget background color.',
6a387a09
M
37 color_description varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget description color.',
38 color_border varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget border color.',
39 color_button varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget button text color.',
40 color_button_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget button background color.',
41 style_rules text DEFAULT NULL COMMENT 'Additional style rules.',
42 override tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Override default template, if 1.',
43 custom_template text DEFAULT NULL COMMENT 'Widget custom template.',
6d608c2b
J
44 hide_title tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Hide title, if 1.',
45 hide_border tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Hide widget border, if 1.',
46 hide_pbcap tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Hide pb caption, if 1.',
c1a7ee1f
J
47 color_btn_newsletter varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Newsletter Button text color',
48 color_btn_newsletter_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Newsletter Button color',
49 newsletter_text varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Newsletter text',
50 color_newsletter_text varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Newsletter text color',
51
6a387a09
M
52 PRIMARY KEY (`id`),
53 UNIQUE KEY `unique_wci_title` (`title`),
fbe9a7d4 54 CONSTRAINT FK_civicrm_wci_widget_progress_bar_id FOREIGN KEY (`progress_bar_id`) REFERENCES `civicrm_wci_progress_bar`(`id`) ON DELETE RESTRICT
6d608c2b 55) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
13e70378
J
56
57-- WCI embed code.
58CREATE TABLE IF NOT EXISTS civicrm_wci_embed_code (
59 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Custom Progress bar Id.',
60 name varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Embed code.',
61 widget_id int(10) unsigned DEFAULT NULL COMMENT 'widget id.',
62 PRIMARY KEY (`id`),
63 UNIQUE KEY `unique_wci_name` (`name`)
64) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;