0b5836592baeb9a3e330017f5f185b82f2465ee8
[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 goal_amount float unsigned NULL COMMENT 'Goal amount for progress bar.',
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
12 CREATE TABLE IF NOT EXISTS civicrm_wci_progress_bar_formula (
13 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Formula entry Id.',
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
22 CREATE TABLE IF NOT EXISTS civicrm_wci_widget (
23 id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Widget Id.',
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.',
34 color_title_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget title background color.',
35 color_progress_bar varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Progress bar color.',
36 color_widget_bg varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget background color.',
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.',
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.',
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
52 PRIMARY KEY (`id`),
53 UNIQUE KEY `unique_wci_title` (`title`),
54 CONSTRAINT FK_civicrm_wci_widget_progress_bar_id FOREIGN KEY (`progress_bar_id`) REFERENCES `civicrm_wci_progress_bar`(`id`) ON DELETE SET NULL
55 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
56
57 -- WCI embed code.
58 CREATE 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 ;