Files
openaccounting-server/dev.db

44 lines
196 KiB
Plaintext
Raw Normal View History

SQLite format 3@ 1  .v<><0F>0<0F><0F><0E> } +
(
<EFBFBD>t <09>Y;ZP<00><0F><00>c##<01> tablepermissionspermissionsCREATE TABLE `permissions` (`id` BINARY(16),`userId` BINARY(16),`tokenId` BINARY(16),`orgId` BINARY(16) NOT NULL,`accountId` BINARY(16) NOT NULL,`type` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_permissions_user` FOREIGN KEY (`userId`) REFERENCES `users`(`id`),CONSTRAINT `fk_permissions_token` FOREIGN KEY (`tokenId`) REFERENCES `tokens`(`id`),CONSTRAINT `fk_permissions_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`),CONSTRAINT `fk_permissions_account` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`))5I#indexsqlite_autoindex_permissions_1permissions<12><01>atablebalancesbalancesCREATE TABLE `balances` (`id` integer PRIMARY KEY AUTOINCREMENT,`date` integer NOT NULL,`accountId` BINARY(16) NOT NULL,`amount` integer NOT NULL,CONSTRAINT `fk_accounts_balances` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`))<29>|<01>StablesplitssplitsCREATE TABLE `splits` (`id` integer PRIMARY KEY AUTOINCREMENT,`transactionId` BINARY(16) NOT NULL,`accountId` BINARY(16) NOT NULL,`date` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`amount` integer NOT NULL,`nativeAmount` integer NOT NULL,`deleted` numeric DEFAULT false,CONSTRAINT `fk_transactions_splits` FOREIGN KEY (`transactionId`) REFERENCES `transactions`(`id`),CONSTRAINT `fk_accounts_splits` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`))<29>_ %%<01>tabletransactionstransactions CREATE TABLE `transactions` (`id` BINARY(16),`orgId` BINARY(16) NOT NULL,`userId` BINARY(16) NOT NULL,`date` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`description` text NOT NULL,`data` TEXT NOT NULL,`deleted` numeric DEFAULT false,PRIMARY KEY (`id`),CONSTRAINT `fk_transactions_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`),CONSTRAINT `fk_transactions_user` FOREIGN KEY (`userId`) REFERENCES `users`(`id`))7 K%indexsqlite_autoindex_transactions_1transactions<0E>
<01>Stableaccountsaccounts CREATE TABLE `accounts` (`id` BINARY(16),`orgId` BINARY(16) NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`name` text NOT NULL,`parent` BINARY(16) NOT NULL,`currency` text NOT NULL,`precision` integer NOT NULL,`debitBalance` numeric NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_orgs_accounts` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))/ Cindexsqlite_autoindex_accounts_1accounts <0C>S<01>tabletokenstokens CREATE TABLE `tokens` (`id` BINARY(16),`name` text,`userOrgId` integer NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_tokens_user_org` FOREIGN KEY (`userOrgId`) REFERENCES `user_orgs`(`id`))+ ?indexsqlite_autoindex_tokens_1tokens
P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)<29>T<01>wtableuser_orgsuser_orgsCREATE TABLE `user_orgs` (`id` integer PRIMARY KEY AUTOINCREMENT,`userId` BINARY(16) NOT NULL,`orgId` BINARY(16) NOT NULL,`admin` numeric DEFAULT false,CONSTRAINT `fk_users_user_orgs` FOREIGN KEY (`userId`) REFERENCES `users`(`id`),CONSTRAINT `fk_orgs_user_orgs` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))<29>7<01>MtableusersusersCREATE TABLE `users` (`id` BINARY(16),`inserted` integer NOT NULL,`updated` integer NOT NULL,`firstName` text NOT NULL,`lastName` text NOT NULL,`email` text NOT NULL,`passwordHash` text NOT NULL,`agreeToTerms` numeric NOT NULL,`passwordReset` text NOT NULL,`emailVerified` numeric NOT NULL,`emailVerifyCode` text NOT NULL,`signupSource` text NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `uni_users_email` UNIQUE (`email`)))=indexsqlite_autoindex_users_2users)=indexsqlite_autoindex_users_1users<05>h<01>3tableorgsorgsCREATE TABLE `orgs` (`id` BINARY(16),`inserted` integer NOT NULL,`updated` integer NOT NULL,`name` text NOT NULL,`currency` text NOT NULL,`precision` integer NOT NULL,`timezone` text NOT NULL,PRIMARY KEY (`id`))';indexsqlite_autoindex_orgs_1org 








