mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
1 line
26 KiB
JSON
1 line
26 KiB
JSON
[{"sql":["CREATE SCHEMA \"actual\";\n"],"bps":true,"folderMillis":1746804001125,"hash":"5050e5bf66f30f201884b31e83f62edc5a7d63c806c6b2ba49a5e7764ac35271"},{"sql":["CREATE TABLE \"actual\".\"banks\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"bank_id\" text,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nCREATE INDEX \"banks_bank_id_index\" ON \"actual\".\"banks\" USING btree (\"bank_id\") WHERE \"actual\".\"banks\".\"tombstone\" IS FALSE;"],"bps":true,"folderMillis":1746804080933,"hash":"84b1a4418724b1668511a6d740c70e8959cf9af831a4af9ba6acabf1b8aba11a"},{"sql":["CREATE TABLE \"actual\".\"accounts\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"offbudget\" boolean DEFAULT false,\n\t\"closed\" boolean DEFAULT false,\n\t\"sort_order\" bigint,\n\t\"account_id\" text,\n\t\"balance_current\" bigint,\n\t\"balance_available\" bigint,\n\t\"balance_limit\" bigint,\n\t\"mask\" text,\n\t\"official_name\" text,\n\t\"type\" text,\n\t\"subtype\" text,\n\t\"bank\" varchar(36),\n\t\"account_sync_source\" text,\n\t\"last_sync\" bigint,\n\t\"last_reconciled\" bigint,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nALTER TABLE \"actual\".\"accounts\" ADD CONSTRAINT \"accounts_bank_banks_id_fk\" FOREIGN KEY (\"bank\") REFERENCES \"actual\".\"banks\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"accounts_name_index\" ON \"actual\".\"accounts\" USING btree (\"name\") WHERE \"actual\".\"accounts\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"accounts_bank_index\" ON \"actual\".\"accounts\" USING btree (\"bank\") WHERE \"actual\".\"accounts\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"accounts_sort_order_name_index\" ON \"actual\".\"accounts\" USING btree (\"sort_order\",\"name\");"],"bps":true,"folderMillis":1746804090229,"hash":"36146e4cd1b5416d5b6b8eea22f739c815274bb9e76765640f07d3e051b8c32f"},{"sql":["CREATE TABLE \"actual\".\"category_groups\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"is_income\" boolean DEFAULT false,\n\t\"sort_order\" bigint,\n\t\"hidden\" boolean DEFAULT false,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nCREATE INDEX \"category_groups_name_index\" ON \"actual\".\"category_groups\" USING btree (\"name\") WHERE \"actual\".\"category_groups\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"category_groups_is_income_sort_order_id_index\" ON \"actual\".\"category_groups\" USING btree (\"is_income\",\"sort_order\",\"id\");","\nCREATE INDEX \"category_groups_sort_order_id_index\" ON \"actual\".\"category_groups\" USING btree (\"sort_order\",\"id\");"],"bps":true,"folderMillis":1746804097946,"hash":"04422a90c7c65cacbad6eca63399e7c8c871fc1f44f924c1becd51836147b9a1"},{"sql":["CREATE TABLE \"actual\".\"categories\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"is_income\" boolean DEFAULT false,\n\t\"cat_group\" varchar(36),\n\t\"sort_order\" bigint,\n\t\"hidden\" boolean DEFAULT false,\n\t\"goal_def\" jsonb,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nALTER TABLE \"actual\".\"categories\" ADD CONSTRAINT \"categories_cat_group_category_groups_id_fk\" FOREIGN KEY (\"cat_group\") REFERENCES \"actual\".\"category_groups\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"categories_name_index\" ON \"actual\".\"categories\" USING btree (\"name\") WHERE \"actual\".\"categories\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"categories_cat_group_index\" ON \"actual\".\"categories\" USING btree (\"cat_group\") WHERE \"actual\".\"categories\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"categories_sort_order_id_index\" ON \"actual\".\"categories\" USING btree (\"sort_order\",\"id\");","\nCREATE INDEX \"categories_goal_def_index\" ON \"actual\".\"categories\" USING btree (\"goal_def\" NULLS FIRST);"],"bps":true,"folderMillis":1746804110341,"hash":"d10a3dbe1559c511c2695596a2c398d198175211783f3eab99f1877130bb76bd"},{"sql":["CREATE TABLE \"actual\".\"category_mapping\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"transfer_id\" varchar(36)\n);\n","\nALTER TABLE \"actual\".\"category_mapping\" ADD CONSTRAINT \"category_mapping_id_categories_id_fk\" FOREIGN KEY (\"id\") REFERENCES \"actual\".\"categories\"(\"id\") ON DELETE no action ON UPDATE no action;","\nALTER TABLE \"actual\".\"category_mapping\" ADD CONSTRAINT \"category_mapping_transfer_id_categories_id_fk\" FOREIGN KEY (\"transfer_id\") REFERENCES \"actual\".\"categories\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"category_mapping_transfer_id_index\" ON \"actual\".\"category_mapping\" USING btree (\"transfer_id\");"],"bps":true,"folderMillis":1746804128843,"hash":"864ff715c9a383e06b9b146ce812be710e8f001fadc0e9d0c8766ad1e4253e4f"},{"sql":["CREATE TABLE \"actual\".\"kvcache\" (\n\t\"key\" text PRIMARY KEY NOT NULL,\n\t\"value\" text\n);\n"],"bps":true,"folderMillis":1746804137174,"hash":"b35f88e01ff9eace48d85c74d6fe2317cc4c7acd79d93f85724863b1a71e75cf"},{"sql":["CREATE TABLE \"actual\".\"kvcache_key\" (\n\t\"id\" smallint PRIMARY KEY NOT NULL,\n\t\"key\" double precision\n);\n"],"bps":true,"folderMillis":1746804144286,"hash":"b992eaa2405849e9d2ace9cebb86bb67128e4037023501f0da0c98e977f1dce6"},{"sql":["CREATE TABLE \"actual\".\"messages_clock\" (\n\t\"id\" integer PRIMARY KEY NOT NULL,\n\t\"clock\" jsonb\n);\n","\nCREATE INDEX \"messages_clock_clock_index\" ON \"actual\".\"messages_clock\" USING gin (\"clock\");"],"bps":true,"folderMillis":1746804157965,"hash":"80e76670387717d962bb3e4ad1632965a7730830e719473ba0c3dabae561f5c3"},{"sql":["CREATE TABLE \"actual\".\"messages_crdt\" (\n\t\"id\" serial PRIMARY KEY NOT NULL,\n\t\"timestamp\" text,\n\t\"dataset\" text,\n\t\"row\" varchar(36),\n\t\"column\" text,\n\t\"value\" \"bytea\"\n);\n","\nCREATE INDEX \"messages_crdt_timestamp_index\" ON \"actual\".\"messages_crdt\" USING btree (\"timestamp\");","\nCREATE INDEX \"messages_crdt_dataset_row_column_timestamp_index\" ON \"actual\".\"messages_crdt\" USING btree (\"dataset\",\"row\",\"column\",\"timestamp\");"],"bps":true,"folderMillis":1746804168475,"hash":"4dd5c708e702aa1647ee03cddec69d0a408d67462aac65cc20218aeb713dcc13"},{"sql":["CREATE TABLE \"actual\".\"notes\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"note\" text\n);\n","\nCREATE INDEX \"notes_note_index\" ON \"actual\".\"notes\" USING gin (\"note\" gin_trgm_ops);"],"bps":true,"folderMillis":1746804176918,"hash":"b3877d6c85c11d1997defde483568587e4b70d66b1d3e9c62a607a55abf6afc0"},{"sql":["CREATE TABLE \"actual\".\"payees\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"transfer_acct\" varchar(36),\n\t\"favorite\" boolean DEFAULT false,\n\t\"learn_categories\" boolean DEFAULT true,\n\t\"tombstone\" boolean DEFAULT false,\n\t\"category\" text\n);\n","\nALTER TABLE \"actual\".\"payees\" ADD CONSTRAINT \"payees_transfer_acct_accounts_id_fk\" FOREIGN KEY (\"transfer_acct\") REFERENCES \"actual\".\"accounts\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"payees_name_index\" ON \"actual\".\"payees\" USING btree (\"name\") WHERE \"actual\".\"payees\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"payees_transfer_acct_name_index\" ON \"actual\".\"payees\" USING btree (\"transfer_acct\" DESC NULLS FIRST,LOWER(\"name\")) WHERE \"actual\".\"payees\".\"tombstone\" IS FALSE;"],"bps":true,"folderMillis":1746804184977,"hash":"fe085c2faf3f7abed3566a8b3766b3028f5c5b12ec7488dbd35d1986c30c8c7b"},{"sql":["CREATE TABLE \"actual\".\"payee_mapping\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"target_id\" varchar(36)\n);\n","\nALTER TABLE \"actual\".\"payee_mapping\" ADD CONSTRAINT \"payee_mapping_id_payees_id_fk\" FOREIGN KEY (\"id\") REFERENCES \"actual\".\"payees\"(\"id\") ON DELETE no action ON UPDATE no action;","\nALTER TABLE \"actual\".\"payee_mapping\" ADD CONSTRAINT \"payee_mapping_target_id_payees_id_fk\" FOREIGN KEY (\"target_id\") REFERENCES \"actual\".\"payees\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"payee_mapping_target_id_index\" ON \"actual\".\"payee_mapping\" USING btree (\"target_id\");"],"bps":true,"folderMillis":1746804197035,"hash":"4e1f33dc4116bc933af109a1cb161a84d727e6f3d01f7f604da3251ab390db9d"},{"sql":["CREATE TABLE \"actual\".\"rules\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"stage\" text,\n\t\"conditions\" jsonb,\n\t\"actions\" jsonb,\n\t\"tombstone\" boolean DEFAULT false,\n\t\"conditions_op\" text\n);\n","\nCREATE INDEX \"rules_stage_index\" ON \"actual\".\"rules\" USING btree (\"stage\") WHERE \"actual\".\"rules\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"rules_conditions_index\" ON \"actual\".\"rules\" USING gin (\"conditions\");","\nCREATE INDEX \"rules_actions_index\" ON \"actual\".\"rules\" USING gin (\"actions\");"],"bps":true,"folderMillis":1746804206655,"hash":"d659ac7d72035e1db116b288bb3a84a209d87c73be4bd75f4163846245775993"},{"sql":["CREATE TABLE \"actual\".\"schedules\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"rule\" varchar(36),\n\t\"active\" boolean DEFAULT false,\n\t\"completed\" boolean DEFAULT false,\n\t\"posts_transaction\" boolean DEFAULT false,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nALTER TABLE \"actual\".\"schedules\" ADD CONSTRAINT \"schedules_rule_rules_id_fk\" FOREIGN KEY (\"rule\") REFERENCES \"actual\".\"rules\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"schedules_name_index\" ON \"actual\".\"schedules\" USING btree (\"name\") WHERE \"actual\".\"schedules\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"schedules_rule_index\" ON \"actual\".\"schedules\" USING btree (\"rule\") WHERE \"actual\".\"schedules\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"schedules_completed_index\" ON \"actual\".\"schedules\" USING btree (\"completed\") WHERE \"actual\".\"schedules\".\"tombstone\" IS FALSE;"],"bps":true,"folderMillis":1746804214941,"hash":"6979c233964bccd1d586e5ef57874cd53caf6bd237c429e213f70bb4c4eea411"},{"sql":["CREATE TABLE \"actual\".\"schedules_json_paths\" (\n\t\"schedule_id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"payee\" text,\n\t\"account\" text,\n\t\"amount\" text,\n\t\"date\" text\n);\n","\nALTER TABLE \"actual\".\"schedules_json_paths\" ADD CONSTRAINT \"schedules_json_paths_schedule_id_schedules_id_fk\" FOREIGN KEY (\"schedule_id\") REFERENCES \"actual\".\"schedules\"(\"id\") ON DELETE no action ON UPDATE no action;"],"bps":true,"folderMillis":1746804226176,"hash":"80423a2d795b7aaf926c7505ce45a406af2a9ab711e3e09abc5231be2e9a6cfd"},{"sql":["CREATE TABLE \"actual\".\"schedules_next_date\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"schedule_id\" varchar(36),\n\t\"local_next_date\" date,\n\t\"local_next_date_ts\" bigint,\n\t\"base_next_date\" date,\n\t\"base_next_date_ts\" bigint,\n\t\"tombstone\" boolean DEFAULT false,\n\tCONSTRAINT \"schedules_next_date_scheduleId_unique\" UNIQUE(\"schedule_id\")\n);\n","\nALTER TABLE \"actual\".\"schedules_next_date\" ADD CONSTRAINT \"schedules_next_date_schedule_id_schedules_id_fk\" FOREIGN KEY (\"schedule_id\") REFERENCES \"actual\".\"schedules\"(\"id\") ON DELETE no action ON UPDATE no action;"],"bps":true,"folderMillis":1746804234405,"hash":"c5239af56e8c4c12e9fd183c0986b0d83aec846ec027a3922897120e83000482"},{"sql":["CREATE TABLE \"actual\".\"transactions\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"is_parent\" boolean DEFAULT false,\n\t\"is_child\" boolean DEFAULT false,\n\t\"acct\" varchar(36),\n\t\"category\" varchar(36),\n\t\"amount\" bigint,\n\t\"description\" varchar(36),\n\t\"notes\" text,\n\t\"date\" date,\n\t\"parent_id\" varchar(36),\n\t\"financial_id\" text,\n\t\"error\" jsonb,\n\t\"imported_description\" text,\n\t\"transferred_id\" varchar(36),\n\t\"schedule\" varchar(36),\n\t\"sort_order\" bigint,\n\t\"starting_balance_flag\" boolean DEFAULT false,\n\t\"tombstone\" boolean DEFAULT false,\n\t\"cleared\" boolean DEFAULT true,\n\t\"reconciled\" boolean DEFAULT false,\n\t\"raw_synced_data\" jsonb,\n\t\"pending\" boolean,\n\t\"location\" text,\n\t\"type\" text\n);\n","\nALTER TABLE \"actual\".\"transactions\" ADD CONSTRAINT \"transactions_acct_accounts_id_fk\" FOREIGN KEY (\"acct\") REFERENCES \"actual\".\"accounts\"(\"id\") ON DELETE no action ON UPDATE no action;","\nALTER TABLE \"actual\".\"transactions\" ADD CONSTRAINT \"transactions_category_categories_id_fk\" FOREIGN KEY (\"category\") REFERENCES \"actual\".\"categories\"(\"id\") ON DELETE no action ON UPDATE no action;","\nALTER TABLE \"actual\".\"transactions\" ADD CONSTRAINT \"transactions_parent_id_transactions_id_fk\" FOREIGN KEY (\"parent_id\") REFERENCES \"actual\".\"transactions\"(\"id\") ON DELETE no action ON UPDATE no action;","\nALTER TABLE \"actual\".\"transactions\" ADD CONSTRAINT \"transactions_transferred_id_transactions_id_fk\" FOREIGN KEY (\"transferred_id\") REFERENCES \"actual\".\"transactions\"(\"id\") ON DELETE no action ON UPDATE no action;","\nALTER TABLE \"actual\".\"transactions\" ADD CONSTRAINT \"transactions_schedule_schedules_id_fk\" FOREIGN KEY (\"schedule\") REFERENCES \"actual\".\"schedules\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"transactions_category_date_index\" ON \"actual\".\"transactions\" USING btree (\"category\",\"date\") WHERE \"actual\".\"transactions\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"transactions_acct_index\" ON \"actual\".\"transactions\" USING btree (\"acct\") WHERE \"actual\".\"transactions\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"transactions_parent_id_index\" ON \"actual\".\"transactions\" USING btree (\"parent_id\") WHERE \"actual\".\"transactions\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"transactions_date_starting_balance_flag_sort_order_id_index\" ON \"actual\".\"transactions\" USING btree (\"date\" DESC NULLS LAST,\"starting_balance_flag\",\"sort_order\" DESC NULLS LAST,\"id\");"],"bps":true,"folderMillis":1746804250495,"hash":"be9f7f65bdfdcc7e067ca8ca9b4c8455446505ee222f82fe4c1d66a075ddc67a"},{"sql":["CREATE TABLE \"actual\".\"reflect_budgets\" (\n\t\"id\" text PRIMARY KEY NOT NULL,\n\t\"month\" date,\n\t\"category\" varchar(36),\n\t\"amount\" bigint,\n\t\"carryover\" boolean DEFAULT false,\n\t\"goal\" bigint,\n\t\"long_goal\" bigint\n);\n","\nALTER TABLE \"actual\".\"reflect_budgets\" ADD CONSTRAINT \"reflect_budgets_category_categories_id_fk\" FOREIGN KEY (\"category\") REFERENCES \"actual\".\"categories\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"reflect_budgets_month_category_index\" ON \"actual\".\"reflect_budgets\" USING btree (\"month\",\"category\");"],"bps":true,"folderMillis":1746804262438,"hash":"cc057e7d7780b164f9bef8f8a4ce3435eb43efdb3a18f9ef62b10e3ad5499dc7"},{"sql":["CREATE TABLE \"actual\".\"zero_budgets\" (\n\t\"id\" text PRIMARY KEY NOT NULL,\n\t\"month\" date,\n\t\"category\" varchar(36),\n\t\"amount\" bigint,\n\t\"carryover\" boolean DEFAULT false,\n\t\"goal\" bigint,\n\t\"long_goal\" bigint\n);\n","\nALTER TABLE \"actual\".\"zero_budgets\" ADD CONSTRAINT \"zero_budgets_category_categories_id_fk\" FOREIGN KEY (\"category\") REFERENCES \"actual\".\"categories\"(\"id\") ON DELETE no action ON UPDATE no action;","\nCREATE INDEX \"zero_budgets_month_category_index\" ON \"actual\".\"zero_budgets\" USING btree (\"month\",\"category\");"],"bps":true,"folderMillis":1746804272345,"hash":"daa198c6d44d38dfc312e47b74402b3b42aef4e25bb5c10b4eff5313fc8060c3"},{"sql":["CREATE TABLE \"actual\".\"zero_budget_months\" (\n\t\"id\" text PRIMARY KEY NOT NULL,\n\t\"buffered\" bigint\n);\n"],"bps":true,"folderMillis":1746804370208,"hash":"b305b487551d8506783f876c788ce989e33c663a26d8472336ea08e53a79d6b2"},{"sql":["CREATE TABLE \"actual\".\"transaction_filters\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"conditions\" jsonb,\n\t\"conditions_op\" text,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nCREATE INDEX \"transaction_filters_name_index\" ON \"actual\".\"transaction_filters\" USING btree (\"name\") WHERE \"actual\".\"transaction_filters\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"transaction_filters_conditions_index\" ON \"actual\".\"transaction_filters\" USING gin (\"conditions\") WHERE \"actual\".\"transaction_filters\".\"tombstone\" IS FALSE;"],"bps":true,"folderMillis":1746804378691,"hash":"f5575995315ed25744354b6928df2af848808125569afcbd497f5c1667b30d4b"},{"sql":["CREATE TABLE \"actual\".\"preferences\" (\n\t\"id\" text PRIMARY KEY NOT NULL,\n\t\"value\" text\n);\n"],"bps":true,"folderMillis":1746804388851,"hash":"1dc874ec4606ff1c385476cfd3ae26e501024ff6ee8e3ac68bea2446ff6b2684"},{"sql":["CREATE TABLE \"actual\".\"custom_reports\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"name\" text,\n\t\"start_date\" date,\n\t\"end_date\" date,\n\t\"date_static\" bigint,\n\t\"date_range\" text,\n\t\"mode\" text,\n\t\"group_by\" text,\n\t\"balance_type\" text,\n\t\"show_empty\" boolean DEFAULT false,\n\t\"show_offbudget\" boolean DEFAULT false,\n\t\"show_hidden\" boolean DEFAULT false,\n\t\"show_uncategorized\" boolean DEFAULT false,\n\t\"selected_categories\" text,\n\t\"graph_type\" text,\n\t\"conditions\" jsonb,\n\t\"conditions_op\" text,\n\t\"metadata\" jsonb,\n\t\"interval\" text,\n\t\"color_scheme\" text,\n\t\"include_current\" boolean DEFAULT false,\n\t\"sort_by\" text,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nCREATE INDEX \"custom_reports_name_index\" ON \"actual\".\"custom_reports\" USING btree (\"name\") WHERE \"actual\".\"custom_reports\".\"tombstone\" IS FALSE;","\nCREATE INDEX \"custom_reports_conditions_index\" ON \"actual\".\"custom_reports\" USING gin (\"conditions\") WHERE \"actual\".\"custom_reports\".\"tombstone\" IS FALSE;"],"bps":true,"folderMillis":1746804397783,"hash":"0daeef83cefb55a5c54f1b948daf0384142eee4e037a1d272d492356563cf63e"},{"sql":["CREATE TABLE \"actual\".\"dashboard\" (\n\t\"id\" varchar(36) PRIMARY KEY NOT NULL,\n\t\"type\" text,\n\t\"width\" integer,\n\t\"height\" integer,\n\t\"x\" integer,\n\t\"y\" integer,\n\t\"meta\" jsonb,\n\t\"tombstone\" boolean DEFAULT false\n);\n","\nCREATE INDEX \"dashboard_y_x_index\" ON \"actual\".\"dashboard\" USING btree (\"y\" DESC NULLS LAST,\"x\" DESC NULLS LAST) WHERE \"actual\".\"dashboard\".\"tombstone\" IS FALSE;"],"bps":true,"folderMillis":1746804406335,"hash":"0b968a6536ab4a5bfaae78464bb0d7f2153c822911a403e7087261a2503c3d09"},{"sql":["CREATE VIEW \"actual\".\"v_transactions_internal\" AS (\n SELECT\n \"actual\".\"transactions\".\"id\",\n \"actual\".\"transactions\".\"is_parent\",\n \"actual\".\"transactions\".\"is_child\",\n CASE WHEN \"actual\".\"transactions\".\"is_child\" IS FALSE THEN NULL ELSE \"actual\".\"transactions\".\"parent_id\" END AS parent_id,\n \"actual\".\"transactions\".\"acct\" AS account,\n CASE WHEN \"actual\".\"transactions\".\"is_parent\" IS TRUE THEN NULL ELSE \"actual\".\"category_mapping\".\"transfer_id\" END AS category,\n COALESCE(\"actual\".\"transactions\".\"amount\", 0) AS amount,\n \"actual\".\"payee_mapping\".\"target_id\" AS payee,\n \"actual\".\"transactions\".\"notes\",\n \"actual\".\"transactions\".\"date\",\n \"actual\".\"transactions\".\"financial_id\" AS imported_id,\n \"actual\".\"transactions\".\"error\",\n \"actual\".\"transactions\".\"imported_description\" AS imported_payee,\n \"actual\".\"transactions\".\"starting_balance_flag\",\n \"actual\".\"transactions\".\"transferred_id\" AS transfer_id,\n \"actual\".\"transactions\".\"schedule\",\n \"actual\".\"transactions\".\"cleared\",\n \"actual\".\"transactions\".\"reconciled\",\n \"actual\".\"transactions\".\"tombstone\",\n \"actual\".\"transactions\".\"sort_order\"\n FROM\n \"actual\".\"transactions\"\n LEFT JOIN\n \"actual\".\"category_mapping\"\n ON \"actual\".\"transactions\".\"category\" = \"actual\".\"category_mapping\".\"id\"\n LEFT JOIN\n \"actual\".\"payee_mapping\"\n ON \"actual\".\"transactions\".\"description\" = \"actual\".\"payee_mapping\".\"id\"\n WHERE\n \"actual\".\"transactions\".\"date\" IS NOT NULL\n AND \"actual\".\"transactions\".\"acct\" IS NOT NULL\n AND (\"actual\".\"transactions\".\"is_child\" IS FALSE OR \"actual\".\"transactions\".\"parent_id\" IS NOT NULL)\n );"],"bps":true,"folderMillis":1746804423286,"hash":"03a8f79420845e7514ecdb5852aa1a7413219b5c83116d943d5e6f048e8952a5"},{"sql":["CREATE VIEW \"actual\".\"v_transactions_internal_alive\" AS (\n SELECT\n \"actual\".\"v_transactions_internal\".*\n FROM\n \"actual\".\"v_transactions_internal\"\n LEFT JOIN\n \"actual\".\"transactions\"\n ON (\"actual\".\"transactions\".\"is_child\" IS TRUE\n AND \"actual\".\"transactions\".\"id\" = \"v_transactions_internal\".\"parent_id\")\n WHERE\n COALESCE(\"actual\".\"transactions\".\"tombstone\", FALSE) IS FALSE\n AND (\"v_transactions_internal\".\"is_child\" IS FALSE OR \"actual\".\"transactions\".\"tombstone\" IS FALSE)\n );"],"bps":true,"folderMillis":1746804433194,"hash":"8d15ce6251b29172e6f292dbc6f974e3c675149184adb9d7da47fd13bb4ff17e"},{"sql":["CREATE VIEW \"actual\".\"v_transactions\" AS (\n SELECT\n \"v_transactions_internal_alive\".\"id\",\n \"v_transactions_internal_alive\".\"is_parent\",\n \"v_transactions_internal_alive\".\"is_child\",\n \"v_transactions_internal_alive\".\"parent_id\",\n \"actual\".\"accounts\".\"id\" AS account,\n \"actual\".\"categories\".\"id\" AS category,\n \"v_transactions_internal_alive\".\"amount\",\n \"actual\".\"payees\".\"id\" AS payee,\n \"v_transactions_internal_alive\".\"notes\",\n \"v_transactions_internal_alive\".\"date\",\n \"v_transactions_internal_alive\".\"imported_id\",\n \"v_transactions_internal_alive\".\"error\",\n \"v_transactions_internal_alive\".\"imported_payee\",\n \"v_transactions_internal_alive\".\"starting_balance_flag\",\n \"v_transactions_internal_alive\".\"transfer_id\",\n \"v_transactions_internal_alive\".\"sort_order\",\n \"v_transactions_internal_alive\".\"cleared\",\n \"v_transactions_internal_alive\".\"reconciled\",\n \"v_transactions_internal_alive\".\"tombstone\",\n \"v_transactions_internal_alive\".\"schedule\"\n FROM\n \"actual\".\"v_transactions_internal_alive\"\n LEFT JOIN\n \"actual\".\"payees\"\n ON (\"actual\".\"payees\".\"id\" = \"v_transactions_internal_alive\".\"payee\"\n AND \"actual\".\"payees\".\"tombstone\" IS FALSE)\n LEFT JOIN\n \"actual\".\"categories\"\n ON (\"actual\".\"categories\".\"id\" = \"v_transactions_internal_alive\".\"category\"\n AND \"actual\".\"categories\".\"tombstone\" IS FALSE)\n LEFT JOIN\n \"actual\".\"accounts\"\n ON (\"actual\".\"accounts\".\"id\" = \"v_transactions_internal_alive\".\"account\"\n AND \"actual\".\"accounts\".\"tombstone\" IS FALSE)\n ORDER BY\n \"v_transactions_internal_alive\".\"date\" DESC,\n \"v_transactions_internal_alive\".\"starting_balance_flag\",\n \"v_transactions_internal_alive\".\"sort_order\" DESC,\n \"v_transactions_internal_alive\".\"id\"\n );"],"bps":true,"folderMillis":1746804442376,"hash":"2e5416042a0fe7afc8e6548e16a3762b273577a258434e759132c5e851281a44"},{"sql":["CREATE VIEW \"actual\".\"v_categories\" AS (select \"id\", \"name\", \"is_income\", \"hidden\", \"cat_group\" as \"group\", \"sort_order\", \"tombstone\" from \"actual\".\"categories\");"],"bps":true,"folderMillis":1746804450701,"hash":"c04565d1762f1ce5ed54750080d3aed2ad2bacd24b341ea4d3879d9f46abd59b"},{"sql":["CREATE VIEW \"actual\".\"v_payees\" AS (select \"actual\".\"payees\".\"id\", COALESCE(\"actual\".\"accounts\".\"name\", \"actual\".\"payees\".\"name\") as \"name\", \"actual\".\"payees\".\"transfer_acct\", \"actual\".\"payees\".\"favorite\", \"actual\".\"payees\".\"learn_categories\", \"actual\".\"payees\".\"tombstone\" from \"actual\".\"payees\" left join \"actual\".\"accounts\" on (\"actual\".\"payees\".\"transfer_acct\" = \"actual\".\"accounts\".\"id\" and \"actual\".\"accounts\".\"tombstone\" IS FALSE) where (\"actual\".\"payees\".\"transfer_acct\" is null or \"actual\".\"accounts\".\"id\" is not null));"],"bps":true,"folderMillis":1746804461121,"hash":"9ce506b1d979062d9cabf47d110666cdf95c47239c3f23f780104016acc912a2"},{"sql":["CREATE VIEW \"actual\".\"v_schedules\" AS (\n WITH parsed_rule_conditions AS (\n SELECT\n \"actual\".\"rules\".\"id\" AS rule_id,\n jsonb_extract_path_text(condition, 'value') AS value,\n condition ->> 'field' AS field,\n condition ->> 'op' AS op\n FROM\n \"actual\".\"rules\"\n CROSS JOIN\n jsonb_array_elements(\"actual\".\"rules\".\"conditions\"::jsonb) AS condition\n )\n SELECT\n \"actual\".\"schedules\".\"id\",\n \"actual\".\"schedules\".\"name\",\n \"actual\".\"schedules\".\"rule\",\n CASE\n WHEN \"actual\".\"schedules_next_date\".\"local_next_date_ts\" = \"actual\".\"schedules_next_date\".\"base_next_date_ts\" THEN \"actual\".\"schedules_next_date\".\"local_next_date\"\n ELSE \"actual\".\"schedules_next_date\".\"base_next_date\"\n END AS next_date,\n \"actual\".\"schedules\".\"completed\",\n \"actual\".\"schedules\".\"posts_transaction\",\n \"actual\".\"schedules\".\"tombstone\",\n \"actual\".\"payee_mapping\".\"target_id\" AS _payee,\n account_condition.value AS _account,\n amount_condition.value AS _amount,\n amount_condition.op AS _amount_op,\n date_condition.value AS _date,\n \"actual\".\"rules\".\"conditions\" AS _conditions,\n \"actual\".\"rules\".\"actions\" AS _actions\n FROM\n \"actual\".\"schedules\"\n LEFT JOIN\n \"actual\".\"schedules_next_date\" ON \"actual\".\"schedules_next_date\".\"schedule_id\" = \"actual\".\"schedules\".\"id\"\n LEFT JOIN\n \"actual\".\"rules\" ON \"actual\".\"rules\".\"id\" = \"actual\".\"schedules\".\"rule\"\n LEFT JOIN\n parsed_rule_conditions payee_condition\n ON payee_condition.rule_id = \"actual\".\"rules\".\"id\"\n AND payee_condition.field = 'payee'\n LEFT JOIN\n \"actual\".\"payee_mapping\" ON \"actual\".\"payee_mapping\".\"id\" = payee_condition.value\n LEFT JOIN\n parsed_rule_conditions account_condition\n ON account_condition.rule_id = \"actual\".\"rules\".\"id\"\n AND account_condition.field = 'account'\n LEFT JOIN\n parsed_rule_conditions amount_condition\n ON amount_condition.rule_id = \"actual\".\"rules\".\"id\"\n AND amount_condition.field = 'amount'\n LEFT JOIN\n parsed_rule_conditions date_condition\n ON date_condition.rule_id = \"actual\".\"rules\".\"id\"\n AND date_condition.field = 'date'\n );"],"bps":true,"folderMillis":1746804470099,"hash":"6daedf651f9910cc2c5768a3f793fa7c6bd5098e413f43ffa025d6bc3a05ddb3"}] |