Files
his/sql/迁移记录-DB变更记录/202512301200verify_order_main.sql
zhangfei 9c3e603b94 Fix Bug #443: 手术计费:点击签发耗材时异常报错
当手术计费弹窗中点击"签发"耗材时,因耗材的locationId(发放库房)为空导致后端异常。
在DoctorStationAdviceAppServiceImpl.handDevice方法中,当locationId为null时,使用登录用户的科室ID作为默认值,
与NurseBillingAppService中的处理方式保持一致。
2026-05-08 09:14:18 +08:00

52 lines
1.2 KiB
SQL
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 验证order_main表是否创建成功
-- 1. 查看表结构
\d order_main;
-- 2. 查看表注释
SELECT
obj_description('order_main'::regclass) AS table_comment;
-- 3. 查看字段注释使用pg_catalog.pg_description
SELECT
a.attname AS column_name,
d.description AS column_comment
FROM pg_attribute a
LEFT JOIN pg_catalog.pg_description d
ON d.objoid = a.attrelid
AND d.objsubid = a.attnum
WHERE a.attrelid = 'order_main'::regclass
AND a.attnum > 0
AND NOT a.attisdropped
ORDER BY a.attnum;
-- 4. 查看索引
SELECT
indexname AS index_name,
indexdef AS index_definition
FROM pg_indexes
WHERE tablename = 'order_main';
-- 5. 查看迁移历史
SELECT * FROM __MigrationsHistory
WHERE MigrationId = '202512301200add_table_order_main';
-- 6. 查看表的所有约束
SELECT
conname AS constraint_name,
contype AS constraint_type
FROM pg_constraint
WHERE conrelid = 'order_main'::regclass;
-- 7. 查看序列
SELECT
sequencename AS sequence_name,
last_value,
start_value,
increment_by
FROM pg_sequences
WHERE sequencename = 'order_main_id_seq';
-- 8. 统计表记录数
SELECT COUNT(*) AS record_count FROM order_main;