import sqlite3
import os

SQLITE_DB_FILE = os.path.dirname(
    os.path.realpath(__file__)) + "/data/wallets.db"

SQLITE_DB_FILE_KNOWN_ADDRESSES = os.path.dirname(
    os.path.realpath(__file__)) + "/data/known_addresses.db"

if __name__ == '__main__':
    if not os.path.exists(SQLITE_DB_FILE):
        with sqlite3.connect(SQLITE_DB_FILE) as conn:
            cursor = conn.cursor()
            cursor.execute(
                "CREATE TABLE Wallets (id INTEGER PRIMARY KEY, network TEXT NOT NULL, mnemonic TEXT NOT NULL, label TEXT)")
            conn.commit()
    if not os.path.exists(SQLITE_DB_FILE_KNOWN_ADDRESSES):
        with sqlite3.connect(SQLITE_DB_FILE_KNOWN_ADDRESSES) as conn:
            cursor = conn.cursor()
            cursor.execute(
                "CREATE TABLE KnownAddresses (id INTEGER PRIMARY KEY, network TEXT NOT NULL, address TEXT NOT NULL UNIQUE)")

import sqlite3
import os

SQLITE_DB_FILE = os.path.dirname(
    os.path.realpath(__file__)) + "/data/wallets.db"

SQLITE_DB_FILE_KNOWN_ADDRESSES = os.path.dirname(
    os.path.realpath(__file__)) + "/data/known_addresses.db"

if __name__ == '__main__':
    if not os.path.exists(SQLITE_DB_FILE):
        with sqlite3.connect(SQLITE_DB_FILE) as conn:
            cursor = conn.cursor()
            cursor.execute(
                "CREATE TABLE Wallets (id INTEGER PRIMARY KEY, network TEXT NOT NULL, mnemonic TEXT NOT NULL, label TEXT)")
            conn.commit()
    if not os.path.exists(SQLITE_DB_FILE_KNOWN_ADDRESSES):
        with sqlite3.connect(SQLITE_DB_FILE_KNOWN_ADDRESSES) as conn:
            cursor = conn.cursor()
            cursor.execute(
                "CREATE TABLE KnownAddresses (id INTEGER PRIMARY KEY, network TEXT NOT NULL, address TEXT NOT NULL UNIQUE)")
