update:
1. publish
This commit is contained in:
87
doc/sql/executed/20260420_increase.sql
Normal file
87
doc/sql/executed/20260420_increase.sql
Normal file
@@ -0,0 +1,87 @@
|
||||
alter table market_cash_performance
|
||||
add dividend_amount decimal(14, 2) default 0.00;
|
||||
comment on column market_cash_performance.dividend_amount is '可分红业绩';
|
||||
|
||||
|
||||
alter table market_performance_day_log
|
||||
add dividend_amount decimal(14, 2) default 0.00;
|
||||
comment on column market_performance_day_log.dividend_amount is '昨日可分红业绩';
|
||||
|
||||
alter table user_market_info
|
||||
add merchant_type int4 default 0 not null;
|
||||
comment on column user_market_info.merchant_type is '自营商家类型 0:未审核 1:个人商家 2:企业商家';
|
||||
|
||||
alter table user_market_info
|
||||
add store_name varchar(255) default '' not null;
|
||||
comment on column user_market_info.store_name is '店铺名称';
|
||||
CREATE INDEX idx_market_info_store_name ON user_market_info (store_name) where is_deleted = 0;
|
||||
|
||||
drop table if exists merchant_application;
|
||||
create table merchant_application
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8 not null,
|
||||
user_account varchar(20) not null,
|
||||
type int4 not null,
|
||||
store_name varchar(255) default '' not null,
|
||||
alipay_account text,
|
||||
wechat_account text,
|
||||
company_name varchar(100),
|
||||
business_license varchar(100),
|
||||
business_license_url TEXT,
|
||||
legal_person varchar(50),
|
||||
remark TEXT,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 1, -- 1: 待审核 -- 2: 已通过 -- 3: 已拒绝
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
CREATE INDEX idx_merchant_app_type_status ON merchant_application (type, status) where is_deleted = 0;
|
||||
CREATE INDEX idx_merchant_app_user_acc ON merchant_application (user_account) where is_deleted = 0;
|
||||
CREATE INDEX idx_merchant_app_user_id ON merchant_application (user_id) where is_deleted = 0;
|
||||
|
||||
comment on table merchant_application is '商家入驻申请表';
|
||||
comment on column merchant_application.id is '主键';
|
||||
comment on column merchant_application.user_id is '用户id';
|
||||
comment on column merchant_application.user_account is '用户账号';
|
||||
comment on column merchant_application.type is '商家类型: 0-未审核, 1-个人商家, 2-企业商家';
|
||||
comment on column merchant_application.store_name is '店铺名称';
|
||||
comment on column merchant_application.alipay_account is '支付宝账号';
|
||||
comment on column merchant_application.wechat_account is '微信账号';
|
||||
comment on column merchant_application.company_name is '公司名称(企业商家时必填)';
|
||||
comment on column merchant_application.business_license is '营业执照注册号';
|
||||
comment on column merchant_application.business_license_url is '营业执照图片URL';
|
||||
comment on column merchant_application.legal_person is '法人姓名';
|
||||
comment on column merchant_application.remark is '备注';
|
||||
comment on column merchant_application.create_user is '创建人';
|
||||
comment on column merchant_application.create_dept is '创建部门';
|
||||
comment on column merchant_application.create_time is '创建时间';
|
||||
comment on column merchant_application.update_user is '修改人';
|
||||
comment on column merchant_application.update_time is '修改时间';
|
||||
comment on column merchant_application.status is '状态: 1-待审核 2-已通过 3-已拒绝';
|
||||
comment on column merchant_application.is_deleted is '是否已删除';
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2046772140345806850', '1123598815738675201', 'application', '商家入驻', 'menu',
|
||||
'/market/marketMerchantApplication', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2046772140345806851', '2046772140345806850', 'application_add', '新增', 'add',
|
||||
'/market/marketMerchantApplication/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2046772140345806852', '2046772140345806850', 'application_edit', '修改', 'edit',
|
||||
'/market/marketMerchantApplication/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2046772140345806853', '2046772140345806850', 'application_delete', '删除', 'delete',
|
||||
'/api/blade-application/marketMerchantApplication/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2046772140345806854', '2046772140345806850', 'application_view', '查看', 'view',
|
||||
'/market/marketMerchantApplication/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
212
doc/sql/executed/20260424_increase.sql
Normal file
212
doc/sql/executed/20260424_increase.sql
Normal file
@@ -0,0 +1,212 @@
|
||||
drop table if exists merchant_catalog;
|
||||
create table merchant_catalog
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8 not null default -1,
|
||||
user_account varchar(20) not null,
|
||||
product_name varchar(255) not null default '',
|
||||
type int4 not null,
|
||||
main_image_urls text[] DEFAULT '{}' NOT NULL,
|
||||
detail_image_urls text[] DEFAULT '{}' NULL,
|
||||
thumb_image_url text NULL,
|
||||
specs JSONB DEFAULT '[]',
|
||||
cost_price DECIMAL(10, 2) DEFAULT 0.00 NOT NULL,
|
||||
remark TEXT,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
CREATE INDEX idx_merchant_catalog_type ON merchant_catalog (type) where is_deleted = 0;
|
||||
CREATE INDEX idx_merchant_catalog_user_id ON merchant_catalog (user_id) where is_deleted = 0;
|
||||
CREATE INDEX idx_merchant_catalog_user_id_account ON merchant_catalog (user_account) where is_deleted = 0;
|
||||
|
||||
comment on table merchant_catalog is '自营商家商品表';
|
||||
comment on column merchant_catalog.id is '主键';
|
||||
comment on column merchant_catalog.user_id is '用户id';
|
||||
comment on column merchant_catalog.user_account is '用户账号';
|
||||
comment on column merchant_catalog.type is '商品类型: 1-平台商品, 2-商家商品';
|
||||
comment on column merchant_catalog.product_name is '商品名称';
|
||||
comment on column merchant_catalog.main_image_urls is '商品主图';
|
||||
comment on column merchant_catalog.detail_image_urls is '商品详情图';
|
||||
comment on column merchant_catalog.thumb_image_url is '商品缩略图';
|
||||
comment on column merchant_catalog.specs is '商品型号';
|
||||
comment on column merchant_catalog.cost_price is '成本价(进货价, 单位为现金券)';
|
||||
comment on column merchant_catalog.remark is '备注';
|
||||
comment on column merchant_catalog.create_user is '创建人';
|
||||
comment on column merchant_catalog.create_dept is '创建部门';
|
||||
comment on column merchant_catalog.create_time is '创建时间';
|
||||
comment on column merchant_catalog.update_user is '修改人';
|
||||
comment on column merchant_catalog.update_time is '修改时间';
|
||||
comment on column merchant_catalog.status is '状态';
|
||||
comment on column merchant_catalog.is_deleted is '是否已删除';
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394562', '1123598815738675201', 'merchantcatalog', '自营商家商品表', 'menu',
|
||||
'/market/merchantCatalog', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394563', '2047553982355394562', 'merchantcatalog_add', '新增', 'add',
|
||||
'/market/merchantCatalog/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394564', '2047553982355394562', 'merchantcatalog_edit', '修改', 'edit',
|
||||
'/market/merchantCatalog/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394565', '2047553982355394562', 'merchantcatalog_delete', '删除', 'delete',
|
||||
'/api/market/merchantCatalog/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394566', '2047553982355394562', 'merchantcatalog_view', '查看', 'view',
|
||||
'/market/merchantCatalog/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
|
||||
drop table if exists merchant_product_inventory;
|
||||
create table merchant_product_inventory
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8 not null default -1,
|
||||
user_account varchar(20) not null,
|
||||
type int4 not null,
|
||||
product_name varchar(255) not null default '',
|
||||
product_id int8 not null,
|
||||
store_name varchar(255) not null,
|
||||
thumb_image_url text NULL,
|
||||
unit_price decimal(10, 2) default 0.00 not null,
|
||||
gift_type int4 default 0 NOT NULL,
|
||||
unit_gift_amount decimal(10, 2) default 0.00 not null,
|
||||
stock int4 default 0 NOT NULL,
|
||||
remark TEXT,
|
||||
version int4 DEFAULT 0 NULL,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
||||
|
||||
CREATE INDEX CONCURRENTLY idx_merch_inv_user_id_is_deleted ON merchant_product_inventory (user_id, is_deleted);
|
||||
CREATE INDEX CONCURRENTLY idx_merch_inv_prodname_trgm ON merchant_product_inventory USING GIN (product_name gin_trgm_ops) WHERE status = 1 AND is_deleted = 0;
|
||||
CREATE INDEX CONCURRENTLY idx_merch_inv_storename_trgm ON merchant_product_inventory USING GIN (store_name gin_trgm_ops) WHERE status = 1 AND is_deleted = 0;
|
||||
|
||||
comment on table merchant_product_inventory is '自营商家库存表';
|
||||
comment on column merchant_product_inventory.id is '主键';
|
||||
comment on column merchant_product_inventory.user_id is '用户id';
|
||||
comment on column merchant_product_inventory.user_account is '用户账号';
|
||||
comment on column merchant_product_inventory.type is '商品类型: 1-平台商品, 2-商家商品';
|
||||
comment on column merchant_product_inventory.product_name is '商品名称';
|
||||
comment on column merchant_product_inventory.product_id is '商品id';
|
||||
comment on column merchant_product_inventory.store_name is '店铺名称';
|
||||
comment on column merchant_product_inventory.thumb_image_url is '缩略图';
|
||||
comment on column merchant_product_inventory.unit_price is '商品单价';
|
||||
comment on column merchant_product_inventory.gift_type is '赠品类型 1-福利积分 2-佣金 3-现金券';
|
||||
comment on column merchant_product_inventory.unit_gift_amount is '赠品数量';
|
||||
comment on column merchant_product_inventory.stock is '库存数量';
|
||||
comment on column merchant_product_inventory.remark is '备注';
|
||||
comment on column merchant_product_inventory.create_user is '创建人';
|
||||
comment on column merchant_product_inventory.create_dept is '创建部门';
|
||||
comment on column merchant_product_inventory.create_time is '创建时间';
|
||||
comment on column merchant_product_inventory.update_user is '修改人';
|
||||
comment on column merchant_product_inventory.update_time is '修改时间';
|
||||
comment on column merchant_product_inventory.status is '状态 1-上架 2-下架';
|
||||
comment on column merchant_product_inventory.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394567', '1123598815738675201', 'merchantinventory', '自营商家库存表', 'menu',
|
||||
'/market/merchantInventory', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394568', '2047553982355394567', 'merchantinventory_add', '新增', 'add',
|
||||
'/market/merchantInventory/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394569', '2047553982355394567', 'merchantinventory_edit', '修改', 'edit',
|
||||
'/market/merchantInventory/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394570', '2047553982355394567', 'merchantinventory_delete', '删除', 'delete',
|
||||
'/api/market/merchantInventory/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
|
||||
is_deleted)
|
||||
VALUES ('2047553982355394571', '2047553982355394567', 'merchantinventory_view', '查看', 'view',
|
||||
'/market/merchantInventory/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
drop table if exists merchant_store_favorite;
|
||||
create table merchant_store_favorite
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8 not null default -1,
|
||||
merchant_id int8 not null default -1,
|
||||
store_name varchar(255) not null default '',
|
||||
remark varchar(255) not null default '',
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
create index idx_merchant_store_favorite_user_id on merchant_store_favorite (user_id) where is_deleted = 0;
|
||||
create index idx_merchant_store_favorite_merchant_id on merchant_store_favorite (merchant_id) where is_deleted = 0;
|
||||
|
||||
comment on table merchant_store_favorite is '自营商家店铺收藏表';
|
||||
comment on column merchant_store_favorite.id is '主键';
|
||||
comment on column merchant_store_favorite.user_id is '用户id';
|
||||
comment on column merchant_store_favorite.merchant_id is '商家id';
|
||||
comment on column merchant_store_favorite.store_name is '店铺名称';
|
||||
comment on column merchant_store_favorite.remark is '备注';
|
||||
comment on column merchant_store_favorite.create_user is '创建人';
|
||||
comment on column merchant_store_favorite.create_dept is '创建部门';
|
||||
comment on column merchant_store_favorite.create_time is '创建时间';
|
||||
comment on column merchant_store_favorite.update_user is '修改人';
|
||||
comment on column merchant_store_favorite.update_time is '修改时间';
|
||||
comment on column merchant_store_favorite.status is '状态';
|
||||
comment on column merchant_store_favorite.is_deleted is '是否已删除';
|
||||
|
||||
drop table if exists merchant_payout_account;
|
||||
create table merchant_payout_account
|
||||
(
|
||||
id int8 not null primary key,
|
||||
user_id int8 not null default -1,
|
||||
account_type int4 not null default -1,
|
||||
account_number varchar(255) not null default '',
|
||||
account_url text not null default '',
|
||||
remark varchar(255) not null default '',
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4,
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
create index idx_merchant_payout_account_user_id on merchant_payout_account (user_id) where is_deleted = 0;
|
||||
|
||||
|
||||
comment on table merchant_payout_account is '商家收款资料表';
|
||||
comment on column merchant_payout_account.id is '主键';
|
||||
comment on column merchant_payout_account.user_id is '用户id';
|
||||
comment on column merchant_payout_account.account_type is '账号类型 1:支付宝 2:微信';
|
||||
comment on column merchant_payout_account.account_number is '银行卡号';
|
||||
comment on column merchant_payout_account.account_url is '收款码图片';
|
||||
comment on column merchant_payout_account.remark is '备注';
|
||||
comment on column merchant_payout_account.create_user is '创建人';
|
||||
comment on column merchant_payout_account.create_dept is '创建部门';
|
||||
comment on column merchant_payout_account.create_time is '创建时间';
|
||||
comment on column merchant_payout_account.update_user is '修改人';
|
||||
comment on column merchant_payout_account.update_time is '修改时间';
|
||||
comment on column merchant_payout_account.status is '状态';
|
||||
comment on column merchant_payout_account.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user