微信小程序页面迁移校验之前 P5任务处理之前

This commit is contained in:
Neo
2026-03-09 01:19:21 +08:00
parent 263bf96035
commit 6e20987d2f
1112 changed files with 153824 additions and 219694 deletions

View File

@@ -0,0 +1,17 @@
"""查询 auth.users 表的 CHECK 约束"""
import os
import psycopg2
from dotenv import load_dotenv
load_dotenv()
dsn = os.environ["APP_DB_DSN"]
conn = psycopg2.connect(dsn)
cur = conn.cursor()
cur.execute("""
SELECT conname, pg_get_constraintdef(oid)
FROM pg_constraint
WHERE conrelid = 'auth.users'::regclass AND contype = 'c'
""")
for row in cur.fetchall():
print(f"{row[0]}: {row[1]}")
conn.close()