diff --git a/hwe/sql/reset.sql b/hwe/sql/reset.sql index 7cc725cc..4fdbf35b 100644 --- a/hwe/sql/reset.sql +++ b/hwe/sql/reset.sql @@ -66,4 +66,6 @@ ENGINE=Aria; DROP TABLE IF EXISTS ng_betting; DROP TABLE IF EXISTS vote; -DROP TABLE IF EXISTS vote_comment; \ No newline at end of file +DROP TABLE IF EXISTS vote_comment; + +DROP TABLE IF EXISTS `ng_auction`; \ No newline at end of file diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index 5a459bf6..1bba1110 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -684,4 +684,26 @@ CREATE TABLE `vote_comment` ( `date` DATETIME NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX `by_vote` (`vote_id`) -) COLLATE = 'utf8mb4_general_ci' ENGINE = Aria; \ No newline at end of file +) COLLATE = 'utf8mb4_general_ci' ENGINE = Aria; + + +############################## +## 거래장 / 경매장 +############################## +# 경매 객체는 KVStorage에 저장 +CREATE TABLE `ng_auction` ( + `no` INT(11) NOT NULL AUTO_INCREMENT, + `auction_id` INT(11) NOT NULL, + `owner` INT(11) NULL DEFAULT NULL, + `general_id` INT(11) NOT NULL, + `amount` INT(11) NOT NULL, + `date` DATETIME NOT NULL, + `aux` LONGTEXT NOT NULL COLLATE 'utf8mb4_bin', + PRIMARY KEY (`no`), + UNIQUE INDEX `by_general` (`general_id`, `auction_id`, `amount`), + UNIQUE INDEX `by_owner` (`owner`, `auction_id`, `amount`), + INDEX `by_amount` (`auction_id`, `amount`, `date`), + CONSTRAINT `aux` CHECK (json_valid(`aux`)) +) +COLLATE='utf8mb4_general_ci' +ENGINE = Aria; \ No newline at end of file