parent
4e6d61fa01
commit
e2f97f05dd
5 changed files with 55 additions and 31 deletions
|
|
@ -1,3 +1,6 @@
|
|||
from time import time
|
||||
|
||||
|
||||
async def m001_initial(db):
|
||||
"""
|
||||
Creates an improved withdraw table and migrates the existing data.
|
||||
|
|
@ -132,3 +135,17 @@ async def m006_webhook_headers_and_body(db):
|
|||
"ALTER TABLE withdraw.withdraw_link ADD COLUMN webhook_headers TEXT;"
|
||||
)
|
||||
await db.execute("ALTER TABLE withdraw.withdraw_link ADD COLUMN webhook_body TEXT;")
|
||||
|
||||
|
||||
async def m007_add_created_at_timestamp(db):
|
||||
await db.execute(
|
||||
"ALTER TABLE withdraw.withdraw_link "
|
||||
f"ADD COLUMN created_at TIMESTAMP DEFAULT {db.timestamp_column_default}"
|
||||
)
|
||||
# Set created_at to current time for all existing rows
|
||||
await db.execute(
|
||||
f"""
|
||||
UPDATE withdraw.withdraw_link SET created_at = {db.timestamp_placeholder}
|
||||
""",
|
||||
(int(time()),),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue