You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 577c221
Browse filesBrowse the repository at this point in the historyBrowse files
ALTERTABLE"accounts" ADD CONSTRAINT"accounts_parentAccountId_accounts_id_fk"FOREIGN KEY ("parentAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1030
+
ALTERTABLE"alerts_config" ADD CONSTRAINT"alerts_config_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1031
+
ALTERTABLE"alerts_log" ADD CONSTRAINT"alerts_log_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1032
+
ALTERTABLE"bill_payments" ADD CONSTRAINT"bill_payments_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1015
1033
ALTERTABLE"businesses" ADD CONSTRAINT"businesses_accountRefId_customer_accounts_id_fk"FOREIGN KEY ("accountRefId") REFERENCES"public"."customer_accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1034
+
ALTERTABLE"daily_mpesa_ledger" ADD CONSTRAINT"daily_mpesa_ledger_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1035
+
ALTERTABLE"expense_categories" ADD CONSTRAINT"expense_categories_defaultAccountId_accounts_id_fk"FOREIGN KEY ("defaultAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1036
+
ALTERTABLE"expenses" ADD CONSTRAINT"expenses_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1037
+
ALTERTABLE"items" ADD CONSTRAINT"items_incomeAccountId_accounts_id_fk"FOREIGN KEY ("incomeAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1038
+
ALTERTABLE"items" ADD CONSTRAINT"items_expenseAccountId_accounts_id_fk"FOREIGN KEY ("expenseAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1039
+
ALTERTABLE"items" ADD CONSTRAINT"items_assetAccountId_accounts_id_fk"FOREIGN KEY ("assetAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1040
+
ALTERTABLE"journal_lines" ADD CONSTRAINT"journal_lines_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1041
+
ALTERTABLE"ledger_entries" ADD CONSTRAINT"ledger_entries_accountId_accounts_id_fk"FOREIGN KEY ("accountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1042
+
ALTERTABLE"location_payment_methods" ADD CONSTRAINT"location_payment_methods_linkedAccountId_accounts_id_fk"FOREIGN KEY ("linkedAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1043
+
ALTERTABLE"locations" ADD CONSTRAINT"locations_defaultMpesaAccountId_accounts_id_fk"FOREIGN KEY ("defaultMpesaAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1044
+
ALTERTABLE"locations" ADD CONSTRAINT"locations_defaultCashAccountId_accounts_id_fk"FOREIGN KEY ("defaultCashAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1045
+
ALTERTABLE"mpesa_transactions" ADD CONSTRAINT"mpesa_transactions_sourceAccountId_accounts_id_fk"FOREIGN KEY ("sourceAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1046
+
ALTERTABLE"mpesa_transactions" ADD CONSTRAINT"mpesa_transactions_destinationAccountId_accounts_id_fk"FOREIGN KEY ("destinationAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1016
1047
ALTERTABLE"payment_methods" ADD CONSTRAINT"payment_methods_accountRefId_customer_accounts_id_fk"FOREIGN KEY ("accountRefId") REFERENCES"public"."customer_accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1048
+
ALTERTABLE"recurring_bill_templates" ADD CONSTRAINT"recurring_bill_templates_liabilityAccountId_accounts_id_fk"FOREIGN KEY ("liabilityAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1049
+
ALTERTABLE"revenue_categories" ADD CONSTRAINT"revenue_categories_incomeAccountId_accounts_id_fk"FOREIGN KEY ("incomeAccountId") REFERENCES"public"."accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1017
1050
ALTERTABLE"users" ADD CONSTRAINT"users_accountRefId_customer_accounts_id_fk"FOREIGN KEY ("accountRefId") REFERENCES"public"."customer_accounts"("id") ON DELETE no action ONUPDATE no action;--> statement-breakpoint
1018
1051
CREATEINDEX "idx_accounts_type" ON"accounts" USING btree ("accountType");--> statement-breakpoint
1019
1052
CREATEINDEX "idx_accounts_business" ON"accounts" USING btree ("businessId");--> statement-breakpoint
@@ -1063,107 +1096,4 @@ CREATE INDEX "idx_users_id" ON "users" USING btree ("id");--> statement-breakpoi
1063
1096
CREATEINDEX "idx_users_deletedAt" ON"users" USING btree ("deletedAt");--> statement-breakpoint
1064
1097
CREATEINDEX "idx_users_isActive" ON"users" USING btree ("isActive");--> statement-breakpoint
1065
1098
CREATEINDEX "idx_users_currentBusinessId" ON"users" USING btree ("currentBusinessId");--> statement-breakpoint
1066
-
CREATEUNIQUE INDEX "idx_users_username_accountId" ON"users" USING btree ("username","accountId");
0 commit comments