Refactor: Remove unused Convex HTTP routes and schema definitions
- Deleted `http.ts` which contained custom HTTP routes for authentication and JWKS. - Removed `schema.ts` that defined database schemas for `github_starred`, `users`, and `sessions`. - Updated `package.json` to remove the Convex dependency and updated other dependencies. - Deleted SQL script `clear.sql` for removing constraints from tables. - Removed `update.sh` script for updating dependencies. - Deleted demo application routes and models in `app-demo` directory. - Cleaned up unused modules and imports across various files. - Removed Redis and common utility scripts that were not in use. - Deleted test scripts related to user and bucket management.
This commit is contained in:
@@ -1,155 +0,0 @@
|
||||
-- =====================================================
|
||||
-- 删除 cf_orgs 表中所有带数字的重复唯一约束
|
||||
-- 保留 cf_orgs_username_key(不带数字的)
|
||||
-- =====================================================
|
||||
|
||||
DO $$
|
||||
DECLARE
|
||||
constraint_record RECORD;
|
||||
BEGIN
|
||||
FOR constraint_record IN
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'cf_orgs'::regclass
|
||||
AND conname LIKE 'cf_orgs_username_key%'
|
||||
AND conname != 'cf_orgs_username_key'
|
||||
AND conname ~ '[0-9]' -- 包含数字的
|
||||
ORDER BY conname
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE cf_orgs DROP CONSTRAINT IF EXISTS %I', constraint_record.conname);
|
||||
RAISE NOTICE '已删除约束: %', constraint_record.conname;
|
||||
END LOOP;
|
||||
END $$;
|
||||
|
||||
-- =====================================================
|
||||
-- 删除 cf_user 表中所有带数字的重复唯一约束
|
||||
-- 保留 cf_user_username_key(不带数字的)
|
||||
-- =====================================================
|
||||
|
||||
DO $$
|
||||
DECLARE
|
||||
constraint_record RECORD;
|
||||
BEGIN
|
||||
FOR constraint_record IN
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'cf_user'::regclass
|
||||
AND conname LIKE 'cf_user_username_key%'
|
||||
AND conname != 'cf_user_username_key'
|
||||
AND conname ~ '[0-9]' -- 包含数字的
|
||||
ORDER BY conname
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE cf_user DROP CONSTRAINT IF EXISTS %I', constraint_record.conname);
|
||||
RAISE NOTICE '已删除约束: %', constraint_record.conname;
|
||||
END LOOP;
|
||||
END $$;
|
||||
|
||||
-- =====================================================
|
||||
-- 验证删除结果
|
||||
-- =====================================================
|
||||
|
||||
-- 查看 cf_orgs 剩余的 username 约束
|
||||
SELECT 'cf_orgs 表剩余的 username 约束:' AS info;
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'cf_orgs'::regclass
|
||||
AND conname LIKE 'cf_orgs_username_key%'
|
||||
ORDER BY conname;
|
||||
|
||||
-- 查看 cf_user 剩余的 username 约束
|
||||
SELECT 'cf_user 表剩余的 username 约束:' AS info;
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'cf_user'::regclass
|
||||
AND conname LIKE 'cf_user_username_key%'
|
||||
ORDER BY conname;
|
||||
-- =====================================================
|
||||
-- 删除 kv_app_domain 表中所有带数字的重复唯一约束
|
||||
-- 保留 kv_app_domain_domain_key(不带数字的)
|
||||
-- =====================================================
|
||||
DO $$
|
||||
DECLARE
|
||||
constraint_record RECORD;
|
||||
BEGIN
|
||||
FOR constraint_record IN
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'kv_app_domain'::regclass
|
||||
AND conname LIKE 'kv_app_domain_domain_key%'
|
||||
AND conname != 'kv_app_domain_domain_key'
|
||||
AND conname ~ '[0-9]' -- 包含数字的
|
||||
ORDER BY conname
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE kv_app_domain DROP CONSTRAINT IF EXISTS %I', constraint_record.conname);
|
||||
RAISE NOTICE '已删除约束: %', constraint_record.conname;
|
||||
END LOOP;
|
||||
END $$;
|
||||
|
||||
-- =====================================================
|
||||
-- 删除 prompts 表中所有带数字的重复唯一约束
|
||||
-- 保留 prompts_key_key(不带数字的)
|
||||
-- =====================================================
|
||||
|
||||
DO $$
|
||||
DECLARE
|
||||
constraint_record RECORD;
|
||||
BEGIN
|
||||
FOR constraint_record IN
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'prompts'::regclass
|
||||
AND conname LIKE 'prompts_key_key%'
|
||||
AND conname != 'prompts_key_key'
|
||||
AND conname ~ '[0-9]' -- 包含数字的
|
||||
ORDER BY conname
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE prompts DROP CONSTRAINT IF EXISTS %I', constraint_record.conname);
|
||||
RAISE NOTICE '已删除约束: %', constraint_record.conname;
|
||||
END LOOP;
|
||||
END $$;
|
||||
|
||||
-- =====================================================
|
||||
-- 删除 apps_trades 表中所有带数字的重复唯一约束
|
||||
-- 保留 apps_trades_out_trade_no_key(不带数字的)
|
||||
-- =====================================================
|
||||
|
||||
DO $$
|
||||
DECLARE
|
||||
constraint_record RECORD;
|
||||
BEGIN
|
||||
FOR constraint_record IN
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'apps_trades'::regclass
|
||||
AND conname LIKE 'apps_trades_out_trade_no_key%'
|
||||
AND conname != 'apps_trades_out_trade_no_key'
|
||||
AND conname ~ '[0-9]' -- 包含数字的
|
||||
ORDER BY conname
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE apps_trades DROP CONSTRAINT IF EXISTS %I', constraint_record.conname);
|
||||
RAISE NOTICE '已删除约束: %', constraint_record.conname;
|
||||
END LOOP;
|
||||
END $$;
|
||||
|
||||
-- =====================================================
|
||||
-- 删除 ai_agent 表中所有带数字的重复唯一约束
|
||||
-- 保留 ai_agent_key_key(不带数字的)
|
||||
-- =====================================================
|
||||
|
||||
DO $$
|
||||
DECLARE
|
||||
constraint_record RECORD;
|
||||
BEGIN
|
||||
FOR constraint_record IN
|
||||
SELECT conname
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = 'ai_agent'::regclass
|
||||
AND conname LIKE 'ai_agent_key_key%'
|
||||
AND conname != 'ai_agent_key_key'
|
||||
AND conname ~ '[0-9]' -- 包含数字的
|
||||
ORDER BY conname
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE ai_agent DROP CONSTRAINT IF EXISTS %I', constraint_record.conname);
|
||||
RAISE NOTICE '已删除约束: %', constraint_record.conname;
|
||||
END LOOP;
|
||||
END $$;
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
pnpm i -g npm-check-updates
|
||||
ncu -u
|
||||
pnpm install
|
||||
|
||||
# /home/ubuntu/.nvm/versions/node/v22.14.0/bin/ncu -u
|
||||
Reference in New Issue
Block a user