سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 20:45 UTC
Harden enterprise invitation foreign-key indexes
davoodmehraban89 committed
Sep 30, 2026 at 08:58 UTC
71d6cd7196ef308c67f927644503f563bf4693ea
2 files changed
+9
scripts/enterprise-invitation-check.mjs
+2
@@ -15,6 +15,8 @@ need(m,/organization_has_module_entitlement\(v_inv\.organization_id,'core',true\
15
need(m,/organization_members[\s\S]*status='active'/i,'seat-consuming membership activation');
16
need(m,/organization_member_roles/i,'invited role assignment');
17
need(m,/to_jsonb\(new\)-'token_hash'/i,'audit omits token hash');
18
+const h=fs.readFileSync('supabase/migrations/20260930054500_eli3_fk_index_hardening.sql','utf8');
19
+for(const name of ['organization_invitation_roles_role_idx','organization_invitations_accepted_by_idx','organization_invitations_invited_by_idx','organization_invitations_unit_idx','organization_member_roles_assigned_by_idx','organization_roles_created_by_idx'])need(h,new RegExp(name,'i'),'FK index '+name);
20
const ui=fs.readFileSync('js/organization-invitations.js','utf8');
21
need(ui,/organizationCreateInvitationFromUi/i,'invitation creation UI');
22
need(ui,/organizationRevokeInvitationFromUi/i,'invitation revoke UI');
supabase/migrations/20260930054500_eli3_fk_index_hardening.sql
new
+7
@@ -0,0 +1,7 @@
1
+-- ELI-3/ELI-2 FK index hardening from production performance advisor.
2
+create index if not exists organization_invitation_roles_role_idx on public.organization_invitation_roles(role_id);
3
+create index if not exists organization_invitations_accepted_by_idx on public.organization_invitations(accepted_by);
4
+create index if not exists organization_invitations_invited_by_idx on public.organization_invitations(invited_by);
5
+create index if not exists organization_invitations_unit_idx on public.organization_invitations(unit_id);
6
+create index if not exists organization_member_roles_assigned_by_idx on public.organization_member_roles(assigned_by);
7
+create index if not exists organization_roles_created_by_idx on public.organization_roles(created_by);