(
<EFBFBD>t <09>Y;ZP<00><00><00><00>c##<01> tablepermissionspermissionsCREATE TABLE `per+?indexsqlite_autoindex_prices_1prices<14>c##<01> tablepermissionspermissionsCREATE TABLE `per<65>c##<01> tablepermissionspermissionsCREATE TABLE `permissions` (`id` BINARY(16),`userId` BINARY(16),`tokenId` BINARY(16),`orgId` BINARY(16) NOT NULL,`accountId` BINARY(16) NOT NULL,`type` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_permissions_user` FOREIGN KEY (`userId`) REFERENCES `users`(`id`),CONSTRAINT `fk_permissions_token` FOREIGN KEY (`tokenId`) REFERENCES `tokens`(`id`),CONSTRAINT `fk_permissions_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`),CONSTRAINT `fk_permissions_account` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`))<29><01>atablebalancesbalancesCREATE TABLE `balances` (`id` integer PRIMARY KEY AUTOINCREMENT,`date` integer NOT NULL,`accountId` BINARY(16) NOT NULL,`amount` integer NOT NULL,CONSTRAINT `fk_accounts_balances` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`))<29>|<01>StablesplitssplitsCREATE TABLE `splits` (`id` integer PRIMARY KEY AUTOINCREMENT,`transactionId` BINARY(16) NOT NULL,`accountId` BINARY(16) NOT NULL,`date` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`amount` integer NOT NULL,`nativeAmount` integer NOT NULL,`deleted` numeric DEFAULT false,CONSTRAINT `fk_transactions_splits` FOREIGN KEY (`transactionId`) REFERENCES `transactions`(`id`),CONSTRAINT `fk_accounts_splits` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`))<29>_ %%<01>tabletransactionstransactions CREATE TABLE `transactions` (`id` BINARY(16),`orgId` BINARY(16) NOT NULL,`userId` BINARY(16) NOT NULL,`date` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`description` text NOT NULL,`data` TEXT NOT NULL,`deleted` numeric DEFAULT false,PRIMARY KEY (`id`),CONSTRAINT `fk_transactions_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`),CONSTRAINT `fk_transactions_user` FOREIGN KEY (`userId`) REFERENCES `users`(`id`))7 K%indexsqlite_autoindex_transactions_1transactions<0E>
<01>Stableaccountsaccounts CREATE TABLE `accounts` (`id` BINARY(16),`orgId` BINARY(16) NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`name` text NOT NULL,`parent` BINARY(16) NOT NULL,`currency` text NOT NULL,`precision` integer NOT NULL,`debitBalance` numeric NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_orgs_accounts` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))/ Cindexsqlite_autoindex_accounts_1accounts <0C>S<01>tabletokenstokens CREATE TABLE `tokens` (`id` BINARY(16),`name` text,`userOrgId` integer NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_tokens_user_org` FOREIGN KEY (`userOrgId`) REFERENCES `user_orgs`(`id`))+ ?indexsqlite_autoindex_tokens_1tokens
P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)<29>T<01>wtableuser_orgsuser_orgsCREATE TABLE `user_orgs` (`id` integer PRIMARY KEY AUTOINCREMENT,`userId` BINARY(16) NOT NULL,`orgId` BINARY(16) NOT NULL,`admin` numeric DEFAULT false,CONSTRAINT `fk_users_user_orgs` FOREIGN KEY (`userId`) REFERENCES `users`(`id`),CONSTRAINT `fk_orgs_user_orgs` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))<29>7<01>MtableusersusersCREATE TABLE `users` (`id` BINARY(16),`inserted` integer NOT NULL,`updated` integer NOT NULL,`firstName` text NOT NULL,`lastName` text NOT NULL,`email` text NOT NULL,`passwordHash` text NOT NULL,`agreeToTerms` numeric NOT NULL,`passwordReset` text NOT NULL,`emailVerified` numeric NOT NULL,`emailVerifyCode` text NOT NULL,`signupSource` text NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `uni_users_email` UNIQUE (`email`)))=indexsqlite_autoindex_users_2users)=indexsqlite_autoindex_users_1users<05>h<01>3tableorgsorgsCREATE TABLE `orgs` (`id` BINARY(16),`inserted` integer NOT NULL,`updated` integer NOT NULL,`name` text NOT NULL,`currency` text NOT NULL,`precision` integer NOT NULL,`timezone` text NOT NULL,PRIMARY KEY (`id`))';indexsqlite_autoindex_orgs_1orgs = <00> <0A>
N <08><07><08>Kr<04>r<00><0F>D<0E><0E>, <0A> B <0C> r  <0B> 9
<EFBFBD>
<EFBFBD>OT++mindexidx_userorg_orguser_orgs.CREATE INDEX idx_userorg_org ON user_orgs(orgId)<29>!!<01>utableattachmentattachmentCREATE TABLE `attachment` (`id` BINARY(16),`transactionId` BINARY(16) NOT NULL,`orgId` BINARY(16) NOT NULL,`userId` BINARY(16) NOT NULL,`fileName` text NOT NULL,`originalName` text NOT NULL,`contentType` text NOT NULL,`fileSize` integer NOT NULL,`filePath` text NOT NULL,`description` text,`uploaded` datetime NOT NULL,`deleted` numeric DEFAULT false,PRIMARY KEY (`id`),CONSTRAINT `fk_attachment_transaction` FOREIGN KEY (`transactionId`) REFERENCES `transactions`(`id`),CONSTRAINT `fk_attachment_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`),CONSTRAINT `fk_attachment_user` FOREIGN KEY (`userId`) REFERENCES `users`(`id`))
<EFBFBD>5G!indexsqlite_autoindex_attachment_1attachment<1F>%%<01>Mtablebudget_itemsbudget_itemsCREATE TABLE `budget_items` (`id` integer PRIMARY KEY AUTOINCREMENT,`orgId` BINARY(16) NOT NULL,`accountId` BINARY(16) NOT NULL,`inserted` integer NOT NULL,`amount` integer NOT NULL,CONSTRAINT `fk_budget_items_account` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`),CONSTRAINT `fk_budget_items_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))<29><01>tableinvitesinvitesCREATE TABLE `invites` (`id` text,`orgId` BINARY(16) NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`email` text NOT NULL,`accepted` numeric NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_invites_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))-Aindexsqlite_autoindex_invites_1invites<1C>$<01>tableapi_keysapi_keysCREATE TABLE `api_keys` (`id` BINARY(16),`inserted` integer NOT NULL,`updated` integer NOT NULL,`userId` BINARY(16) NOT NULL,`label` text NOT NULL,`deleted` integer,PRIMARY KEY (`id`),CONSTRAINT `fk_users_api_keys` FOREIGN KEY (`userId`) REFERENCES `users`(`id`))/Cindexsqlite_autoindex_api_keys_1api_keys<1A><01>utablesessionssessionsCREATE TABLE `sessions` (`id` BINARY(16),`inserted` integer NOT NULL,`updated` integer NOT NULL,`userId` BINARY(16) NOT NULL,`terminated` integer,PRIMARY KEY (`id`),CONSTRAINT `fk_users_sessions` FOREIGN KEY (`userId`) REFERENCES `users`(`id`))/Cindexsqlite_autoindex_sessions_1sessions+?indexsqlite_autoindex_prices_1prices<14>6<01>GtablepricespricesCREATE TABLE `prices` (`id` BINARY(16),`orgId` BINARY(16) NOT NULL,`currency` text NOT NULL,`date` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,`price` real NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_prices_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`))5I#indexsqlite_autoindex_permissions_1permissions-qindexidx_userorg_useruser_orgs-CREATE INDEX idx_userorg_user ON user_orgs(userId)Y)1sindexidx_account_parentaccounts,CREATE INDEX idx_account_parent ON accounts(parent)b(3%{indexidx_transaction_orgtransactions+CREATE INDEX idx_transaction_org ON transactions(orgId)c'5%{indexidx_transaction_datetransactions*CREATE INDEX idx_transaction_date ON transactions(date)n&?!<01> indexattachment_uploaded_indexattachment)CREATE INDEX attachment_uploaded_index ON attachment(uploaded)h%;!<01>indexattachment_userId_indexattachment(CREATE INDEX attachment_userId_index ON attachment(userId)d$9!}indexattachment_orgId_indexattachment'CREATE INDEX attachment_orgId_index ON attachment(orgId)}#I!<01>indexattachment_transactionId_indexattachment&CREATE INDEX attachment_transacti<74>c##<01> tablepermissionspermissionsCREATE TABLE `permissions` (`id` BINARY(16),`userId` BINARY(16),`tokenId` BINARY(16),`orgId` BINARY(16) NOT NULL,`accountId` BINARY(16) NOT NULL,`type` integer NOT NULL,`inserted` integer NOT NULL,`updated` integer NOT NULL,PRIMARY KEY (`id`),CONSTRAINT `fk_permissions_user` FOREIGN KEY (`userId`) REFERENCES `users`(`id`),CONSTRAINT `fk_permissions_token` FOREIGN KEY (`tokenId`) REFERENCES `tokens`(`id`),CONSTRAINT `fk_permissions_org` FOREIGN KEY (`orgId`) REFERENCES `orgs`(`id`),CONSTRAINT `fk_permissions_account` FOREIGN KEY (`accountId`) REFERENCES `accounts`(`id`)) 




















<EFBFBD>
P <09> <09> z-A#<01>indexidx_permission_org_accountpermissions1CREATE INDEX idx_permission_org_account ON permissions(orgId, accountId)o,=<01>indexidx_balance_account_datebalances/CREATE INDEX idx_balance_account_date ON balances(accountId, date)T++mindexidx_userorg_orguser_orgs.CREATE INDEX idx_userorg_org ON user_orgs(orgId)W*-qindexidx_userorg_useruser_orgs-CREATE INDEX idx_userorg_user ON user_orgs(userId)Y)1sindexidx_account_parentaccounts,CREATE INDEX idx_account_parent ON accounts(parent)b(3%{indexidx_transaction_orgtransactions+CREATE INDEX idx_transaction_org ON transactions(orgId)c'5%{indexidx_transaction_datetransactions*CREATE INDEX idx_transaction_date ON transactions(date)n&?!<01> indexattachment_uploaded_indexattachment)CREATE INDEX attachment_uploaded_index ON attachment(uploaded)h%;!<01>indexattachment_userId_indexattachment(CREATE INDEX attachment_userId_index ON attachment(userId)d$9!}indexattachment_orgId_indexattachment'CREATE INDEX attachment_orgId_index ON attachment(orgId)}#I!<01>indexattachment_transactionId_indexattachment&CREATE INDEX attachment_transactionId_index ON attachment(transactionId)i"9%<01>indexbudgetitem_orgId_indexbudget_items%CREATE INDEX budgetitem_orgId_index ON budget_items(orgId)X!3sindexsplit_updated_indexsplits$CREATE INDEX split_updated_index ON splits(updated)O -gindexsplit_date_indexsplits#CREATE INDEX split_date_index ON splits(date)k?<01> indexsplit_transactionId_indexsplits"CREATE INDEX split_transactionId_index ON splits(transactionId)^7{indexsplit_accountId_indexsplits!CREATE INDEX split_accountId_index ON splits(accountId)Z3sindexaccount_orgId_indexaccounts CREATE INDEX account_orgId_index ON accounts(orgId)3G!indexsqlite_autoindex_attachment_1attachment