refactor DB organization (prepping for more tables)
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import { Table } from "dexie";
|
||||
|
||||
export type Account = {
|
||||
id?: number;
|
||||
publicKey: string;
|
||||
mnemonic: string;
|
||||
id?: number; // auto-generated by Dexie
|
||||
dateCreated: Date;
|
||||
derivationPath: string;
|
||||
identity: string;
|
||||
dateCreated: number;
|
||||
};
|
||||
|
||||
export type AccountsTable = {
|
||||
accounts: Table<Account>;
|
||||
publicKeyHex: string;
|
||||
mnemonic: string;
|
||||
};
|
||||
|
||||
// mark encrypted field by starting with a $ character
|
||||
// see https://github.com/PVermeer/dexie-addon-suite-monorepo/tree/master/packages/dexie-encrypted-addon
|
||||
export const accountsSchema = {
|
||||
accounts: "++id, publicKey, $mnemonic, $identity, dateCreated",
|
||||
accounts:
|
||||
"++id, dateCreated, derivationPath, $identity, $mnemonic, publicKeyHex",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user