-
Notifications
You must be signed in to change notification settings - Fork 121
feat: add foreign key supporting indexes for customer and document tables #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1e96be1
feat: add foreign key supporting indexes for customer and document ta…
softmarshmallow 053c90e
setup supabase db test ci
softmarshmallow 367f1ae
feat: add signing key generation step to database tests workflow
softmarshmallow 2462323
fix: update signing key generation in database tests workflow
softmarshmallow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # see https://supabase.com/docs/guides/deployment/ci/testing for details | ||
| name: "database-tests" | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - ".github/workflows/database-tests.yml" | ||
| - "database/**" | ||
| - "supabase/**" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: supabase/setup-cli@v1 | ||
| with: | ||
| version: latest | ||
| - run: printf '[]' > supabase/signing_keys.json && supabase gen signing-key --append --yes | ||
| - run: supabase db start | ||
| - run: supabase test db | ||
35 changes: 35 additions & 0 deletions
35
supabase/migrations/20260201152403_add_customer_document_fk_indexes.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| -- Add FK-supporting indexes for cascade deletes. | ||
| -- These speed up deletes of public.customer/public.document (and in turn public.project). | ||
|
|
||
| -- customer(uid) children | ||
| create index if not exists customer_otp_challenge_customer_uid_idx | ||
| on grida_ciam.customer_otp_challenge (customer_uid); | ||
|
|
||
| create index if not exists customer_portal_session_customer_uid_idx | ||
| on grida_ciam.customer_portal_session (customer_uid); | ||
|
|
||
| create index if not exists grida_forms_response_customer_id_idx | ||
| on grida_forms.response (customer_id); | ||
|
|
||
| create index if not exists response_session_customer_id_idx | ||
| on grida_forms.response_session (customer_id); | ||
|
|
||
| create index if not exists invitation_customer_id_idx | ||
| on grida_west_referral.invitation (customer_id); | ||
|
|
||
| create index if not exists referrer_customer_id_idx | ||
| on grida_west_referral.referrer (customer_id); | ||
|
|
||
| create index if not exists referrer_customer_id_project_id_idx | ||
| on grida_west_referral.referrer (customer_id, project_id); | ||
|
|
||
| -- document(id) children | ||
| create index if not exists asset_document_id_idx | ||
| on public.asset (document_id); | ||
|
|
||
| create index if not exists user_project_access_state_document_id_idx | ||
| on public.user_project_access_state (document_id); | ||
|
|
||
| -- layout(document_id, document_type) composite FK | ||
| create index if not exists layout_document_id_document_type_idx | ||
| on grida_www.layout (document_id, document_type); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Supabase CLI latest stable version 2024 2025💡 Result:
Sources:
[1] https://github.com/supabase/cli/tags?after=v2.71.1
[2] supabase/cli#2971
[3] https://supabase.com/changelog
🏁 Script executed:
Repository: gridaco/grida
Length of output: 778
Pin the Supabase CLI version for reproducible builds.
Using
version: latestcan cause unexpected CI failures when new CLI versions introduce breaking changes or bugs. Pin to a specific stable version (currently v2.70.5 or later) instead of the latest.♻️ Proposed fix
- uses: supabase/setup-cli@v1 with: - version: latest + version: 2.70.5📝 Committable suggestion
🤖 Prompt for AI Agents