00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 $installer = $this;
00028
00029
00030 $installer->startSetup();
00031
00032 $installer->run("
00033 CREATE TABLE `{$installer->getTable('checkout_agreement')}` (
00034 `agreement_id` int(10) unsigned NOT NULL auto_increment,
00035 `name` varchar(255) NOT NULL default '',
00036 `content` text NOT NULL,
00037 `checkbox_text` text NOT NULL,
00038 `is_active` tinyint(4) NOT NULL default '0',
00039 PRIMARY KEY (`agreement_id`)
00040 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00041
00042 CREATE TABLE `{$this->getTable('checkout_agreement_store')}` (
00043 `agreement_id` int(10) unsigned not null,
00044 `store_id` smallint(5) unsigned not null,
00045 UNIQUE KEY (`agreement_id`, `store_id`),
00046 CONSTRAINT `FK_CHECKOUT_AGREEMENT` FOREIGN KEY (`agreement_id`) REFERENCES `{$installer->getTable('checkout_agreement')}` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
00047 CONSTRAINT `FK_CHECKOUT_AGREEMENT_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
00048 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
00049 ");
00050
00051 $installer->endSetup();