feat: update addresses and wallets table; add config table
This commit is contained in:
parent
a2f48de583
commit
8e4e0bdf2d
1 changed files with 47 additions and 0 deletions
|
|
@ -34,3 +34,50 @@ async def m001_initial(db):
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def m002_add_columns_to_adresses(db):
|
||||||
|
"""
|
||||||
|
Add 'branch_index', 'address_index', 'has_activity' and 'note' columns to the 'addresses' table
|
||||||
|
"""
|
||||||
|
|
||||||
|
await db.execute(
|
||||||
|
"ALTER TABLE watchonly.addresses ADD COLUMN branch_index INTEGER NOT NULL DEFAULT 0;"
|
||||||
|
)
|
||||||
|
await db.execute(
|
||||||
|
"ALTER TABLE watchonly.addresses ADD COLUMN address_index INTEGER NOT NULL DEFAULT 0;"
|
||||||
|
)
|
||||||
|
await db.execute(
|
||||||
|
"ALTER TABLE watchonly.addresses ADD COLUMN has_activity BOOLEAN DEFAULT false;"
|
||||||
|
)
|
||||||
|
await db.execute("ALTER TABLE watchonly.addresses ADD COLUMN note TEXT;")
|
||||||
|
|
||||||
|
|
||||||
|
async def m003_add_columns_to_wallets(db):
|
||||||
|
"""
|
||||||
|
Add 'type' and 'fingerprint' columns to the 'wallets' table
|
||||||
|
"""
|
||||||
|
|
||||||
|
await db.execute("ALTER TABLE watchonly.wallets ADD COLUMN type TEXT;")
|
||||||
|
await db.execute(
|
||||||
|
"ALTER TABLE watchonly.wallets ADD COLUMN fingerprint TEXT NOT NULL;"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
async def m004_create_config_table(db):
|
||||||
|
"""
|
||||||
|
Allow the extension to persist and retrieve any number of config values.
|
||||||
|
Each user has its configurations saved as a JSON string
|
||||||
|
"""
|
||||||
|
|
||||||
|
await db.execute(
|
||||||
|
"""CREATE TABLE watchonly.config (
|
||||||
|
"user" TEXT NOT NULL,
|
||||||
|
json_data TEXT NOT NULL
|
||||||
|
);"""
|
||||||
|
)
|
||||||
|
|
||||||
|
### TODO: fix statspay dependcy first
|
||||||
|
# await db.execute(
|
||||||
|
# "DROP TABLE watchonly.wallets;"
|
||||||
|
# )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue