-- +--------------------------------------------------------------------+
-- | Copyright CiviCRM LLC. All rights reserved.                        |
-- |                                                                    |
-- | This work is published under the GNU AGPLv3 license with some      |
-- | permitted exceptions and without any warranty. For full license    |
-- | and copyright information, see https://civicrm.org/licensing       |
-- +--------------------------------------------------------------------+
--
-- Generated from schema.tpl
-- DO NOT EDIT.  Generated by CRM_Core_CodeGen
--


-- +--------------------------------------------------------------------+
-- | Copyright CiviCRM LLC. All rights reserved.                        |
-- |                                                                    |
-- | This work is published under the GNU AGPLv3 license with some      |
-- | permitted exceptions and without any warranty. For full license    |
-- | and copyright information, see https://civicrm.org/licensing       |
-- +--------------------------------------------------------------------+
--
-- Generated from drop.tpl
-- DO NOT EDIT.  Generated by CRM_Core_CodeGen
--
-- /*******************************************************
-- *
-- * Clean up the exisiting tables
-- *
-- *******************************************************/

SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `civicrm_grant_app_page`;

SET FOREIGN_KEY_CHECKS=1;
-- /*******************************************************
-- *
-- * Create new tables
-- *
-- *******************************************************/

-- /*******************************************************
-- *
-- * civicrm_grant_app_page
-- *
-- * FIXME
-- *
-- *******************************************************/
CREATE TABLE `civicrm_grant_app_page` (


     `id` int unsigned NOT NULL AUTO_INCREMENT  COMMENT 'Grant Application Page ID',
     `title` varchar(255)   DEFAULT NULL COMMENT 'Grant Application Page title. For top of page display.',
     `intro_text` text    COMMENT 'Text and html allowed. Displayed below title.',
     `footer_text` text    COMMENT 'Text and html allowed. Displayed at the bottom of the first page of the grant application wizard.',
     `grant_type_id` int unsigned NOT NULL   COMMENT 'Grant type assigned to applications submitted via this page.',
     `default_amount` decimal(20,2)   DEFAULT NULL COMMENT 'Default amount of grant applied for.',
     `is_draft` tinyint   DEFAULT 0 COMMENT 'Does this page have a Save as Draft button?',
     `draft_title` varchar(255)   DEFAULT NULL COMMENT 'Title for Save as Draft page (header title tag, and display at the top of the page).',
     `draft_text` text    COMMENT 'Text and html allowed. Displayed above application fields on Save as Draft page',
     `draft_footer` text    COMMENT 'Text and html allowed. Displayed at the bottom of the Save as Draft page.',
     `thankyou_title` varchar(255)   DEFAULT NULL COMMENT 'Title for Thank-you page (header title tag, and display at the top of the page).',
     `thankyou_text` text    COMMENT 'Text and html allowed. Displayed above result on success page',
     `thankyou_footer` text    COMMENT 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.',
     `confirm_text` text    COMMENT 'Text and html allowed. Displayed above result on confirmation page',
     `confirm_footer` text    COMMENT 'Text and html allowed. displayed at the bottom of the confirmation page.',
     `is_email_receipt` tinyint   DEFAULT 0 COMMENT 'If true, receipt is automatically emailed to contact on success',
     `receipt_from_name` varchar(255)   DEFAULT NULL COMMENT 'FROM email name used for receipts generated by applications to this grant application page.',
     `receipt_from_email` varchar(255)   DEFAULT NULL COMMENT 'FROM email address used for receipts generated by applications to this grant application page.',
     `cc_receipt` varchar(255)   DEFAULT NULL COMMENT 'Comma-separated list of email addresses to cc each time a receipt is sent',
     `bcc_receipt` varchar(255)   DEFAULT NULL COMMENT 'Comma-separated list of email addresses to bcc each time a receipt is sent',
     `receipt_text` text    COMMENT 'Text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
     `is_active` tinyint   DEFAULT 1 COMMENT 'Is this grant application page active?',
     `start_date` datetime   DEFAULT NULL COMMENT 'Date and time that this page starts.',
     `end_date` datetime   DEFAULT NULL COMMENT 'Date and time that this page ends. May be NULL if no defined end date/time',
     `created_id` int unsigned   DEFAULT NULL COMMENT 'FK to civicrm_contact, who created this grant application page',
     `created_date` datetime   DEFAULT NULL COMMENT 'Date and time that grant application page was created.' 
,
        PRIMARY KEY (`id`)
 
 
,          CONSTRAINT FK_civicrm_grant_app_page_created_id FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL  
)    ;

 