Merge branch 'refactor/backend-architecture' into development

This commit is contained in:
yangshilin
2026-03-18 17:18:23 +08:00
parent 2070a03d35
commit 48b70e1350
266 changed files with 12386 additions and 9690 deletions

View File

@@ -0,0 +1,19 @@
-- 添加 refresh_tokens.device_info 列的迁移脚本
-- 执行方式: psql -U postgres -d life_echo -f migrations/add_device_info_column.sql
-- 或者在 psql 中执行: \i migrations/add_device_info_column.sql
-- 检查列是否存在,如果不存在则添加
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'refresh_tokens'
AND column_name = 'device_info'
) THEN
ALTER TABLE refresh_tokens ADD COLUMN device_info VARCHAR;
RAISE NOTICE '已添加 refresh_tokens.device_info 列';
ELSE
RAISE NOTICE 'refresh_tokens.device_info 列已存在,跳过';
END IF;
END $$;