|
Build and Push Docker Images / build (api) (push) Successful in 2m26s
Details
Build and Push Docker Images / build (musicseerr) (push) Successful in 7m21s
Details
Build and Push Docker Images / build (web) (push) Successful in 1m32s
Details
Build and Push Docker Images / build (nextgen) (push) Successful in 7m51s
Details
Build and Push Docker Images / build (worker) (push) Successful in 10m9s
Details
Build and Push Docker Images / deploy (push) Successful in 23s
Details
|
||
|---|---|---|
| .. | ||
| .gitea/workflows | ||
| .harness | ||
| .uat-output | ||
| client | ||
| demo | ||
| docs | ||
| evidence | ||
| logo | ||
| scripts | ||
| server | ||
| sql | ||
| superadmin | ||
| tests | ||
| tools | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .tmp_uat_egov.js | ||
| AGENTS.md | ||
| DATABASE_SCHEMA.md | ||
| DOCKER_README.md | ||
| DYNAMIC_FONT_SIZING_LAYOUT.md | ||
| Dockerfile | ||
| FETCH_HEAD | ||
| GEMINI.md | ||
| IMPLEMENTATION_SUMMARY.md | ||
| ISSUES.md | ||
| NextGen_Learning_UAT_Workbook - UAT Test Cases.csv | ||
| PORTS.md | ||
| README.md | ||
| SCREENS.md | ||
| SUPERADMIN_MULTITENANT_DOCUMENTATION.md | ||
| datacontrol.md | ||
| deliverable.md | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| dynamic_font_sizing_test.md | ||
| egovernancecertificate.md | ||
| modals.md | ||
| new_table.txt | ||
| package-lock.json | ||
| package.json | ||
| pr-resp.json | ||
| qa-testing-uat-plan.md | ||
| supabase_audit_report.md | ||
| supabase_migration_v2.sql | ||
| tea.exe | ||
README.md
Supabase migration v2
Prerequisites
- A backup of the live Supabase database.
- SQL Editor access as a role allowed to create extensions, tables, policies, and storage policies.
- Supabase schemas/roles (
auth,storage,authenticated,anon,service_role) must exist for the RLS/storage sections. - Review
supabase_audit_report.md, especially the commented drop candidates.
Strategy
- CREATE: preserve the cloud UUID
tenantsroot and create only Knex-defined tables missing from cloud withCREATE TABLE IF NOT EXISTS. - ALTER: add follow-up migration columns and inject
tenant_id UUID REFERENCES tenants(id) ON DELETE CASCADEonly where absent. - RLS: index every domain
tenant_id, enable RLS, and recreate tenant-isolation plus service-role policies idempotently.
Apply
Run supabase_migration_v2.sql once in the Supabase SQL Editor. It is designed for one execution and safe re-execution. The DROP section is entirely commented; do not uncomment it without a backup and code-usage review.
SHOULD-DROP review
assignment_submissions: overlapssubmissions; no inbound dump FK, outbound toassignments/users; verify code usage.attendance_new: canonical table isattendance; no inbound dump FK, outbound tousers/subjects_new.calendar_events: canonical table isevents; no inbound dump FK, outbound tousers; verify calendar code.edutainment_content: no inbound dump FK, outbound tosubjects_new/users; verify feature retirement.edutainment_sessions: outbound toedutainment_games/users; drop before or with games.edutainment_games: inbound fromedutainment_sessions; requires sessions-first orCASCADE; outbound tosubjects_new/users.messages_new: canonical table ismessages; no inbound dump FK, outbound tousers; verify messaging code.
subjects_new must not be dropped: Knex explicitly creates it and multiple dump FKs target it.
Rollback
There is no automatic destructive rollback. Restore the pre-migration backup for a full rollback. For a targeted rollback, drop only newly created tables in reverse dependency order and remove policies/indexes/tenant_id columns only after confirming no tenant data depends on them. The seed can be removed with:
DELETE FROM tenants WHERE id = '5b39bcb5-506a-456d-b7cb-91730b397cc1';
Verification
SELECT tablename, rowsecurity
FROM pg_tables
WHERE schemaname = 'public'
ORDER BY tablename;
Also verify tenant columns and indexes:
SELECT table_name
FROM information_schema.columns
WHERE table_schema = 'public' AND column_name = 'tenant_id'
ORDER BY table_name;
Tenant UUID alignment
The Knex migration and cloud schema both use UUID tenant IDs. The default test tenant is 5b39bcb5-506a-456d-b7cb-91730b397cc1, and the SuperAdmin controller generates UUIDv4 IDs for new tenants.