-- +--------------------------------------------------------------------+
-- | 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 existing tables
-- *
-- *******************************************************/



-- /*******************************************************
-- *
-- * Create new tables
-- *
-- *******************************************************/

-- /*******************************************************
-- *
-- * civicrm_advimport
-- *
-- * Advimport Job
-- *
-- *******************************************************/
CREATE TABLE `civicrm_advimport` (


     `id` int unsigned NOT NULL AUTO_INCREMENT  COMMENT 'Unique Advimport ID',
     `contact_id` int unsigned    COMMENT 'FK to Contact, import author',
     `classname` varchar(255)    COMMENT 'Mapping helper class name',
     `start_date` timestamp null    COMMENT 'Import start',
     `end_date` timestamp null    COMMENT 'Import end',
     `filename` varchar(255)    COMMENT 'Name of the file uploaded',
     `table_name` varchar(128)    COMMENT 'SQL table where the data is staged before being processed',
     `total_count` int unsigned    COMMENT 'Total number of rows',
     `success_count` int unsigned    COMMENT 'Number of rows imported successful',
     `warning_count` int unsigned    COMMENT 'Number of rows imported with warnings',
     `error_count` int unsigned    COMMENT 'Number of rows that failed to import because of errors',
     `track_entity_type` varchar(128)    COMMENT 'Ex: group or tag used to track contacts imported',
     `track_entity_id` int unsigned    COMMENT 'ID of the group or tag used to track contacts imported',
     `mapping` text    COMMENT 'Field mapping'
,
        PRIMARY KEY (`id`)


,          CONSTRAINT FK_civicrm_advimport_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL
)  ENGINE=InnoDB  ;

