spring boot 微信点餐 (一)模块及架构介绍

本文详细介绍了使用Oracle数据库进行表结构设计的过程,包括产品信息、类别及订单管理等核心业务表的设计细节。通过具体示例展示了如何定义字段类型、设置主键及添加注释等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、项目架构

2系统演进


3、两大微服务架构


4、项目表结构关系


5、建表语句(基于oracel)

-- Create table
create table PRODUCT_INFO
(
  product_id          VARCHAR2(32) not null,
  product_name        VARCHAR2(64) not null,
  product_price       NUMBER(10,2),
  product_stock       NUMBER(10),
  product_description VARCHAR2(64),
  product_icon        VARCHAR2(512),
  catagory_type       NUMBER(10),
  create_time         TIMESTAMP(6) default sysdate,
  update_time         TIMESTAMP(6)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Add comments to the columns 
comment on column PRODUCT_INFO.product_name
  is '商品名称';
comment on column PRODUCT_INFO.product_price
  is '商品单价';
comment on column PRODUCT_INFO.product_stock
  is '库存';
comment on column PRODUCT_INFO.product_description
  is '描述';
comment on column PRODUCT_INFO.product_icon
  is '小图';
comment on column PRODUCT_INFO.catagory_type
  is '编号类目';
comment on column PRODUCT_INFO.create_time
  is '创建时间';
comment on column PRODUCT_INFO.update_time
  is '更新时间';
-- Create/Recreate primary, unique and foreign key constraints 
alter table PRODUCT_INFO
  add constraint PK_ID primary key (PRODUCT_ID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2

  maxtrans 255;


-- Create table
create table PRODUCT_CATAGORY
(
  catagory_id   NUMBER not null,
  catagory_name NVARCHAR2(64),
  catagory_type NUMBER,
  create_time   TIMESTAMP(6),
  update_time   TIMESTAMP(6)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Add comments to the table 
comment on table PRODUCT_CATAGORY
  is '类目表';
-- Add comments to the columns 
comment on column PRODUCT_CATAGORY.catagory_name
  is 'l类目名称';
comment on column PRODUCT_CATAGORY.catagory_type
  is '类目编号';
comment on column PRODUCT_CATAGORY.create_time
  is '创建时间';
comment on column PRODUCT_CATAGORY.update_time
  is '修改时间';
-- Create/Recreate primary, unique and foreign key constraints 
alter table PRODUCT_CATAGORY
  add constraint PC_ID primary key (CATAGORY_ID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2

  maxtrans 255;


-- Create table
create table ORDER_MASTER
(
  order_id      NVARCHAR2(32) not null,
  buyer_name    NVARCHAR2(32),
  buyer_phone   NVARCHAR2(32),
  buyer_address NVARCHAR2(128),
  buyer_openid  NVARCHAR2(64) not null,
  order_amount  NUMBER(10,2),
  order_status  CHAR(2) default '0',
  pay_status    CHAR(2) default '0',
  create_time   TIMESTAMP(6) default sysdate,
  update_time   TIMESTAMP(6)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Add comments to the columns 
comment on column ORDER_MASTER.buyer_name
  is '买家名字
';
comment on column ORDER_MASTER.buyer_phone
  is '买家电话';
comment on column ORDER_MASTER.buyer_address
  is '买家地址';
comment on column ORDER_MASTER.buyer_openid
  is '买家微信openid
';
comment on column ORDER_MASTER.order_amount
  is '订单总金额';
comment on column ORDER_MASTER.order_status
  is '订单订单状态(‘0’新下单)
';
comment on column ORDER_MASTER.pay_status
  is '支付状态(‘0’未支付)
';
-- Create/Recreate primary, unique and foreign key constraints 
alter table ORDER_MASTER
  add constraint OM_ID primary key (ORDER_ID, BUYER_OPENID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值