8cd9b710be96e78d41eaa6ffabf50ebbd7bc46d4
[com.zyxware.civiwci.git] / sql / install.sql
1 -- WCI progress bar.
2 CREATE TABLE IF NOT EXISTS civicrm_wci_progress_bar (
3 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Custom Progress bar Id',
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.',
6 PRIMARY KEY (`id`),
7 UNIQUE KEY `unique_wci_name` (`name`)
8 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
9
10 -- WCI progress bar formula
11 CREATE TABLE IF NOT EXISTS civicrm_wci_progress_bar_formula (
12 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Formula entry Id',
13 contribution_page_id int(10) unsigned NOT NULL COMMENT 'Reference contribution page id.',
14 progress_bar_id int(10) unsigned DEFAULT NULL COMMENT 'Custom Progress bar reference id.',
15 percentage float unsigned NULL COMMENT 'Percentage amount.',
16 PRIMARY KEY (`id`),
17 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
18 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
19
20 -- WCI widget
21 CREATE TABLE IF NOT EXISTS civicrm_wci_widget (
22 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Widget Id',
23 title varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title.',
24 logo_image varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Image url of widget logo image.',
25 image varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Url of widget image.',
26 button_title varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Contribute/Donate button title.',
27 button_link_to int(10) unsigned DEFAULT NULL COMMENT 'Contribution/Donation page reference.',
28 progress_bar_id int(10) unsigned DEFAULT NULL COMMENT 'Custom Progress bar reference.',
29 description text DEFAULT NULL COMMENT 'Widget description.',
30 email_signup_group_id int(10) unsigned DEFAULT NULL COMMENT 'Group reference for email newsletter signup.',
31 size_variant varchar(25) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget size variant.',
32 color_title varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title color.',
33 color_title_background varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title background color.',
34 color_progress_bar varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Progress bar color.',
35 color_widget_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title color.',
36 color_description varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget description color.',
37 color_border varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget border color.',
38 color_button varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget button text color.',
39 color_button_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget button background color.',
40 style_rules text DEFAULT NULL COMMENT 'Additional style rules.',
41 override tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Override default template, if 1.',
42 custom_template text DEFAULT NULL COMMENT 'Widget custom template.',
43 PRIMARY KEY (`id`),
44 UNIQUE KEY `unique_wci_title` (`title`),
45 CONSTRAINT FK_civicrm_wci_widget_progress_bar_id FOREIGN KEY (`progress_bar_id`) REFERENCES `civicrm_wci_progress_bar`(`id`) ON DELETE SET NULL
46 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;