16 lines
498 B
Python
16 lines
498 B
Python
"""修复剩余 site_id integer → bigint"""
|
|
import os
|
|
from pathlib import Path
|
|
from dotenv import load_dotenv
|
|
import psycopg2
|
|
|
|
load_dotenv(Path(__file__).resolve().parents[2] / ".env")
|
|
conn = psycopg2.connect(os.environ["PG_DSN"], connect_timeout=5)
|
|
conn.autocommit = True
|
|
cur = conn.cursor()
|
|
|
|
print("修复 dws.dws_assistant_order_contribution.site_id → bigint ...")
|
|
cur.execute("ALTER TABLE dws.dws_assistant_order_contribution ALTER COLUMN site_id TYPE bigint")
|
|
print("完成")
|
|
conn.close()
|