#176 상품옵션 테이블 생성 코드 추가

This commit is contained in:
chicpro
2013-05-21 10:00:51 +09:00
parent 2e3e8d12eb
commit f61d3bed4c
3 changed files with 57 additions and 18 deletions

View File

@ -62,6 +62,27 @@ if(!sql_query(" select uq_id from {$g4['uniqid_table']} limit 1 ", false)) {
) ", false);
}
// 상품옵션 테이블 생성
if(!sql_query(" select io_id from {$g4['shop_item_option_table']} limit 1 ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['shop_item_option_table']}` (
`io_no` INT(11) NOT NULL AUTO_INCREMENT,
`io_id` VARCHAR(255) NOT NULL DEFAULT '',
`io_type` TINYINT(4) NOT NULL DEFAULT '0',
`it_id` VARCHAR(20) NOT NULL DEFAULT '',
`io_price` INT(11) NOT NULL DEFAULT '0',
`io_stock_qty` INT(11) NOT NULL DEFAULT '0',
`io_noti_qty` INT(11) NOT NULL DEFAULT '0',
`io_use` TINYINT(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`io_no`),
KEY `io_id` (`io_id`),
KEY `it_id` (`it_id`)
) ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}`
ADD `it_option_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_origin`,
ADD `it_option` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_option_subject`,
ADD `it_supply_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_option` ", false);
}
// uq_id 필드추가
$sql = " select uq_id from {$g4['shop_cart_table']} limit 1 ";
$result = sql_query($sql, false);
@ -96,6 +117,17 @@ if(!$result) {
ADD `od_mobile` TINYINT(4) NOT NULL DEFAULT '0' AFTER `od_time` ", false);
}
// it_brand 추가
/*
$sql = " select it_brand from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_item_table']}`
ADD `it_brand` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_origin`,
ADD `it_model` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_brand` ", false);
}
*/
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 끝
//==============================================================================

View File

@ -478,6 +478,7 @@ if($shop_install) {
fwrite($f, "\$g4['shop_faq_table'] = SHOP_TABLE_PREFIX.'faq'; // 자주하시는 질문 테이블\n");
fwrite($f, "\$g4['shop_faq_master_table'] = SHOP_TABLE_PREFIX.'faq_master'; // 자주하시는 질문 마스터 테이블\n");
fwrite($f, "\$g4['shop_item_table'] = SHOP_TABLE_PREFIX.'item'; // 상품 테이블\n");
fwrite($f, "\$g4['shop_item_option_table'] = SHOP_TABLE_PREFIX.'item_option'; // 상품옵션 테이블\n");
fwrite($f, "\$g4['shop_item_ps_table'] = SHOP_TABLE_PREFIX.'item_ps'; // 상품 사용후기 테이블\n");
fwrite($f, "\$g4['shop_item_qa_table'] = SHOP_TABLE_PREFIX.'item_qa'; // 상품 질문답변 테이블\n");
fwrite($f, "\$g4['shop_item_relation_table'] = SHOP_TABLE_PREFIX.'item_relation'; // 관련 상품 테이블\n");

View File

@ -91,12 +91,6 @@ CREATE TABLE IF NOT EXISTS `shop_category` (
`ca_name` varchar(255) NOT NULL DEFAULT '',
`ca_skin` varchar(255) NOT NULL DEFAULT '',
`ca_mobile_skin` varchar(255) NOT NULL DEFAULT '',
`ca_opt1_subject` varchar(255) NOT NULL DEFAULT '',
`ca_opt2_subject` varchar(255) NOT NULL DEFAULT '',
`ca_opt3_subject` varchar(255) NOT NULL DEFAULT '',
`ca_opt4_subject` varchar(255) NOT NULL DEFAULT '',
`ca_opt5_subject` varchar(255) NOT NULL DEFAULT '',
`ca_opt6_subject` varchar(255) NOT NULL DEFAULT '',
`ca_img_width` int(11) NOT NULL DEFAULT '0',
`ca_img_height` int(11) NOT NULL DEFAULT '0',
`ca_mobile_img_width` int(11) NOT NULL DEFAULT '0',
@ -372,18 +366,9 @@ CREATE TABLE IF NOT EXISTS `shop_item` (
`it_gallery` tinyint(4) NOT NULL DEFAULT '0',
`it_maker` varchar(255) NOT NULL DEFAULT '',
`it_origin` varchar(255) NOT NULL DEFAULT '',
`it_opt1_subject` varchar(255) NOT NULL DEFAULT '',
`it_opt2_subject` varchar(255) NOT NULL DEFAULT '',
`it_opt3_subject` varchar(255) NOT NULL DEFAULT '',
`it_opt4_subject` varchar(255) NOT NULL DEFAULT '',
`it_opt5_subject` varchar(255) NOT NULL DEFAULT '',
`it_opt6_subject` varchar(255) NOT NULL DEFAULT '',
`it_opt1` text NOT NULL,
`it_opt2` text NOT NULL,
`it_opt3` text NOT NULL,
`it_opt4` text NOT NULL,
`it_opt5` text NOT NULL,
`it_opt6` text NOT NULL,
`it_option_subject` varchar(255) NOT NULL DEFAULT '',
`it_option` varchar(255) NOT NULL DEFAULT '',
`it_supply_subject` varchar(255) NOT NULL DEFAULT '',
`it_type1` tinyint(4) NOT NULL DEFAULT '0',
`it_type2` tinyint(4) NOT NULL DEFAULT '0',
`it_type3` tinyint(4) NOT NULL DEFAULT '0',
@ -426,6 +411,27 @@ CREATE TABLE IF NOT EXISTS `shop_item` (
-- --------------------------------------------------------
--
-- Table structure for table `shop_item_option`
--
DROP TABLE IF EXISTS `shop_item_option`;
CREATE TABLE IF NOT EXISTS `shop_item_option` (
`io_no` INT(11) NOT NULL AUTO_INCREMENT,
`io_id` VARCHAR(255) NOT NULL DEFAULT '0',
`io_type` TINYINT(4) NOT NULL DEFAULT '0',
`it_id` VARCHAR(20) NOT NULL DEFAULT '',
`io_price` INT(11) NOT NULL DEFAULT '0',
`io_stock_qty` INT(11) NOT NULL DEFAULT '0',
`io_noti_qty` INT(11) NOT NULL DEFAULT '0',
`io_use` TINYINT(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`io_no`),
KEY `io_id` (`io_id`),
KEY `it_id` (`it_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `shop_item_ps`
--