Table creating sql for a typical shopping cart


/ Published in: SQL

Confirm the sql script file is encoded with `UTF-8`


Copy this code and paste it in your HTML
  1. CREATE TABLE IF NOT EXISTS `goods_order`
  2. (
  3. `order_id` INT UNSIGNED NOT NULL COMMENT '订单单号',
  4. `goods_id` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品款号',
  5. `order_type` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单类型',
  6. `order_status` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单状态',
  7. `color_id` SMALLINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '颜色id',
  8. `size_id` SMALLINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '尺寸id',
  9. `goods_number` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '数量',
  10. `depot_id` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '仓库id',
  11. `packet_id` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '储位code',
  12. `gmt_create` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '添加时间',
  13. `gmt_modify` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
  14.  
  15. PRIMARY KEY(`order_id`,`goods_id`)
  16. )ENGINE=InnoDB AUTO_INCREMENT=1 CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.