Merge pull request #2 from Uthpala/add-migrations

add migrations
This commit is contained in:
Uthpala 2022-12-11 17:53:48 +01:00 committed by GitHub
commit e7d1309c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,29 @@
# async def m001_initial(db): async def m001_initial(db):
# await db.execute( await db.execute(
# f""" f"""
# CREATE TABLE example.example ( CREATE TABLE deezy.ln_to_btc_swap (
# id TEXT PRIMARY KEY, id TEXT PRIMARY KEY,
# wallet TEXT NOT NULL, amount_sats {db.big_int} NOT NULL,
# time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now} on_chain_address TEXT NOT NULL,
# ); on_chain_sats_per_vbyte INT NOT NULL,
# """ bolt11_invoice TEXT NOT NULL,
# ) fee_sats {db.big_int} NOT NULL,
txid TEXT NULL,
tx_hex TEXT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
"""
)
await db.execute(
f"""
CREATE TABLE deezy.btc_to_ln_swap (
id TEXT PRIMARY KEY,
ln_address TEXT NOT NULL,
on_chain_address TEXT NOT NULL,
secret_access_key TEXT NOT NULL,
commitment TEXT NOT NULL,
signature TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
"""
)