00001 <?php 00002 00003 $this->startSetup()->run(" 00004 00005 drop table if exists {$this->getTable('dataflow_profile')}; 00006 CREATE TABLE {$this->getTable('dataflow_profile')} ( 00007 `profile_id` int(10) unsigned NOT NULL auto_increment, 00008 `name` varchar(255) NOT NULL default '', 00009 `created_at` datetime NOT NULL default '0000-00-00 00:00:00', 00010 `updated_at` datetime NOT NULL default '0000-00-00 00:00:00', 00011 `actions_xml` text, 00012 `gui_data` text, 00013 `direction` enum('import','export') default NULL, 00014 `entity_type` varchar(64) NOT NULL default '', 00015 `store_id` smallint(5) unsigned NOT NULL default '0', 00016 `data_transfer` enum('file', 'interactive'), 00017 PRIMARY KEY (`profile_id`) 00018 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 00019 00020 drop table if exists {$this->getTable('dataflow_profile_history')}; 00021 CREATE TABLE {$this->getTable('dataflow_profile_history')} ( 00022 `history_id` int(10) unsigned NOT NULL auto_increment, 00023 `profile_id` int(10) unsigned NOT NULL default '0', 00024 `action_code` varchar(64) default NULL, 00025 `user_id` int(10) unsigned NOT NULL default '0', 00026 `performed_at` datetime default NULL, 00027 PRIMARY KEY (`history_id`), 00028 KEY `FK_dataflow_profile_history` (`profile_id`), 00029 CONSTRAINT `FK_dataflow_profile_history` FOREIGN KEY (`profile_id`) REFERENCES {$this->getTable('dataflow_profile')} (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE 00030 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 00031 "); 00032 00033 if ($this->tableExists($this->getTable('core_convert_profile'))) { 00034 $this->run(" 00035 insert into {$this->getTable('dataflow_profile')} select * from {$this->getTable('core_convert_profile')}; 00036 insert into {$this->getTable('dataflow_profile_history')} select * from {$this->getTable('core_convert_history')}; 00037 00038 drop table {$this->getTable('core_convert_profile')}; 00039 drop table {$this->getTable('core_convert_history')}; 00040 "); 00041 } 00042 00043 $this->endSetup();