lnbits-legend/lnbits/extensions/subdomains/migrations.py

42 lines
1.1 KiB
Python
Raw Normal View History

async def m001_initial(db):
await db.execute(
"""
2021-06-22 04:22:52 +02:00
CREATE TABLE subdomains.domain (
id TEXT PRIMARY KEY,
wallet TEXT NOT NULL,
2020-12-28 22:32:04 +01:00
domain TEXT NOT NULL,
webhook TEXT,
cf_token TEXT NOT NULL,
cf_zone_id TEXT NOT NULL,
description TEXT NOT NULL,
cost INTEGER NOT NULL,
amountmade INTEGER NOT NULL,
2020-12-31 18:39:16 +01:00
allowed_record_types TEXT NOT NULL,
2021-07-03 17:08:18 +02:00
time TIMESTAMP NOT NULL DEFAULT """
+ db.timestamp_now
+ """
);
"""
)
await db.execute(
"""
2021-06-22 04:22:52 +02:00
CREATE TABLE subdomains.subdomain (
id TEXT PRIMARY KEY,
2020-12-28 22:32:04 +01:00
domain TEXT NOT NULL,
email TEXT NOT NULL,
subdomain TEXT NOT NULL,
ip TEXT NOT NULL,
wallet TEXT NOT NULL,
sats INTEGER NOT NULL,
duration INTEGER NOT NULL,
paid BOOLEAN NOT NULL,
2020-12-31 18:39:16 +01:00
record_type TEXT NOT NULL,
2021-07-03 17:08:18 +02:00
time TIMESTAMP NOT NULL DEFAULT """
+ db.timestamp_now
+ """
);
"""
2020-12-31 18:50:16 +01:00
)