feat: 添加系统刷新令牌请求和用户统计响应的 OpenAPI 规范
feat: 添加微信认证相关的 OpenAPI 规范,包括用户信息、登录请求和个人资料请求 feat: 添加 is_delete 字段迁移脚本,支持在集合中添加软删除字段 feat: 添加软删除规则应用脚本,确保所有相关集合的查询规则包含软删除条件 feat: 添加购物车和订单业务 ID 自动生成的迁移脚本,确保字段类型和自动生成规则正确
This commit is contained in:
@@ -12,6 +12,7 @@ try {
|
||||
|
||||
const PB_URL = (process.env.PB_URL || 'https://bai-api.blv-oa.com/pb').replace(/\/+$/, '');
|
||||
const AUTH_TOKEN = process.env.POCKETBASE_AUTH_TOKEN || runtimeConfig.POCKETBASE_AUTH_TOKEN || '';
|
||||
const SOFT_DELETE_RULE = 'is_delete = 0';
|
||||
|
||||
if (!AUTH_TOKEN) {
|
||||
console.error('❌ 缺少 POCKETBASE_AUTH_TOKEN,无法执行建表。');
|
||||
@@ -24,8 +25,8 @@ const collections = [
|
||||
{
|
||||
name: 'tbl_attachments',
|
||||
type: 'base',
|
||||
listRule: '',
|
||||
viewRule: '',
|
||||
listRule: SOFT_DELETE_RULE,
|
||||
viewRule: SOFT_DELETE_RULE,
|
||||
fields: [
|
||||
{ name: 'attachments_id', type: 'text', required: true },
|
||||
{ name: 'attachments_link', type: 'file', maxSelect: 0, maxSize: 4294967296, mimeTypes: [] },
|
||||
@@ -37,6 +38,7 @@ const collections = [
|
||||
{ name: 'attachments_ocr', type: 'text' },
|
||||
{ name: 'attachments_status', type: 'text' },
|
||||
{ name: 'attachments_remark', type: 'text' },
|
||||
{ name: 'is_delete', type: 'number', default: 0, min: 0, max: 1, onlyInt: true },
|
||||
],
|
||||
indexes: [
|
||||
'CREATE UNIQUE INDEX idx_tbl_attachments_attachments_id ON tbl_attachments (attachments_id)',
|
||||
@@ -47,8 +49,8 @@ const collections = [
|
||||
{
|
||||
name: 'tbl_document',
|
||||
type: 'base',
|
||||
listRule: '',
|
||||
viewRule: '',
|
||||
listRule: SOFT_DELETE_RULE,
|
||||
viewRule: SOFT_DELETE_RULE,
|
||||
fields: [
|
||||
{ name: 'document_id', type: 'text', required: true },
|
||||
{ name: 'document_create', type: 'autodate', onCreate: true, onUpdate: false },
|
||||
@@ -77,6 +79,7 @@ const collections = [
|
||||
{ name: 'document_application_scenarios', type: 'text' },
|
||||
{ name: 'document_hotel_type', type: 'text' },
|
||||
{ name: 'document_remark', type: 'text' },
|
||||
{ name: 'is_delete', type: 'number', default: 0, min: 0, max: 1, onlyInt: true },
|
||||
],
|
||||
indexes: [
|
||||
'CREATE UNIQUE INDEX idx_tbl_document_document_id ON tbl_document (document_id)',
|
||||
@@ -99,6 +102,7 @@ const collections = [
|
||||
{ name: 'doh_user_id', type: 'text' },
|
||||
{ name: 'doh_current_count', type: 'number' },
|
||||
{ name: 'doh_remark', type: 'text' },
|
||||
{ name: 'is_delete', type: 'number', default: 0, min: 0, max: 1, onlyInt: true },
|
||||
],
|
||||
indexes: [
|
||||
'CREATE UNIQUE INDEX idx_tbl_document_operation_history_doh_id ON tbl_document_operation_history (doh_id)',
|
||||
|
||||
Reference in New Issue
Block a user