ui-syncup 0.3.13 → 0.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/ai-spec-workflow/SKILL.md +58 -0
- package/.agents/skills/ai-spec-workflow/references/AI_SPECIFICATION_WORKFLOW.md +1434 -0
- package/.agents/skills/ai-spec-workflow/references/templates/design-template.md +729 -0
- package/.agents/skills/ai-spec-workflow/references/templates/requirements-template.md +179 -0
- package/.agents/skills/ai-spec-workflow/references/templates/tasks-template.md +501 -0
- package/.agents/skills/animation-designer/SKILL.md +688 -0
- package/.agents/skills/animation-designer/manifest.yaml +44 -0
- package/.agents/skills/brainstorming/SKILL.md +54 -0
- package/.agents/skills/contract-driven-ui/SKILL.md +270 -0
- package/.agents/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/.agents/skills/executing-plans/SKILL.md +76 -0
- package/.agents/skills/executing-specs/SKILL.md +53 -0
- package/.agents/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/.agents/skills/github-workflow-automation/SKILL.md +846 -0
- package/.agents/skills/react-best-practices/AGENTS.md +2249 -0
- package/.agents/skills/react-best-practices/README.md +123 -0
- package/.agents/skills/react-best-practices/SKILL.md +121 -0
- package/.agents/skills/react-best-practices/metadata.json +15 -0
- package/.agents/skills/react-best-practices/rules/_sections.md +46 -0
- package/.agents/skills/react-best-practices/rules/_template.md +28 -0
- package/.agents/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/.agents/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/.agents/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/.agents/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/.agents/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/.agents/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/.agents/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/.agents/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/.agents/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/.agents/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/.agents/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/.agents/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/.agents/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/.agents/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/.agents/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/.agents/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/.agents/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/.agents/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/.agents/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/.agents/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/.agents/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/.agents/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/.agents/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/.agents/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/.agents/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/.agents/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/.agents/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/.agents/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/.agents/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/.agents/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/.agents/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/.agents/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/.agents/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/.agents/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/.agents/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/.agents/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/.agents/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/.agents/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/.agents/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/.agents/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/.agents/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/.agents/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/.agents/skills/react-best-practices/rules/server-cache-react.md +26 -0
- package/.agents/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
- package/.agents/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/.agents/skills/react-ui-patterns/SKILL.md +289 -0
- package/.agents/skills/receiving-code-review/SKILL.md +213 -0
- package/.agents/skills/requesting-code-review/SKILL.md +105 -0
- package/.agents/skills/requesting-code-review/code-reviewer.md +146 -0
- package/.agents/skills/reviewing-code/SKILL.md +28 -0
- package/.agents/skills/shadcn/SKILL.md +240 -0
- package/.agents/skills/shadcn/agents/openai.yml +5 -0
- package/.agents/skills/shadcn/assets/shadcn-small.png +0 -0
- package/.agents/skills/shadcn/assets/shadcn.png +0 -0
- package/.agents/skills/shadcn/cli.md +255 -0
- package/.agents/skills/shadcn/customization.md +202 -0
- package/.agents/skills/shadcn/evals/evals.json +47 -0
- package/.agents/skills/shadcn/mcp.md +94 -0
- package/.agents/skills/shadcn/rules/base-vs-radix.md +306 -0
- package/.agents/skills/shadcn/rules/composition.md +195 -0
- package/.agents/skills/shadcn/rules/forms.md +192 -0
- package/.agents/skills/shadcn/rules/icons.md +101 -0
- package/.agents/skills/shadcn/rules/styling.md +162 -0
- package/.agents/skills/steering-creation/SKILL.md +221 -0
- package/.agents/skills/steering-creation/references/STEERING_CREATION_INSTRUCTION.md +850 -0
- package/.agents/skills/subagent-driven-development/SKILL.md +240 -0
- package/.agents/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/.agents/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/.agents/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/.agents/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/.agents/skills/systematic-debugging/SKILL.md +296 -0
- package/.agents/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/.agents/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/.agents/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/.agents/skills/systematic-debugging/find-polluter.sh +63 -0
- package/.agents/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/.agents/skills/systematic-debugging/test-academic.md +14 -0
- package/.agents/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/.agents/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/.agents/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/.agents/skills/test-driven-development/SKILL.md +371 -0
- package/.agents/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/.agents/skills/using-git-worktrees/SKILL.md +217 -0
- package/.agents/skills/using-superpowers/SKILL.md +87 -0
- package/.agents/skills/verification-before-completion/SKILL.md +139 -0
- package/.agents/skills/web-design-guidelines/SKILL.md +36 -0
- package/.agents/skills/writing-plans/SKILL.md +116 -0
- package/.agents/skills/writing-skills/SKILL.md +655 -0
- package/.agents/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/.agents/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/.agents/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/.agents/skills/writing-skills/persuasion-principles.md +187 -0
- package/.agents/skills/writing-skills/render-graphs.js +168 -0
- package/.agents/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/.ai/steering/product.md +51 -0
- package/.ai/steering/structure.md +275 -0
- package/.ai/steering/tech.md +188 -0
- package/.claude/agents/database-architect.md +96 -0
- package/.claude/agents/deployment-pipeline-architect.md +122 -0
- package/.claude/agents/nextjs-expert.md +69 -0
- package/.claude/agents/ui-design-expert.md +106 -0
- package/.claudeignore +69 -0
- package/.dockerignore +8 -0
- package/.env.development +86 -0
- package/.env.example +171 -0
- package/.env.production +139 -0
- package/.env.test +58 -0
- package/.gitattributes +2 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +33 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +20 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- package/.github/workflows/ci.yml +64 -0
- package/.github/workflows/release.yml +131 -0
- package/.nvmrc +1 -0
- package/.releaserc.json +18 -0
- package/.vercelignore +73 -0
- package/AGENTS.md +544 -0
- package/CHANGELOG.md +37 -0
- package/CODE_OF_CONDUCT.md +21 -0
- package/CONTRIBUTING.md +32 -0
- package/Dockerfile +84 -0
- package/LICENSE +21 -0
- package/README.md +328 -59
- package/SECURITY.md +16 -0
- package/bun.lock +3853 -0
- package/cli/README.md +94 -0
- package/cli/bun.lock +306 -0
- package/cli/index.ts +96 -0
- package/cli/package-lock.json +2157 -0
- package/cli/package.json +30 -0
- package/cli/src/commands/backup.ts +78 -0
- package/cli/src/commands/doctor.ts +82 -0
- package/cli/src/commands/init.ts +234 -0
- package/cli/src/commands/logs.ts +26 -0
- package/cli/src/commands/open.ts +23 -0
- package/cli/src/commands/remove.ts +44 -0
- package/cli/src/commands/restart.ts +21 -0
- package/cli/src/commands/restore.ts +90 -0
- package/cli/src/commands/start.ts +26 -0
- package/cli/src/commands/status.ts +25 -0
- package/cli/src/commands/stop.ts +20 -0
- package/cli/src/commands/upgrade.ts +28 -0
- package/cli/src/lib/docker.ts +40 -0
- package/cli/src/lib/env.ts +42 -0
- package/cli/src/lib/ui.ts +43 -0
- package/cli/tsconfig.json +13 -0
- package/cli/tsup.config.ts +12 -0
- package/components.json +24 -0
- package/docker/README.md +430 -0
- package/docker/compose.dev-minio.yml +30 -0
- package/docker/compose.dev.yml +39 -0
- package/docker/compose.local.yml +84 -0
- package/docker/compose.yml +153 -0
- package/docs/VERSIONING.md +117 -0
- package/docs/database/DRIZZLE_COMMANDS_EXPLAINED.md +1779 -0
- package/docs/database/DRIZZLE_ZOD_POSTGRESQL_INSTRUCTION.md +646 -0
- package/docs/database/MIGRATION_BEST_PRACTICES.md +601 -0
- package/docs/database/MIGRATION_ROLLBACK.md +1080 -0
- package/docs/database/MIGRATION_SYSTEM.md +165 -0
- package/docs/database/MIGRATION_TROUBLESHOOTING.md +881 -0
- package/docs/development/ENVIRONMENT_CONFIG.md +896 -0
- package/docs/development/LOCAL_DEVELOPMENT.md +456 -0
- package/docs/development/REMOTE_DATABASE_SETUP.md +786 -0
- package/docs/development/STORAGE_SETUP.md +207 -0
- package/docs/development/SUPABASE_LOCAL_SETUP.md +178 -0
- package/docs/development/TESTING.md +714 -0
- package/docs/feature-architectures/LOADING_ARCHITECTURE.md +343 -0
- package/docs/feature-architectures/NOTIFICATION_ARCHITECTURE.md +858 -0
- package/docs/feature-architectures/RATE_LIMIT_RESET.md +147 -0
- package/docs/feature-architectures/RBAC.md +1132 -0
- package/docs/feature-architectures/RESOURCE_LIMITS.md +69 -0
- package/docs/feature-architectures/SECURITY.md +284 -0
- package/docs/feature-architectures/WORKSPACES.md +278 -0
- package/docs/plans/admin-setup-wizard-routing-plan.md +623 -0
- package/drizzle/0000_purple_wilson_fisk.sql +360 -0
- package/drizzle/0001_drop_instance_public_url.sql +1 -0
- package/drizzle/meta/0000_snapshot.json +3118 -0
- package/drizzle/meta/_journal.json +20 -0
- package/drizzle.config.ts +13 -0
- package/eslint.config.mjs +44 -0
- package/install.sh +180 -0
- package/next.config.ts +91 -0
- package/package.json +128 -22
- package/playwright.config.ts +70 -0
- package/postcss.config.mjs +7 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/logo.svg +11 -0
- package/public/next.svg +1 -0
- package/public/playground/CPM-101/as-is-image.jpg +0 -0
- package/public/playground/CPM-101/to-be-image.jpg +0 -0
- package/public/playground/TEST-1/LinkedIn-skeleton-screen.png +0 -0
- package/public/playground/TEST-1/https___dev-to-uploads.s3.amazonaws.com_uploads_articles_vuahe90ka1mkx9aepmea.webp +0 -0
- package/public/playground/TEST-1/linkedin_skeletonscreen.jpg +0 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/scripts/__tests__/migrate.integration.test.ts +642 -0
- package/scripts/__tests__/migrate.property.test.ts +1714 -0
- package/scripts/__tests__/migrate.test.ts +536 -0
- package/scripts/admin-reset-password.ts +114 -0
- package/scripts/check-email-queue.ts +99 -0
- package/scripts/check-sessions.ts +50 -0
- package/scripts/db-pull-data.sh +73 -0
- package/scripts/force-verify-email.sh +13 -0
- package/scripts/migrate.ts +693 -0
- package/scripts/process-email-queue.ts +26 -0
- package/scripts/reset-db.ts +47 -0
- package/scripts/reset-rate-limit.sh +26 -0
- package/scripts/reset-remote-db.sql +31 -0
- package/scripts/retry-failed-emails.ts +67 -0
- package/scripts/seed.ts +605 -0
- package/scripts/setup-monitoring.sh +440 -0
- package/scripts/sync-migration-tracking.ts +113 -0
- package/scripts/test-ci-error-handling.sh +237 -0
- package/scripts/test-ci-workflow.sh +200 -0
- package/scripts/test-migration.sh +151 -0
- package/scripts/validate-env.ts +25 -0
- package/scripts/validate-migration-system.ts +566 -0
- package/scripts/verify-ci-status-reporting.sh +206 -0
- package/scripts/verify-user-email.sql +22 -0
- package/scripts/verify-vercel-integration.ts +292 -0
- package/seed_data.md +54 -0
- package/src/app/(protected)/(team)/(routes)/[projectSlug]/error.tsx +89 -0
- package/src/app/(protected)/(team)/(routes)/[projectSlug]/loading.tsx +101 -0
- package/src/app/(protected)/(team)/(routes)/[projectSlug]/page.tsx +91 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/README.md +192 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/error.tsx +58 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/loading.tsx +14 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/not-found.tsx +47 -0
- package/src/app/(protected)/(team)/(routes)/issue/[issueKey]/page.tsx +91 -0
- package/src/app/(protected)/(team)/projects/page.tsx +16 -0
- package/src/app/(protected)/(team)/team/settings/(section)/instance/page.tsx +52 -0
- package/src/app/(protected)/(team)/team/settings/(section)/integrations/loading.tsx +5 -0
- package/src/app/(protected)/(team)/team/settings/(section)/integrations/page.tsx +23 -0
- package/src/app/(protected)/(team)/team/settings/(section)/members/loading.tsx +5 -0
- package/src/app/(protected)/(team)/team/settings/(section)/members/page.tsx +35 -0
- package/src/app/(protected)/(team)/team/settings/layout.tsx +72 -0
- package/src/app/(protected)/(team)/team/settings/loading.tsx +5 -0
- package/src/app/(protected)/(team)/team/settings/page.tsx +71 -0
- package/src/app/(protected)/dev/auth/README.md +151 -0
- package/src/app/(protected)/dev/auth/page.tsx +590 -0
- package/src/app/(protected)/layout.test.tsx +209 -0
- package/src/app/(protected)/layout.tsx +28 -0
- package/src/app/(protected)/onboarding/page.tsx +27 -0
- package/src/app/(protected)/settings/integrations/page.tsx +23 -0
- package/src/app/(protected)/settings/layout.tsx +26 -0
- package/src/app/(protected)/settings/notifications/page.tsx +26 -0
- package/src/app/(protected)/settings/other/page.tsx +23 -0
- package/src/app/(protected)/settings/page.tsx +23 -0
- package/src/app/(protected)/settings/preferences/page.tsx +23 -0
- package/src/app/(protected)/settings/security/page.tsx +37 -0
- package/src/app/(public)/forgot-password/page.tsx +20 -0
- package/src/app/(public)/invite/project/[token]/error.tsx +50 -0
- package/src/app/(public)/invite/project/[token]/loading.tsx +39 -0
- package/src/app/(public)/invite/project/[token]/page.tsx +156 -0
- package/src/app/(public)/layout.tsx +9 -0
- package/src/app/(public)/privacy-policy/page.tsx +12 -0
- package/src/app/(public)/reset-password/page.tsx +37 -0
- package/src/app/(public)/setup/__tests__/page.test.tsx +30 -0
- package/src/app/(public)/setup/page.tsx +17 -0
- package/src/app/(public)/share/issue/[token]/page.tsx +51 -0
- package/src/app/(public)/sign-in/page.tsx +55 -0
- package/src/app/(public)/sign-up/page.tsx +23 -0
- package/src/app/(public)/verify-email/page.tsx +22 -0
- package/src/app/(public)/verify-email-confirm/page.tsx +40 -0
- package/src/app/api/auth/[...all]/route.ts +6 -0
- package/src/app/api/auth/delete-account/route.ts +134 -0
- package/src/app/api/auth/dev/force-verify/route.ts +180 -0
- package/src/app/api/auth/dev/reset-rate-limit/route.ts +144 -0
- package/src/app/api/auth/dev/sessions/route.ts +172 -0
- package/src/app/api/auth/forgot-password/__tests__/forgot-password.property.test.ts +397 -0
- package/src/app/api/auth/forgot-password/route.ts +277 -0
- package/src/app/api/auth/logout/route.ts +115 -0
- package/src/app/api/auth/me/route.ts +123 -0
- package/src/app/api/auth/providers/__tests__/route.test.ts +236 -0
- package/src/app/api/auth/providers/route.ts +119 -0
- package/src/app/api/auth/resend-verification/route.ts +262 -0
- package/src/app/api/auth/reset-password/__tests__/reset-password.property.test.ts +493 -0
- package/src/app/api/auth/reset-password/__tests__/route.test.ts +284 -0
- package/src/app/api/auth/reset-password/route.ts +251 -0
- package/src/app/api/auth/verify-email/route.ts +232 -0
- package/src/app/api/example-cors/route.ts +61 -0
- package/src/app/api/health/route.ts +14 -0
- package/src/app/api/invite/project/[token]/__tests__/accept-invitation.integration.test.ts +348 -0
- package/src/app/api/invite/project/[token]/decline/route.ts +99 -0
- package/src/app/api/invite/project/[token]/route.ts +269 -0
- package/src/app/api/issues/[issueId]/activities/route.ts +213 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/comments/[commentId]/route.ts +486 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/comments/route.ts +283 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/read/route.ts +242 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/[annotationId]/route.ts +534 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/annotations/route.ts +514 -0
- package/src/app/api/issues/[issueId]/attachments/[attachmentId]/route.ts +161 -0
- package/src/app/api/issues/[issueId]/attachments/route.ts +376 -0
- package/src/app/api/issues/[issueId]/route.ts +516 -0
- package/src/app/api/notifications/[id]/read/route.ts +131 -0
- package/src/app/api/notifications/__tests__/notifications.integration.test.ts +350 -0
- package/src/app/api/notifications/read-all/route.ts +72 -0
- package/src/app/api/notifications/route.ts +148 -0
- package/src/app/api/notifications/unread-count/route.ts +77 -0
- package/src/app/api/projects/[id]/activities/route.ts +174 -0
- package/src/app/api/projects/[id]/invitations/[invitationId]/resend/route.ts +99 -0
- package/src/app/api/projects/[id]/invitations/[invitationId]/route.ts +96 -0
- package/src/app/api/projects/[id]/invitations/route.ts +254 -0
- package/src/app/api/projects/[id]/issues/route.ts +452 -0
- package/src/app/api/projects/[id]/join/route.ts +207 -0
- package/src/app/api/projects/[id]/members/[memberId]/route.ts +364 -0
- package/src/app/api/projects/[id]/members/me/route.ts +121 -0
- package/src/app/api/projects/[id]/members/route.ts +129 -0
- package/src/app/api/projects/[id]/route.ts +476 -0
- package/src/app/api/projects/route.ts +394 -0
- package/src/app/api/setup/admin/route.ts +255 -0
- package/src/app/api/setup/complete/__tests__/route.test.ts +60 -0
- package/src/app/api/setup/complete/route.ts +244 -0
- package/src/app/api/setup/config/route.ts +195 -0
- package/src/app/api/setup/export/route.ts +111 -0
- package/src/app/api/setup/health/route.ts +74 -0
- package/src/app/api/setup/import/route.ts +154 -0
- package/src/app/api/setup/status/route.ts +82 -0
- package/src/app/api/setup/workspace/route.ts +252 -0
- package/src/app/api/teams/[teamId]/export/route.ts +115 -0
- package/src/app/api/teams/[teamId]/invitations/[invitationId]/resend/route.ts +132 -0
- package/src/app/api/teams/[teamId]/invitations/[invitationId]/route.ts +117 -0
- package/src/app/api/teams/[teamId]/invitations/route.ts +363 -0
- package/src/app/api/teams/[teamId]/members/[userId]/route.ts +335 -0
- package/src/app/api/teams/[teamId]/members/route.ts +184 -0
- package/src/app/api/teams/[teamId]/members/search/route.ts +202 -0
- package/src/app/api/teams/[teamId]/route.ts +423 -0
- package/src/app/api/teams/[teamId]/switch/route.ts +140 -0
- package/src/app/api/teams/[teamId]/transfer-ownership/route.ts +212 -0
- package/src/app/api/teams/invitations/[token]/accept/route.ts +140 -0
- package/src/app/api/teams/invitations/by-id/[id]/accept/route.ts +98 -0
- package/src/app/api/teams/invitations/by-id/[id]/decline/route.ts +90 -0
- package/src/app/api/teams/route.ts +278 -0
- package/src/app/api/uploads/media/route.ts +118 -0
- package/src/app/api/uploads/presigned/route.ts +49 -0
- package/src/app/api/user/linked-accounts/route.ts +35 -0
- package/src/app/email-preview/page.tsx +11 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/global-error.tsx +21 -0
- package/src/app/layout.tsx +50 -0
- package/src/app/page.tsx +5 -0
- package/src/components/icons/atlassian-icon.tsx +22 -0
- package/src/components/icons/index.ts +1 -0
- package/src/components/layout/SIDEBAR_LAYOUT_BEST_PRACTICES.md +240 -0
- package/src/components/layout/app-shell-header-store.tsx +20 -0
- package/src/components/layout/app-shell-skeleton.tsx +89 -0
- package/src/components/layout/app-shell-wrapper.tsx +32 -0
- package/src/components/layout/app-shell.test.tsx +155 -0
- package/src/components/layout/app-shell.tsx +100 -0
- package/src/components/shared/headers/app-header-configurator.tsx +42 -0
- package/src/components/shared/headers/app-header.tsx +103 -0
- package/src/components/shared/headers/header-user-menu.tsx +247 -0
- package/src/components/shared/headers/index.ts +44 -0
- package/src/components/shared/headers/page-header.tsx +25 -0
- package/src/components/shared/notifications/__tests__/notification-bell.test.tsx +159 -0
- package/src/components/shared/notifications/__tests__/notification-dropdown.test.tsx +296 -0
- package/src/components/shared/notifications/__tests__/notification-item.test.tsx +328 -0
- package/src/components/shared/notifications/index.ts +45 -0
- package/src/components/shared/notifications/notification-actions.tsx +295 -0
- package/src/components/shared/notifications/notification-bell-button.tsx +77 -0
- package/src/components/shared/notifications/notification-dropdown.tsx +160 -0
- package/src/components/shared/notifications/notification-group-item.tsx +268 -0
- package/src/components/shared/notifications/notification-item.tsx +193 -0
- package/src/components/shared/notifications/notification-load-more.tsx +50 -0
- package/src/components/shared/notifications/notification-panel.tsx +49 -0
- package/src/components/shared/notifications/utils.tsx +127 -0
- package/src/components/shared/permission-guard/index.ts +1 -0
- package/src/components/shared/permission-guard/permission-tooltip.tsx +45 -0
- package/src/components/shared/relative-time.tsx +53 -0
- package/src/components/shared/section-container.tsx +32 -0
- package/src/components/shared/service-status-banner.tsx +121 -0
- package/src/components/shared/settings-sidebar/index.ts +2 -0
- package/src/components/shared/settings-sidebar/team-setting-aside.tsx +97 -0
- package/src/components/shared/settings-sidebar/user-settings-aside.tsx +66 -0
- package/src/components/shared/sidebar/app-sidebar.tsx +146 -0
- package/src/components/shared/sidebar/index.ts +36 -0
- package/src/components/shared/sidebar/sidebar-main.tsx +81 -0
- package/src/components/shared/sidebar/sidebar-project.tsx +61 -0
- package/src/components/shared/sidebar/sidebar-team-avatar.tsx +126 -0
- package/src/components/shared/sidebar/sidebar-team-switcher.tsx +185 -0
- package/src/components/shared/sidebar/type.ts +97 -0
- package/src/components/ui/alert-dialog.tsx +157 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/avatar-upload.tsx +147 -0
- package/src/components/ui/avatar.tsx +53 -0
- package/src/components/ui/badge.tsx +46 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button.tsx +60 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/collapsible.tsx +33 -0
- package/src/components/ui/command.tsx +184 -0
- package/src/components/ui/dialog.tsx +143 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +244 -0
- package/src/components/ui/image-cropper-dialog.tsx +167 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/optimized-image.tsx +220 -0
- package/src/components/ui/pagination.tsx +127 -0
- package/src/components/ui/popover.tsx +48 -0
- package/src/components/ui/progress.tsx +31 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +58 -0
- package/src/components/ui/select.tsx +187 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +733 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/sonner.tsx +40 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +116 -0
- package/src/components/ui/tabs.tsx +66 -0
- package/src/components/ui/textarea.tsx +23 -0
- package/src/components/ui/tooltip.tsx +61 -0
- package/src/config/__tests__/workspace.property.test.ts +40 -0
- package/src/config/auth.ts +62 -0
- package/src/config/integrations.ts +126 -0
- package/src/config/quotas.ts +20 -0
- package/src/config/roles.ts +463 -0
- package/src/config/settings-nav.ts +39 -0
- package/src/config/team-settings-nav.ts +37 -0
- package/src/config/user-settings-nav.ts +42 -0
- package/src/config/version.ts +1 -0
- package/src/config/workspace.ts +64 -0
- package/src/features/annotations/README.md +283 -0
- package/src/features/annotations/api/annotations-api.ts +194 -0
- package/src/features/annotations/api/comments-api.ts +147 -0
- package/src/features/annotations/api/index.ts +71 -0
- package/src/features/annotations/api/save-annotation.ts +150 -0
- package/src/features/annotations/api/schemas.ts +142 -0
- package/src/features/annotations/components/annotated-attachment-view.tsx +576 -0
- package/src/features/annotations/components/annotation-action-sheet.tsx +140 -0
- package/src/features/annotations/components/annotation-annotations-panel.tsx +213 -0
- package/src/features/annotations/components/annotation-box.tsx +539 -0
- package/src/features/annotations/components/annotation-canvas.tsx +534 -0
- package/src/features/annotations/components/annotation-comment-input.tsx +145 -0
- package/src/features/annotations/components/annotation-context-menu.tsx +164 -0
- package/src/features/annotations/components/annotation-drawer.tsx +231 -0
- package/src/features/annotations/components/annotation-layer.tsx +271 -0
- package/src/features/annotations/components/annotation-pin.tsx +318 -0
- package/src/features/annotations/components/annotation-popover.tsx +562 -0
- package/src/features/annotations/components/annotation-thread-panel.tsx +485 -0
- package/src/features/annotations/components/annotation-thread-preview.tsx +195 -0
- package/src/features/annotations/components/annotation-toolbar.tsx +244 -0
- package/src/features/annotations/components/keyboard-shortcuts-modal.tsx +79 -0
- package/src/features/annotations/docs/ANNOTATIONS_ARCHITECTURE.md +67 -0
- package/src/features/annotations/docs/ANNOTATION_SAVE_ARCHITECTURE.md +422 -0
- package/src/features/annotations/docs/ANNOTATION_SAVE_FEATURE.md +408 -0
- package/src/features/annotations/docs/BOX_ANNOTATION_GUIDE.md +542 -0
- package/src/features/annotations/docs/NEXTSTEP.md +28 -0
- package/src/features/annotations/docs/STALE_CLOSURE_FIX.md +344 -0
- package/src/features/annotations/docs/UNDO_REDO_QUICK_START.md +545 -0
- package/src/features/annotations/docs/local_first_canvas_autosave_architecture.md +674 -0
- package/src/features/annotations/examples/complete-example.tsx +266 -0
- package/src/features/annotations/examples/save-annotation-example.tsx +309 -0
- package/src/features/annotations/hooks/__tests__/use-annotation-permissions.property.test.tsx +493 -0
- package/src/features/annotations/hooks/index.ts +36 -0
- package/src/features/annotations/hooks/use-annotation-batch-save.ts +109 -0
- package/src/features/annotations/hooks/use-annotation-comments.ts +353 -0
- package/src/features/annotations/hooks/use-annotation-drafts.ts +137 -0
- package/src/features/annotations/hooks/use-annotation-edit-state.ts +99 -0
- package/src/features/annotations/hooks/use-annotation-history-tracker.ts +159 -0
- package/src/features/annotations/hooks/use-annotation-integration.ts +916 -0
- package/src/features/annotations/hooks/use-annotation-permissions.ts +210 -0
- package/src/features/annotations/hooks/use-annotation-popover.ts +175 -0
- package/src/features/annotations/hooks/use-annotation-save.ts +208 -0
- package/src/features/annotations/hooks/use-annotation-tools.ts +237 -0
- package/src/features/annotations/hooks/use-annotations-with-history.ts +332 -0
- package/src/features/annotations/hooks/use-auto-save.ts +94 -0
- package/src/features/annotations/index.ts +111 -0
- package/src/features/annotations/types/annotation.ts +201 -0
- package/src/features/annotations/types/index.ts +28 -0
- package/src/features/annotations/utils/history-manager.ts +73 -0
- package/src/features/annotations/utils/index.ts +2 -0
- package/src/features/annotations/utils/map-attachments-to-threads.ts +28 -0
- package/src/features/annotations/utils/position-comment-input.ts +136 -0
- package/src/features/annotations/utils/re-sequence-labels.ts +92 -0
- package/src/features/annotations/utils/validate-annotation-label.ts +120 -0
- package/src/features/auth/api/types.ts +101 -0
- package/src/features/auth/components/__tests__/role-gate.test.tsx +448 -0
- package/src/features/auth/components/__tests__/social-login-buttons.test.tsx +313 -0
- package/src/features/auth/components/auth-card.tsx +36 -0
- package/src/features/auth/components/forgot-password-form.tsx +115 -0
- package/src/features/auth/components/index.ts +14 -0
- package/src/features/auth/components/invite-code-input.tsx +155 -0
- package/src/features/auth/components/invited-user-form.tsx +309 -0
- package/src/features/auth/components/onboarding-form.tsx +195 -0
- package/src/features/auth/components/password-strength-indicator.tsx +113 -0
- package/src/features/auth/components/reset-password-form.tsx +138 -0
- package/src/features/auth/components/role-gate.tsx +124 -0
- package/src/features/auth/components/self-registration-choice.tsx +153 -0
- package/src/features/auth/components/sign-in-form.tsx +159 -0
- package/src/features/auth/components/sign-up-form.tsx +158 -0
- package/src/features/auth/components/social-login-buttons.tsx +219 -0
- package/src/features/auth/hooks/__tests__/use-onboarding.test.tsx +109 -0
- package/src/features/auth/hooks/__tests__/use-session.test.tsx +160 -0
- package/src/features/auth/hooks/index.ts +15 -0
- package/src/features/auth/hooks/use-accept-invitation.ts +194 -0
- package/src/features/auth/hooks/use-delete-account.ts +86 -0
- package/src/features/auth/hooks/use-force-verify.ts +89 -0
- package/src/features/auth/hooks/use-forgot-password.ts +144 -0
- package/src/features/auth/hooks/use-link-account.ts +78 -0
- package/src/features/auth/hooks/use-linked-accounts.ts +88 -0
- package/src/features/auth/hooks/use-onboarding.ts +159 -0
- package/src/features/auth/hooks/use-resend-verification.ts +139 -0
- package/src/features/auth/hooks/use-reset-password.ts +151 -0
- package/src/features/auth/hooks/use-reset-rate-limit.ts +56 -0
- package/src/features/auth/hooks/use-self-registration.ts +202 -0
- package/src/features/auth/hooks/use-session.ts +81 -0
- package/src/features/auth/hooks/use-sessions.ts +59 -0
- package/src/features/auth/hooks/use-sign-in.ts +234 -0
- package/src/features/auth/hooks/use-sign-out.ts +88 -0
- package/src/features/auth/hooks/use-sign-up.ts +194 -0
- package/src/features/auth/hooks/use-unlink-account.ts +100 -0
- package/src/features/auth/hooks/use-verify-email-token.ts +125 -0
- package/src/features/auth/index.ts +75 -0
- package/src/features/auth/screens/forgot-password-screen.tsx +33 -0
- package/src/features/auth/screens/index.ts +7 -0
- package/src/features/auth/screens/onboarding-screen.tsx +49 -0
- package/src/features/auth/screens/reset-password-screen.tsx +33 -0
- package/src/features/auth/screens/sign-in-screen.tsx +61 -0
- package/src/features/auth/screens/sign-up-screen.tsx +37 -0
- package/src/features/auth/screens/verify-email-confirm-screen.tsx +286 -0
- package/src/features/auth/screens/verify-email-screen.tsx +146 -0
- package/src/features/auth/types/index.ts +14 -0
- package/src/features/auth/utils/__tests__/validators.test.ts +331 -0
- package/src/features/auth/utils/password-strength.ts +129 -0
- package/src/features/auth/utils/validators.ts +124 -0
- package/src/features/email-preview/actions/render-email.ts +21 -0
- package/src/features/email-preview/screens/email-preview-screen.tsx +81 -0
- package/src/features/folder-scaffold-template/index.ts +0 -0
- package/src/features/instance-settings/components/index.ts +6 -0
- package/src/features/instance-settings/components/instance-settings-form.tsx +180 -0
- package/src/features/instance-settings/components/instance-status-display.tsx +158 -0
- package/src/features/instance-settings/index.ts +7 -0
- package/src/features/instance-settings/screens/index.ts +5 -0
- package/src/features/instance-settings/screens/instance-settings-screen.tsx +59 -0
- package/src/features/issues/README.md +330 -0
- package/src/features/issues/api/create-issue.ts +19 -0
- package/src/features/issues/api/delete-issue.ts +27 -0
- package/src/features/issues/api/get-issue-activities.ts +58 -0
- package/src/features/issues/api/get-issue-details.ts +25 -0
- package/src/features/issues/api/get-project-issues-server.ts +44 -0
- package/src/features/issues/api/get-project-issues.ts +21 -0
- package/src/features/issues/api/index.ts +44 -0
- package/src/features/issues/api/update-issue.ts +31 -0
- package/src/features/issues/api/upload-attachment.ts +81 -0
- package/src/features/issues/components/activity-timeline.tsx +440 -0
- package/src/features/issues/components/canvas-state-indicator.tsx +90 -0
- package/src/features/issues/components/centered-canvas-view.tsx +739 -0
- package/src/features/issues/components/image-selector.tsx +123 -0
- package/src/features/issues/components/image-upload-zone.tsx +262 -0
- package/src/features/issues/components/infinite-canvas-background.tsx +163 -0
- package/src/features/issues/components/inline-editable-select.tsx +173 -0
- package/src/features/issues/components/inline-editable-text.tsx +225 -0
- package/src/features/issues/components/inline-editable-textarea.tsx +219 -0
- package/src/features/issues/components/inline-editable-user-select.tsx +202 -0
- package/src/features/issues/components/issue-deletion-dialog.tsx +142 -0
- package/src/features/issues/components/issue-details-panel.tsx +101 -0
- package/src/features/issues/components/issues-create-dialog.tsx +578 -0
- package/src/features/issues/components/issues-list-filter.tsx +312 -0
- package/src/features/issues/components/issues-list.tsx +151 -0
- package/src/features/issues/components/issues-priority-badge.tsx +77 -0
- package/src/features/issues/components/issues-status-badge.tsx +100 -0
- package/src/features/issues/components/metadata-section.tsx +389 -0
- package/src/features/issues/components/optimized-attachment-view.tsx +528 -0
- package/src/features/issues/components/optimized-image.tsx +257 -0
- package/src/features/issues/components/panel-header.tsx +186 -0
- package/src/features/issues/components/preload.ts +31 -0
- package/src/features/issues/components/priority-selector.tsx +101 -0
- package/src/features/issues/components/responsive-issue-layout-skeleton.tsx +139 -0
- package/src/features/issues/components/responsive-issue-layout.tsx +617 -0
- package/src/features/issues/components/status-selector.tsx +320 -0
- package/src/features/issues/components/type-selector.tsx +102 -0
- package/src/features/issues/components/upload-progress-overlay.tsx +35 -0
- package/src/features/issues/components/uploaded-image-preview.tsx +173 -0
- package/src/features/issues/components/workflow-control.tsx +318 -0
- package/src/features/issues/components/zoom-controls.tsx +150 -0
- package/src/features/issues/config/index.ts +47 -0
- package/src/features/issues/config/options.ts +323 -0
- package/src/features/issues/config/workflow.ts +102 -0
- package/src/features/issues/docs/ARCHITECTURE_DIAGRAM.md +321 -0
- package/src/features/issues/docs/BACKEND_ARCHITECTURE.md +194 -0
- package/src/features/issues/docs/IMAGE_COMPONENTS_ARCHITECTURE.md +363 -0
- package/src/features/issues/docs/IMAGE_COMPONENTS_IMPORTS.md +412 -0
- package/src/features/issues/docs/IMPLEMENTATION_CHECKLIST.md +210 -0
- package/src/features/issues/docs/ROUTE_SETUP_COMPLETE.md +242 -0
- package/src/features/issues/hooks/index.ts +78 -0
- package/src/features/issues/hooks/use-canvas-transform.ts +255 -0
- package/src/features/issues/hooks/use-create-issue.ts +28 -0
- package/src/features/issues/hooks/use-elastic-scroll.ts +296 -0
- package/src/features/issues/hooks/use-issue-activities.ts +71 -0
- package/src/features/issues/hooks/use-issue-delete.ts +84 -0
- package/src/features/issues/hooks/use-issue-details.ts +70 -0
- package/src/features/issues/hooks/use-issue-filters.ts +50 -0
- package/src/features/issues/hooks/use-issue-update.ts +93 -0
- package/src/features/issues/hooks/use-keyboard-shortcuts.ts +104 -0
- package/src/features/issues/hooks/use-optimized-image.ts +228 -0
- package/src/features/issues/hooks/use-project-issues.ts +14 -0
- package/src/features/issues/index.ts +65 -0
- package/src/features/issues/screens/issue-details-screen.tsx +207 -0
- package/src/features/issues/screens/issue-details-skeletons.tsx +295 -0
- package/src/features/issues/screens/issue-share-screen.tsx +56 -0
- package/src/features/issues/types/index.ts +48 -0
- package/src/features/issues/types/issue.ts +291 -0
- package/src/features/issues/utils/filter-issues.ts +141 -0
- package/src/features/issues/utils/index.ts +14 -0
- package/src/features/legal/index.ts +1 -0
- package/src/features/legal/screens/privacy-policy-screen.tsx +307 -0
- package/src/features/notifications/api/get-notifications.ts +58 -0
- package/src/features/notifications/api/get-unread-count.ts +37 -0
- package/src/features/notifications/api/index.ts +35 -0
- package/src/features/notifications/api/mark-all-as-read.ts +37 -0
- package/src/features/notifications/api/mark-as-read.ts +41 -0
- package/src/features/notifications/api/types.ts +109 -0
- package/src/features/notifications/hooks/__tests__/use-notification-subscription.test.ts +206 -0
- package/src/features/notifications/hooks/index.ts +28 -0
- package/src/features/notifications/hooks/use-mark-all-as-read.ts +106 -0
- package/src/features/notifications/hooks/use-mark-as-read.ts +106 -0
- package/src/features/notifications/hooks/use-notification-subscription.ts +244 -0
- package/src/features/notifications/hooks/use-notification-toast.ts +161 -0
- package/src/features/notifications/hooks/use-notifications.ts +80 -0
- package/src/features/notifications/hooks/use-unread-count.ts +60 -0
- package/src/features/notifications/index.ts +48 -0
- package/src/features/notifications/utils/group-notifications.ts +152 -0
- package/src/features/notifications/utils/index.ts +9 -0
- package/src/features/projects/api/create-invitation.ts +45 -0
- package/src/features/projects/api/create-project.ts +64 -0
- package/src/features/projects/api/delete-project.ts +50 -0
- package/src/features/projects/api/get-project-activities.ts +43 -0
- package/src/features/projects/api/get-project-members.ts +53 -0
- package/src/features/projects/api/get-project.ts +49 -0
- package/src/features/projects/api/get-projects.ts +61 -0
- package/src/features/projects/api/index.ts +27 -0
- package/src/features/projects/api/join-project.ts +52 -0
- package/src/features/projects/api/leave-project.ts +51 -0
- package/src/features/projects/api/list-invitations.ts +36 -0
- package/src/features/projects/api/remove-member.ts +60 -0
- package/src/features/projects/api/resend-invitation.ts +36 -0
- package/src/features/projects/api/revoke-invitation.ts +36 -0
- package/src/features/projects/api/types.ts +286 -0
- package/src/features/projects/api/update-member-role.ts +70 -0
- package/src/features/projects/api/update-project.ts +69 -0
- package/src/features/projects/components/__tests__/project-detail-activity-feed.test.tsx +106 -0
- package/src/features/projects/components/__tests__/project-invitation-dialog.test.tsx +211 -0
- package/src/features/projects/components/__tests__/project-member-manager-dialog.test.tsx +254 -0
- package/src/features/projects/components/index.ts +21 -0
- package/src/features/projects/components/project-actions.tsx +248 -0
- package/src/features/projects/components/project-create-dialog.tsx +410 -0
- package/src/features/projects/components/project-detail-activity-feed.tsx +206 -0
- package/src/features/projects/components/project-detail-header.tsx +103 -0
- package/src/features/projects/components/project-detail-overview.tsx +128 -0
- package/src/features/projects/components/project-icon-selector.test.tsx +49 -0
- package/src/features/projects/components/project-icon-selector.tsx +76 -0
- package/src/features/projects/components/project-invitation-dialog.tsx +368 -0
- package/src/features/projects/components/project-issues.tsx +128 -0
- package/src/features/projects/components/project-leave-button.tsx +69 -0
- package/src/features/projects/components/project-list-card.tsx +246 -0
- package/src/features/projects/components/project-list-filters.tsx +320 -0
- package/src/features/projects/components/project-member-manager-dialog.tsx +419 -0
- package/src/features/projects/components/project-settings-dialog.tsx +204 -0
- package/src/features/projects/components/project-stats.tsx +46 -0
- package/src/features/projects/components/project-title-section.tsx +78 -0
- package/src/features/projects/config/icons.ts +91 -0
- package/src/features/projects/hooks/index.ts +28 -0
- package/src/features/projects/hooks/use-create-invitation.ts +83 -0
- package/src/features/projects/hooks/use-create-project.ts +77 -0
- package/src/features/projects/hooks/use-delete-project.ts +84 -0
- package/src/features/projects/hooks/use-join-project.ts +43 -0
- package/src/features/projects/hooks/use-leave-project.ts +84 -0
- package/src/features/projects/hooks/use-project-activities.ts +39 -0
- package/src/features/projects/hooks/use-project-filters.ts +86 -0
- package/src/features/projects/hooks/use-project-invitations.ts +66 -0
- package/src/features/projects/hooks/use-project-members.ts +57 -0
- package/src/features/projects/hooks/use-project.ts +67 -0
- package/src/features/projects/hooks/use-projects.ts +49 -0
- package/src/features/projects/hooks/use-recent-projects.ts +58 -0
- package/src/features/projects/hooks/use-remove-member.ts +89 -0
- package/src/features/projects/hooks/use-resend-invitation.ts +68 -0
- package/src/features/projects/hooks/use-revoke-invitation.ts +71 -0
- package/src/features/projects/hooks/use-team-member-suggestions.ts +133 -0
- package/src/features/projects/hooks/use-update-member-role.ts +92 -0
- package/src/features/projects/hooks/use-update-project.ts +88 -0
- package/src/features/projects/index.ts +91 -0
- package/src/features/projects/screens/index.ts +3 -0
- package/src/features/projects/screens/invitation-acceptance-screen.tsx +320 -0
- package/src/features/projects/screens/project-detail-screen-wrapper.tsx +47 -0
- package/src/features/projects/screens/project-detail-screen.tsx +661 -0
- package/src/features/projects/screens/projects-list-screen.tsx +161 -0
- package/src/features/projects/types/index.ts +59 -0
- package/src/features/projects/utils/format-helpers.ts +16 -0
- package/src/features/projects/utils/index.ts +2 -0
- package/src/features/projects/utils/role-helpers.ts +25 -0
- package/src/features/setup/api/complete-setup.ts +21 -0
- package/src/features/setup/api/create-admin.ts +21 -0
- package/src/features/setup/api/create-first-workspace.ts +21 -0
- package/src/features/setup/api/get-instance-status.ts +12 -0
- package/src/features/setup/api/get-service-health.ts +12 -0
- package/src/features/setup/api/index.ts +44 -0
- package/src/features/setup/api/save-instance-config.ts +21 -0
- package/src/features/setup/api/types.ts +122 -0
- package/src/features/setup/components/__tests__/setup-wizard-ui.test.tsx +362 -0
- package/src/features/setup/components/admin-account-step.tsx +205 -0
- package/src/features/setup/components/first-workspace-step.tsx +120 -0
- package/src/features/setup/components/index.ts +9 -0
- package/src/features/setup/components/instance-config-step.tsx +107 -0
- package/src/features/setup/components/mail-config-step.tsx +205 -0
- package/src/features/setup/components/sample-data-step.tsx +131 -0
- package/src/features/setup/components/service-health-step.tsx +180 -0
- package/src/features/setup/components/service-status-badge.tsx +50 -0
- package/src/features/setup/components/setup-progress.tsx +103 -0
- package/src/features/setup/components/setup-wizard.tsx +169 -0
- package/src/features/setup/hooks/index.ts +12 -0
- package/src/features/setup/hooks/use-complete-setup.ts +23 -0
- package/src/features/setup/hooks/use-create-admin.ts +25 -0
- package/src/features/setup/hooks/use-create-first-workspace.ts +24 -0
- package/src/features/setup/hooks/use-instance-status.ts +21 -0
- package/src/features/setup/hooks/use-save-instance-config.ts +23 -0
- package/src/features/setup/hooks/use-service-health.ts +21 -0
- package/src/features/setup/hooks/use-setup-wizard.ts +152 -0
- package/src/features/setup/hooks/use-workspace-mode.ts +19 -0
- package/src/features/setup/index.ts +30 -0
- package/src/features/setup/screens/index.ts +1 -0
- package/src/features/setup/screens/setup-screen.tsx +40 -0
- package/src/features/setup/types/index.ts +69 -0
- package/src/features/setup/utils/index.ts +78 -0
- package/src/features/team-settings/components/index.ts +39 -0
- package/src/features/team-settings/components/loading-states.tsx +296 -0
- package/src/features/team-settings/components/permission-guard.tsx +23 -0
- package/src/features/team-settings/components/settings-card.tsx +22 -0
- package/src/features/team-settings/components/settings-context-provider.tsx +51 -0
- package/src/features/team-settings/components/settings-error-boundary.tsx +366 -0
- package/src/features/team-settings/components/settings-navigation.tsx +87 -0
- package/src/features/team-settings/components/settings-section.tsx +23 -0
- package/src/features/team-settings/components/team-danger-zone.tsx +275 -0
- package/src/features/team-settings/components/team-information-form.tsx +116 -0
- package/src/features/team-settings/components/team-invitations-list.tsx +463 -0
- package/src/features/team-settings/components/team-members-list.tsx +342 -0
- package/src/features/team-settings/components/team-permission-guard.tsx +56 -0
- package/src/features/team-settings/components/team-setting-integrations.tsx +27 -0
- package/src/features/team-settings/components/team-setting-member.tsx +28 -0
- package/src/features/team-settings/components/team-settings-general.tsx +131 -0
- package/src/features/team-settings/components/transfer-ownership-modal.tsx +164 -0
- package/src/features/team-settings/components/unauthorized-access.tsx +52 -0
- package/src/features/team-settings/hooks/__tests__/use-team-settings.test.tsx +139 -0
- package/src/features/team-settings/hooks/index.ts +1 -0
- package/src/features/team-settings/hooks/use-team-settings.ts +148 -0
- package/src/features/team-settings/hooks/use-transfer-ownership.ts +45 -0
- package/src/features/team-settings/index.ts +25 -0
- package/src/features/team-settings/screens/index.ts +1 -0
- package/src/features/team-settings/screens/team-settings-screen.tsx +33 -0
- package/src/features/team-settings/types/index.ts +78 -0
- package/src/features/team-settings/utils/index.ts +6 -0
- package/src/features/team-settings/utils/mock-data.ts +40 -0
- package/src/features/teams/api/cancel-invitation.ts +25 -0
- package/src/features/teams/api/create-invitation.ts +28 -0
- package/src/features/teams/api/create-team.ts +14 -0
- package/src/features/teams/api/delete-team.ts +19 -0
- package/src/features/teams/api/get-invitations.ts +25 -0
- package/src/features/teams/api/get-team-members.ts +25 -0
- package/src/features/teams/api/get-team.ts +13 -0
- package/src/features/teams/api/get-teams.ts +19 -0
- package/src/features/teams/api/index.ts +49 -0
- package/src/features/teams/api/leave-team.ts +22 -0
- package/src/features/teams/api/remove-member.ts +25 -0
- package/src/features/teams/api/resend-invitation.ts +26 -0
- package/src/features/teams/api/switch-team.ts +13 -0
- package/src/features/teams/api/types.ts +122 -0
- package/src/features/teams/api/update-member-roles.ts +28 -0
- package/src/features/teams/api/update-team.ts +17 -0
- package/src/features/teams/components/create-team-dialog.tsx +105 -0
- package/src/features/teams/hooks/__tests__/cache-invalidation.property.test.tsx +268 -0
- package/src/features/teams/hooks/index.ts +35 -0
- package/src/features/teams/hooks/use-can-manage-members.ts +21 -0
- package/src/features/teams/hooks/use-can-manage-team.ts +21 -0
- package/src/features/teams/hooks/use-cancel-invitation.ts +52 -0
- package/src/features/teams/hooks/use-create-invitation.ts +59 -0
- package/src/features/teams/hooks/use-create-team.ts +38 -0
- package/src/features/teams/hooks/use-delete-team.ts +43 -0
- package/src/features/teams/hooks/use-invitations.ts +31 -0
- package/src/features/teams/hooks/use-leave-team.ts +43 -0
- package/src/features/teams/hooks/use-remove-member.ts +58 -0
- package/src/features/teams/hooks/use-resend-invitation.ts +52 -0
- package/src/features/teams/hooks/use-switch-team.ts +41 -0
- package/src/features/teams/hooks/use-team-members.ts +31 -0
- package/src/features/teams/hooks/use-team-permissions.ts +102 -0
- package/src/features/teams/hooks/use-team.ts +30 -0
- package/src/features/teams/hooks/use-teams.ts +26 -0
- package/src/features/teams/hooks/use-update-member-roles.ts +64 -0
- package/src/features/teams/hooks/use-update-team.ts +47 -0
- package/src/features/teams/index.ts +111 -0
- package/src/features/user-settings/actions/set-password.ts +63 -0
- package/src/features/user-settings/api/index.ts +16 -0
- package/src/features/user-settings/components/__tests__/security-settings.test.tsx +125 -0
- package/src/features/user-settings/components/delete-account-dialog.tsx +185 -0
- package/src/features/user-settings/components/index.ts +13 -0
- package/src/features/user-settings/components/integrations-list.tsx +152 -0
- package/src/features/user-settings/components/notification-preferences.tsx +112 -0
- package/src/features/user-settings/components/other-settings.tsx +126 -0
- package/src/features/user-settings/components/password-section.tsx +297 -0
- package/src/features/user-settings/components/security-settings.tsx +184 -0
- package/src/features/user-settings/components/user-preferences.tsx +146 -0
- package/src/features/user-settings/hooks/index.ts +8 -0
- package/src/features/user-settings/hooks/use-notification-preferences.ts +65 -0
- package/src/features/user-settings/hooks/use-user-preferences.ts +52 -0
- package/src/features/user-settings/index.ts +22 -0
- package/src/features/user-settings/screens/index.ts +11 -0
- package/src/features/user-settings/screens/integrations-screen.tsx +24 -0
- package/src/features/user-settings/screens/notifications-screen.tsx +29 -0
- package/src/features/user-settings/screens/other-settings-screen.tsx +24 -0
- package/src/features/user-settings/screens/setting-preferences-screen.tsx +24 -0
- package/src/features/user-settings/screens/user-settings-screen.tsx +23 -0
- package/src/features/user-settings/types/index.ts +42 -0
- package/src/features/user-settings/utils/index.ts +8 -0
- package/src/hooks/use-long-press.ts +196 -0
- package/src/hooks/use-media-upload.ts +95 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-team.ts +32 -0
- package/src/instrumentation.ts +14 -0
- package/src/lib/__tests__/auth-config.test.ts +166 -0
- package/src/lib/__tests__/config.test.ts +42 -0
- package/src/lib/__tests__/db.test.ts +101 -0
- package/src/lib/__tests__/env.property.test.ts +197 -0
- package/src/lib/__tests__/env.test.ts +177 -0
- package/src/lib/__tests__/health-check.test.ts +87 -0
- package/src/lib/__tests__/oauth-errors.test.ts +184 -0
- package/src/lib/__tests__/oauth-redirect.test.ts +224 -0
- package/src/lib/__tests__/oauth-scopes.test.ts +268 -0
- package/src/lib/__tests__/storage.test.ts +58 -0
- package/src/lib/__tests__/url-validator.test.ts +232 -0
- package/src/lib/api-client.ts +93 -0
- package/src/lib/auth-client.ts +5 -0
- package/src/lib/auth-config.ts +146 -0
- package/src/lib/auth.ts +209 -0
- package/src/lib/config.ts +228 -0
- package/src/lib/cors.ts +96 -0
- package/src/lib/date.ts +16 -0
- package/src/lib/db.ts +88 -0
- package/src/lib/env.ts +489 -0
- package/src/lib/feedback.ts +29 -0
- package/src/lib/health-check.ts +229 -0
- package/src/lib/logger.ts +204 -0
- package/src/lib/oauth-errors.ts +138 -0
- package/src/lib/performance.ts +367 -0
- package/src/lib/query-server.ts +35 -0
- package/src/lib/query.tsx +43 -0
- package/src/lib/resend.ts +36 -0
- package/src/lib/security-headers.ts +165 -0
- package/src/lib/setup-status.ts +34 -0
- package/src/lib/storage.ts +150 -0
- package/src/lib/supabase-client.ts +58 -0
- package/src/lib/testing/test-db.ts +75 -0
- package/src/lib/url-validator.ts +168 -0
- package/src/lib/utils.ts +6 -0
- package/src/mocks/README.md +42 -0
- package/src/mocks/activity.fixtures.ts +281 -0
- package/src/mocks/annotation.fixtures.ts +325 -0
- package/src/mocks/attachment.fixtures.ts +80 -0
- package/src/mocks/email.fixtures.ts +61 -0
- package/src/mocks/index.ts +33 -0
- package/src/mocks/issue.fixtures.ts +364 -0
- package/src/mocks/landing.fixtures.ts +118 -0
- package/src/mocks/notification.fixtures.ts +111 -0
- package/src/mocks/project-activity.fixtures.ts +69 -0
- package/src/mocks/project-invitation.fixtures.ts +95 -0
- package/src/mocks/project-member.fixtures.ts +93 -0
- package/src/mocks/project.fixtures.ts +249 -0
- package/src/mocks/settings.fixtures.ts +56 -0
- package/src/mocks/share.fixtures.ts +48 -0
- package/src/mocks/team-member.fixtures.ts +147 -0
- package/src/mocks/team.fixtures.ts +35 -0
- package/src/mocks/user-settings.fixtures.ts +77 -0
- package/src/mocks/user.fixtures.ts +21 -0
- package/src/providers/theme-provider.tsx +11 -0
- package/src/proxy/__tests__/proxy-setup-gate.test.ts +43 -0
- package/src/proxy.ts +169 -0
- package/src/server/annotations/__tests__/annotation-limit.property.test.ts +291 -0
- package/src/server/annotations/__tests__/attachment-deletion-cascade.property.test.ts +385 -0
- package/src/server/annotations/__tests__/comment-delete-authorization.property.test.ts +419 -0
- package/src/server/annotations/__tests__/sanitize.property.test.ts +302 -0
- package/src/server/annotations/annotation-service.ts +305 -0
- package/src/server/annotations/comment-service.ts +288 -0
- package/src/server/annotations/index.ts +61 -0
- package/src/server/annotations/permission-utils.ts +125 -0
- package/src/server/annotations/sanitize.ts +134 -0
- package/src/server/annotations/types.ts +161 -0
- package/src/server/audit/audit-service.ts +85 -0
- package/src/server/audit/index.ts +11 -0
- package/src/server/audit/types.ts +75 -0
- package/src/server/auth/__tests__/README.md +368 -0
- package/src/server/auth/__tests__/account-linking.integration.test.ts +410 -0
- package/src/server/auth/__tests__/auth-integration.test.ts +811 -0
- package/src/server/auth/__tests__/cookies.test.ts +337 -0
- package/src/server/auth/__tests__/login.property.test.ts +428 -0
- package/src/server/auth/__tests__/oauth-integration.test.ts +555 -0
- package/src/server/auth/__tests__/password.test.ts +194 -0
- package/src/server/auth/__tests__/rate-limiter.test.ts +450 -0
- package/src/server/auth/__tests__/rbac.test.ts +474 -0
- package/src/server/auth/__tests__/session.test.ts +599 -0
- package/src/server/auth/__tests__/signup.property.test.ts +224 -0
- package/src/server/auth/__tests__/token-encryption.test.ts +171 -0
- package/src/server/auth/__tests__/tokens.test.ts +476 -0
- package/src/server/auth/__tests__/verify-email.property.test.ts +372 -0
- package/src/server/auth/cookies.ts +184 -0
- package/src/server/auth/password.ts +94 -0
- package/src/server/auth/rate-limiter.ts +257 -0
- package/src/server/auth/rbac.ts +1168 -0
- package/src/server/auth/session.ts +392 -0
- package/src/server/auth/token-encryption.ts +201 -0
- package/src/server/auth/tokens.ts +397 -0
- package/src/server/db/schema/account.ts +21 -0
- package/src/server/db/schema/annotation-read-status.ts +57 -0
- package/src/server/db/schema/better-auth-verifications.ts +27 -0
- package/src/server/db/schema/email-jobs.ts +24 -0
- package/src/server/db/schema/index.ts +20 -0
- package/src/server/db/schema/instance-settings.ts +42 -0
- package/src/server/db/schema/issue-activities.ts +97 -0
- package/src/server/db/schema/issue-attachments.ts +101 -0
- package/src/server/db/schema/issues.ts +139 -0
- package/src/server/db/schema/notifications.ts +119 -0
- package/src/server/db/schema/project-activities.ts +116 -0
- package/src/server/db/schema/project-invitations.ts +34 -0
- package/src/server/db/schema/project-members.ts +29 -0
- package/src/server/db/schema/projects.ts +46 -0
- package/src/server/db/schema/sessions.ts +17 -0
- package/src/server/db/schema/team-invitations.ts +22 -0
- package/src/server/db/schema/team-members.ts +18 -0
- package/src/server/db/schema/teams.ts +15 -0
- package/src/server/db/schema/user-roles.ts +14 -0
- package/src/server/db/schema/users.ts +17 -0
- package/src/server/db/schema/verification-tokens.ts +15 -0
- package/src/server/email/README.md +258 -0
- package/src/server/email/__tests__/client.property.test.ts +218 -0
- package/src/server/email/__tests__/payload.property.test.ts +205 -0
- package/src/server/email/__tests__/queue.test.ts +407 -0
- package/src/server/email/__tests__/render-template.test.tsx +172 -0
- package/src/server/email/client.ts +70 -0
- package/src/server/email/index.ts +20 -0
- package/src/server/email/providers/console-provider.ts +43 -0
- package/src/server/email/providers/index.ts +5 -0
- package/src/server/email/providers/resend-provider.ts +59 -0
- package/src/server/email/providers/smtp-provider.ts +65 -0
- package/src/server/email/queue.ts +365 -0
- package/src/server/email/render-template.tsx +117 -0
- package/src/server/email/templates/layout.tsx +66 -0
- package/src/server/email/templates/ownership-transfer-email.tsx +75 -0
- package/src/server/email/templates/password-reset-email.tsx +72 -0
- package/src/server/email/templates/project-invitation-email.tsx +70 -0
- package/src/server/email/templates/security-alert-email.tsx +161 -0
- package/src/server/email/templates/team-invitation-email.tsx +68 -0
- package/src/server/email/templates/verification-email.tsx +61 -0
- package/src/server/email/templates/welcome-email.tsx +60 -0
- package/src/server/email/worker.ts +182 -0
- package/src/server/issues/activity-service.ts +422 -0
- package/src/server/issues/attachment-service.ts +379 -0
- package/src/server/issues/index.ts +68 -0
- package/src/server/issues/issue-service.ts +569 -0
- package/src/server/issues/types.ts +233 -0
- package/src/server/notifications/__tests__/notification-service.integration.test.ts +405 -0
- package/src/server/notifications/index.ts +13 -0
- package/src/server/notifications/notification-service.ts +526 -0
- package/src/server/notifications/types.ts +234 -0
- package/src/server/projects/__tests__/activity-logging.integration.test.ts +319 -0
- package/src/server/projects/__tests__/invitation-email.integration.test.ts +258 -0
- package/src/server/projects/__tests__/invitation-service.integration.test.ts +651 -0
- package/src/server/projects/__tests__/member-service.property.test.ts +397 -0
- package/src/server/projects/__tests__/project-service.property.test.ts +116 -0
- package/src/server/projects/activity-service.ts +548 -0
- package/src/server/projects/index.ts +11 -0
- package/src/server/projects/invitation-service.ts +773 -0
- package/src/server/projects/member-service.ts +458 -0
- package/src/server/projects/project-service.ts +491 -0
- package/src/server/projects/schemas.ts +310 -0
- package/src/server/projects/types.ts +166 -0
- package/src/server/projects/utils.ts +128 -0
- package/src/server/setup/__tests__/health-check.property.test.ts +70 -0
- package/src/server/setup/__tests__/sample-data.property.test.ts +82 -0
- package/src/server/setup/__tests__/setup.property.test.ts +95 -0
- package/src/server/setup/health-check-service.ts +294 -0
- package/src/server/setup/index.ts +35 -0
- package/src/server/setup/sample-data-service.ts +233 -0
- package/src/server/setup/setup-service.ts +229 -0
- package/src/server/setup/types.ts +96 -0
- package/src/server/teams/__tests__/export.property.test.ts +542 -0
- package/src/server/teams/__tests__/get-members.integration.test.ts +105 -0
- package/src/server/teams/__tests__/invitation-flow.integration.test.ts +402 -0
- package/src/server/teams/__tests__/invitations.property.test.ts +235 -0
- package/src/server/teams/__tests__/member-management-flow.integration.test.ts +306 -0
- package/src/server/teams/__tests__/members.property.test.ts +180 -0
- package/src/server/teams/__tests__/ownership-transfer.property.test.ts +173 -0
- package/src/server/teams/__tests__/resource-limits.property.test.ts +382 -0
- package/src/server/teams/__tests__/team-context-management.integration.test.ts +396 -0
- package/src/server/teams/__tests__/team-context.property.test.ts +854 -0
- package/src/server/teams/__tests__/team-creation-flow.integration.test.ts +310 -0
- package/src/server/teams/__tests__/team-creation.property.test.ts +280 -0
- package/src/server/teams/errors.ts +396 -0
- package/src/server/teams/export-service.ts +383 -0
- package/src/server/teams/index.ts +10 -0
- package/src/server/teams/invitation-service.ts +708 -0
- package/src/server/teams/member-service.ts +334 -0
- package/src/server/teams/resource-limits.ts +211 -0
- package/src/server/teams/slug.ts +58 -0
- package/src/server/teams/team-context.ts +648 -0
- package/src/server/teams/team-service.ts +660 -0
- package/src/server/teams/types.ts +81 -0
- package/src/server/teams/validation.ts +209 -0
- package/src/styles/globals.css +160 -0
- package/src/types/deployment.ts +39 -0
- package/supabase/config.toml +357 -0
- package/supabase/seed.sql +480 -0
- package/tests/e2e/.gitkeep +0 -0
- package/tests/e2e/QUICK_START.md +98 -0
- package/tests/e2e/README.md +301 -0
- package/tests/e2e/auth.spec.ts +583 -0
- package/tests/e2e/global-setup.ts +23 -0
- package/tests/e2e/global-teardown.ts +23 -0
- package/tests/e2e/helpers/auth-helpers.ts +310 -0
- package/tests/e2e/helpers/test-fixtures.ts +286 -0
- package/tests/e2e/smoke-test.spec.ts +330 -0
- package/tsconfig.json +48 -0
- package/vitest.config.ts +50 -0
- package/vitest.setup.ts +56 -0
- package/dist/index.js +0 -778
|
@@ -0,0 +1,881 @@
|
|
|
1
|
+
# Database Migration Troubleshooting Guide
|
|
2
|
+
|
|
3
|
+
This guide provides detailed troubleshooting information for the automated Drizzle migration system.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Error Code Reference](#error-code-reference)
|
|
10
|
+
- [Common Error Scenarios](#common-error-scenarios)
|
|
11
|
+
- [Log Examples](#log-examples)
|
|
12
|
+
- [Recovery Procedures](#recovery-procedures)
|
|
13
|
+
- [Prevention Best Practices](#prevention-best-practices)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🔢 Error Code Reference
|
|
18
|
+
|
|
19
|
+
### PostgreSQL Error Codes (SQL State)
|
|
20
|
+
|
|
21
|
+
| Code | Name | Description | Common Causes |
|
|
22
|
+
|------|------|-------------|---------------|
|
|
23
|
+
| **42601** | Syntax Error | Invalid SQL syntax | Typos, missing keywords, incorrect SQL structure |
|
|
24
|
+
| **42P01** | Undefined Table | Table does not exist | Wrong migration order, missing previous migration |
|
|
25
|
+
| **42703** | Undefined Column | Column does not exist | Referencing non-existent column, typo in column name |
|
|
26
|
+
| **42P07** | Duplicate Table | Table already exists | Migration run twice, missing IF NOT EXISTS |
|
|
27
|
+
| **42710** | Duplicate Object | Object already exists | Index/constraint already exists |
|
|
28
|
+
| **23505** | Unique Violation | Duplicate key value | Duplicate data, conflicting unique constraint |
|
|
29
|
+
| **23503** | Foreign Key Violation | Referenced record missing | Parent record doesn't exist, wrong data order |
|
|
30
|
+
| **23502** | Not Null Violation | NULL value in NOT NULL column | Missing required data, incorrect default |
|
|
31
|
+
| **23514** | Check Violation | Check constraint failed | Data doesn't meet constraint requirements |
|
|
32
|
+
| **08006** | Connection Failure | Database connection lost | Network issue, database down, timeout |
|
|
33
|
+
| **28P01** | Invalid Password | Authentication failed | Wrong credentials, expired password |
|
|
34
|
+
| **3D000** | Invalid Database | Database does not exist | Wrong database name in connection string |
|
|
35
|
+
|
|
36
|
+
### Migration System Error Messages
|
|
37
|
+
|
|
38
|
+
| Error Message | Meaning | Solution |
|
|
39
|
+
|---------------|---------|----------|
|
|
40
|
+
| "DIRECT_URL environment variable is not set" | Missing database connection configuration | Set GitHub secret or .env.local variable |
|
|
41
|
+
| "Invalid database URL format" | Malformed connection string | Check URL format: `postgresql://user:pass@host:port/db` |
|
|
42
|
+
| "Database connection failed after 3 attempts" | Cannot connect to database | Check network, database status, credentials |
|
|
43
|
+
| "Migration file is empty" | No SQL content in migration file | Delete empty file or add SQL statements |
|
|
44
|
+
| "Migration file contains only comments" | Only comments, no executable SQL | Add SQL statements or delete file |
|
|
45
|
+
| "Invalid naming convention" | Wrong filename format | Rename to `{timestamp}_{description}.sql` |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🔍 Common Error Scenarios
|
|
50
|
+
|
|
51
|
+
### Scenario 1: Configuration Errors
|
|
52
|
+
|
|
53
|
+
#### Missing DIRECT_URL
|
|
54
|
+
|
|
55
|
+
**Error Log:**
|
|
56
|
+
```
|
|
57
|
+
❌ DIRECT_URL environment variable is not set.
|
|
58
|
+
Please configure it in your environment or .env.local file.
|
|
59
|
+
|
|
60
|
+
Troubleshooting:
|
|
61
|
+
- Review the error details above and check the migration SQL.
|
|
62
|
+
- Ensure the database is accessible and has sufficient resources.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Diagnosis:**
|
|
66
|
+
- Environment variable not configured in GitHub Secrets
|
|
67
|
+
- Wrong secret name (should be `DEV_DIRECT_URL` or `PROD_DIRECT_URL`)
|
|
68
|
+
- Secret not accessible to workflow
|
|
69
|
+
|
|
70
|
+
**Solution:**
|
|
71
|
+
```bash
|
|
72
|
+
# Check existing secrets
|
|
73
|
+
gh secret list
|
|
74
|
+
|
|
75
|
+
# Set the correct secret
|
|
76
|
+
gh secret set DEV_DIRECT_URL --body "postgresql://postgres:password@host:5432/db"
|
|
77
|
+
gh secret set PROD_DIRECT_URL --body "postgresql://postgres:password@host:5432/db"
|
|
78
|
+
|
|
79
|
+
# Verify in GitHub UI
|
|
80
|
+
# Settings → Secrets and variables → Actions
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Invalid Database URL Format
|
|
84
|
+
|
|
85
|
+
**Error Log:**
|
|
86
|
+
```
|
|
87
|
+
❌ Invalid database URL format: Invalid URL
|
|
88
|
+
|
|
89
|
+
Context: Environment validation
|
|
90
|
+
Error: Invalid URL
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Diagnosis:**
|
|
94
|
+
- Missing protocol (`postgresql://`)
|
|
95
|
+
- Special characters not URL-encoded
|
|
96
|
+
- Missing required components (host, database name)
|
|
97
|
+
|
|
98
|
+
**Solution:**
|
|
99
|
+
```bash
|
|
100
|
+
# Correct format
|
|
101
|
+
postgresql://user:password@host.supabase.co:5432/postgres
|
|
102
|
+
|
|
103
|
+
# URL-encode special characters in password
|
|
104
|
+
# Example: p@ssw0rd! → p%40ssw0rd%21
|
|
105
|
+
|
|
106
|
+
# Use online URL encoder or:
|
|
107
|
+
python3 -c "import urllib.parse; print(urllib.parse.quote('p@ssw0rd!'))"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Scenario 2: Connection Errors
|
|
111
|
+
|
|
112
|
+
#### Database Unreachable
|
|
113
|
+
|
|
114
|
+
**Error Log:**
|
|
115
|
+
```
|
|
116
|
+
🔌 Testing database connection (attempt 1/3)...
|
|
117
|
+
⚠️ Connection attempt 1 failed: connect ETIMEDOUT
|
|
118
|
+
⏳ Retrying in 2 seconds...
|
|
119
|
+
🔌 Testing database connection (attempt 2/3)...
|
|
120
|
+
⚠️ Connection attempt 2 failed: connect ETIMEDOUT
|
|
121
|
+
⏳ Retrying in 2 seconds...
|
|
122
|
+
🔌 Testing database connection (attempt 3/3)...
|
|
123
|
+
⚠️ Connection attempt 3 failed: connect ETIMEDOUT
|
|
124
|
+
|
|
125
|
+
❌ Database connection failed after 3 attempts: connect ETIMEDOUT
|
|
126
|
+
|
|
127
|
+
Troubleshooting:
|
|
128
|
+
- Connection timeout. Check network connectivity and database availability.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Diagnosis:**
|
|
132
|
+
- Database is down or restarting
|
|
133
|
+
- Network connectivity issues
|
|
134
|
+
- Firewall blocking connection
|
|
135
|
+
- IP allowlist restrictions (Supabase)
|
|
136
|
+
|
|
137
|
+
**Solution:**
|
|
138
|
+
1. **Check database status** in Supabase dashboard
|
|
139
|
+
2. **Verify network connectivity** from GitHub Actions
|
|
140
|
+
3. **Check IP allowlist** (Supabase may block GitHub Actions IPs)
|
|
141
|
+
4. **Disable IP restrictions** or add GitHub Actions IP ranges
|
|
142
|
+
5. **Re-run workflow** (may be transient)
|
|
143
|
+
|
|
144
|
+
#### Authentication Failed
|
|
145
|
+
|
|
146
|
+
**Error Log:**
|
|
147
|
+
```
|
|
148
|
+
❌ Database connection failed: password authentication failed for user "postgres"
|
|
149
|
+
|
|
150
|
+
SQL State: 28P01
|
|
151
|
+
|
|
152
|
+
Troubleshooting:
|
|
153
|
+
- Authentication failed. Verify database credentials in DIRECT_URL.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Diagnosis:**
|
|
157
|
+
- Wrong password in connection string
|
|
158
|
+
- User doesn't exist
|
|
159
|
+
- Password expired or changed
|
|
160
|
+
|
|
161
|
+
**Solution:**
|
|
162
|
+
```bash
|
|
163
|
+
# Get correct credentials from Supabase
|
|
164
|
+
# Project Settings → Database → Connection string
|
|
165
|
+
|
|
166
|
+
# Update GitHub secret with correct credentials
|
|
167
|
+
gh secret set PROD_DIRECT_URL --body "postgresql://correct_user:correct_pass@..."
|
|
168
|
+
|
|
169
|
+
# Test connection locally first
|
|
170
|
+
DIRECT_URL="postgresql://..." bun run db:migrate
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Scenario 3: SQL Syntax Errors
|
|
174
|
+
|
|
175
|
+
#### Syntax Error in Migration
|
|
176
|
+
|
|
177
|
+
**Error Log:**
|
|
178
|
+
```
|
|
179
|
+
❌ Migration execution failed:
|
|
180
|
+
|
|
181
|
+
🔄 Transaction Rollback:
|
|
182
|
+
✓ Failed migration changes have been rolled back
|
|
183
|
+
✓ Database returned to pre-migration state
|
|
184
|
+
✓ Tracking table NOT updated for failed migration
|
|
185
|
+
✓ No partial changes applied
|
|
186
|
+
|
|
187
|
+
Context: Migration execution
|
|
188
|
+
Error: syntax error at or near "CREAT"
|
|
189
|
+
SQL State: 42601
|
|
190
|
+
Position: 1
|
|
191
|
+
|
|
192
|
+
Troubleshooting:
|
|
193
|
+
- SQL syntax error. Review the migration SQL for syntax issues.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Diagnosis:**
|
|
197
|
+
- Typo in SQL keyword (`CREAT` instead of `CREATE`)
|
|
198
|
+
- Missing semicolon
|
|
199
|
+
- Incorrect SQL structure
|
|
200
|
+
|
|
201
|
+
**Solution:**
|
|
202
|
+
```bash
|
|
203
|
+
# 1. Find the problematic migration
|
|
204
|
+
cat drizzle/0005_*.sql
|
|
205
|
+
|
|
206
|
+
# 2. Fix the syntax error
|
|
207
|
+
# Change: CREAT TABLE users ...
|
|
208
|
+
# To: CREATE TABLE users ...
|
|
209
|
+
|
|
210
|
+
# 3. Test locally
|
|
211
|
+
bun run db:push
|
|
212
|
+
|
|
213
|
+
# 4. Commit and push
|
|
214
|
+
git add drizzle/
|
|
215
|
+
git commit -m "fix: correct SQL syntax in migration"
|
|
216
|
+
git push
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Scenario 4: Constraint Violations
|
|
220
|
+
|
|
221
|
+
#### Unique Constraint Violation
|
|
222
|
+
|
|
223
|
+
**Error Log:**
|
|
224
|
+
```
|
|
225
|
+
❌ Migration execution failed:
|
|
226
|
+
|
|
227
|
+
Error: duplicate key value violates unique constraint "users_email_key"
|
|
228
|
+
SQL State: 23505
|
|
229
|
+
Constraint: users_email_key
|
|
230
|
+
Table: users
|
|
231
|
+
Column: email
|
|
232
|
+
|
|
233
|
+
Troubleshooting:
|
|
234
|
+
- Unique constraint violation. Check for duplicate data.
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Diagnosis:**
|
|
238
|
+
- Attempting to insert duplicate data
|
|
239
|
+
- Creating unique constraint on column with duplicates
|
|
240
|
+
- Migration run twice (shouldn't happen with tracking)
|
|
241
|
+
|
|
242
|
+
**Solution:**
|
|
243
|
+
```sql
|
|
244
|
+
-- Option 1: Clean up duplicates first
|
|
245
|
+
DELETE FROM users
|
|
246
|
+
WHERE id NOT IN (
|
|
247
|
+
SELECT MIN(id)
|
|
248
|
+
FROM users
|
|
249
|
+
GROUP BY email
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
-- Option 2: Use ON CONFLICT
|
|
253
|
+
INSERT INTO users (email, name)
|
|
254
|
+
VALUES ('test@example.com', 'Test')
|
|
255
|
+
ON CONFLICT (email) DO NOTHING;
|
|
256
|
+
|
|
257
|
+
-- Option 3: Add IF NOT EXISTS for constraints
|
|
258
|
+
CREATE UNIQUE INDEX IF NOT EXISTS users_email_idx
|
|
259
|
+
ON users(email);
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### Foreign Key Violation
|
|
263
|
+
|
|
264
|
+
**Error Log:**
|
|
265
|
+
```
|
|
266
|
+
❌ Migration execution failed:
|
|
267
|
+
|
|
268
|
+
Error: insert or update on table "posts" violates foreign key constraint "posts_user_id_fkey"
|
|
269
|
+
SQL State: 23503
|
|
270
|
+
Constraint: posts_user_id_fkey
|
|
271
|
+
Table: posts
|
|
272
|
+
Column: user_id
|
|
273
|
+
|
|
274
|
+
Troubleshooting:
|
|
275
|
+
- Foreign key constraint violation. Ensure referenced records exist.
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Diagnosis:**
|
|
279
|
+
- Referenced parent record doesn't exist
|
|
280
|
+
- Wrong migration order (child before parent)
|
|
281
|
+
- Data migration inserting invalid foreign keys
|
|
282
|
+
|
|
283
|
+
**Solution:**
|
|
284
|
+
```sql
|
|
285
|
+
-- Option 1: Ensure parent records exist first
|
|
286
|
+
INSERT INTO users (id, email) VALUES (1, 'user@example.com');
|
|
287
|
+
INSERT INTO posts (user_id, title) VALUES (1, 'Post Title');
|
|
288
|
+
|
|
289
|
+
-- Option 2: Use ON DELETE CASCADE
|
|
290
|
+
ALTER TABLE posts
|
|
291
|
+
ADD CONSTRAINT posts_user_id_fkey
|
|
292
|
+
FOREIGN KEY (user_id) REFERENCES users(id)
|
|
293
|
+
ON DELETE CASCADE;
|
|
294
|
+
|
|
295
|
+
-- Option 3: Check migration order
|
|
296
|
+
-- Ensure users table migration runs before posts table migration
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Scenario 5: Migration File Issues
|
|
300
|
+
|
|
301
|
+
#### Empty Migration File
|
|
302
|
+
|
|
303
|
+
**Error Log:**
|
|
304
|
+
```
|
|
305
|
+
⚠️ 0005_add_feature.sql: Skipping empty migration file
|
|
306
|
+
|
|
307
|
+
📊 Migration Summary:
|
|
308
|
+
Status: ✅ Success
|
|
309
|
+
Migrations Applied: 0
|
|
310
|
+
Migrations Skipped: 4
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Diagnosis:**
|
|
314
|
+
- Migration file has no content
|
|
315
|
+
- File was created but not populated
|
|
316
|
+
- Schema change didn't generate SQL
|
|
317
|
+
|
|
318
|
+
**Solution:**
|
|
319
|
+
```bash
|
|
320
|
+
# 1. Check the file
|
|
321
|
+
cat drizzle/0005_add_feature.sql
|
|
322
|
+
|
|
323
|
+
# 2. If truly empty, delete it
|
|
324
|
+
rm drizzle/0005_add_feature.sql
|
|
325
|
+
|
|
326
|
+
# 3. Regenerate migration
|
|
327
|
+
bun run db:generate
|
|
328
|
+
|
|
329
|
+
# 4. Verify it has content
|
|
330
|
+
cat drizzle/0005_*.sql
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
#### Comment-Only Migration
|
|
334
|
+
|
|
335
|
+
**Error Log:**
|
|
336
|
+
```
|
|
337
|
+
⚠️ 0006_update_schema.sql: Skipping comment-only migration file
|
|
338
|
+
|
|
339
|
+
📊 Migration Summary:
|
|
340
|
+
Status: ✅ Success
|
|
341
|
+
Migrations Applied: 0
|
|
342
|
+
Migrations Skipped: 5
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
**Diagnosis:**
|
|
346
|
+
- File contains only SQL comments
|
|
347
|
+
- No executable SQL statements
|
|
348
|
+
- Schema change was reverted before generating
|
|
349
|
+
|
|
350
|
+
**Solution:**
|
|
351
|
+
```bash
|
|
352
|
+
# 1. Check the file
|
|
353
|
+
cat drizzle/0006_update_schema.sql
|
|
354
|
+
|
|
355
|
+
# Example of comment-only file:
|
|
356
|
+
# -- Migration: Update schema
|
|
357
|
+
# -- Generated: 2024-01-15
|
|
358
|
+
# (no actual SQL)
|
|
359
|
+
|
|
360
|
+
# 2. Delete the file
|
|
361
|
+
rm drizzle/0006_update_schema.sql
|
|
362
|
+
|
|
363
|
+
# 3. Make actual schema changes
|
|
364
|
+
# Edit src/server/db/schema/*.ts
|
|
365
|
+
|
|
366
|
+
# 4. Regenerate
|
|
367
|
+
bun run db:generate
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Scenario 6: Batch Migration Failures
|
|
371
|
+
|
|
372
|
+
#### First Migration Fails, Rest Skipped
|
|
373
|
+
|
|
374
|
+
**Error Log:**
|
|
375
|
+
```
|
|
376
|
+
📦 Applying 3 pending migrations in batch mode...
|
|
377
|
+
|
|
378
|
+
🛡️ Batch Execution Guarantees:
|
|
379
|
+
✓ Migrations execute in chronological order (by timestamp)
|
|
380
|
+
✓ Halt-on-failure: First failure stops subsequent migrations
|
|
381
|
+
✓ Partial success: Completed migrations remain applied
|
|
382
|
+
✓ Per-migration progress: Each migration logged individually
|
|
383
|
+
|
|
384
|
+
❌ Migration execution failed:
|
|
385
|
+
|
|
386
|
+
🛑 Batch Execution Halted:
|
|
387
|
+
✓ Subsequent migrations NOT executed (halt-on-failure)
|
|
388
|
+
✓ Previously successful migrations remain applied
|
|
389
|
+
✓ Fix the failed migration and re-run to continue
|
|
390
|
+
|
|
391
|
+
📊 Partial Success: 0 migration(s) completed before failure
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Diagnosis:**
|
|
395
|
+
- First migration in batch failed
|
|
396
|
+
- Remaining migrations were not attempted
|
|
397
|
+
- Database is partially updated
|
|
398
|
+
|
|
399
|
+
**Solution:**
|
|
400
|
+
```bash
|
|
401
|
+
# 1. Fix the failed migration
|
|
402
|
+
# Review error details and fix the SQL
|
|
403
|
+
|
|
404
|
+
# 2. Test locally
|
|
405
|
+
bun run db:push
|
|
406
|
+
|
|
407
|
+
# 3. Push fix
|
|
408
|
+
git add drizzle/
|
|
409
|
+
git commit -m "fix: resolve migration issue"
|
|
410
|
+
git push
|
|
411
|
+
|
|
412
|
+
# 4. Workflow will:
|
|
413
|
+
# - Skip already-applied migrations (0 in this case)
|
|
414
|
+
# - Apply the fixed migration
|
|
415
|
+
# - Continue with remaining 2 migrations
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
#### Middle Migration Fails
|
|
419
|
+
|
|
420
|
+
**Error Log:**
|
|
421
|
+
```
|
|
422
|
+
📦 Applying 3 pending migrations in batch mode...
|
|
423
|
+
|
|
424
|
+
❌ Migration execution failed:
|
|
425
|
+
|
|
426
|
+
🛑 Batch Execution Halted:
|
|
427
|
+
✓ Subsequent migrations NOT executed (halt-on-failure)
|
|
428
|
+
✓ Previously successful migrations remain applied
|
|
429
|
+
✓ Fix the failed migration and re-run to continue
|
|
430
|
+
|
|
431
|
+
📊 Partial Success: 1 migration(s) completed before failure
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**Diagnosis:**
|
|
435
|
+
- First migration succeeded
|
|
436
|
+
- Second migration failed
|
|
437
|
+
- Third migration was not attempted
|
|
438
|
+
|
|
439
|
+
**Solution:**
|
|
440
|
+
```bash
|
|
441
|
+
# 1. Fix the second migration
|
|
442
|
+
# The first migration is already applied and will be skipped
|
|
443
|
+
|
|
444
|
+
# 2. Test locally (will skip first, apply second and third)
|
|
445
|
+
bun run db:push
|
|
446
|
+
|
|
447
|
+
# 3. Push fix
|
|
448
|
+
git add drizzle/
|
|
449
|
+
git commit -m "fix: resolve second migration"
|
|
450
|
+
git push
|
|
451
|
+
|
|
452
|
+
# 4. Workflow will:
|
|
453
|
+
# - Skip migration 1 (already applied)
|
|
454
|
+
# - Apply fixed migration 2
|
|
455
|
+
# - Apply migration 3
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## 📝 Log Examples
|
|
461
|
+
|
|
462
|
+
### Successful Migration (Single)
|
|
463
|
+
|
|
464
|
+
```
|
|
465
|
+
🔄 Starting database migrations...
|
|
466
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
467
|
+
📋 Migration Context:
|
|
468
|
+
Branch: develop
|
|
469
|
+
Commit: a1b2c3d
|
|
470
|
+
Environment: Preview
|
|
471
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
472
|
+
|
|
473
|
+
📝 Step 1: Validating environment...
|
|
474
|
+
✅ Environment validated
|
|
475
|
+
Database: vgmarozegrghrpgopmbs.supabase.co
|
|
476
|
+
|
|
477
|
+
🔌 Step 2: Testing database connectivity...
|
|
478
|
+
🔌 Testing database connection (attempt 1/3)...
|
|
479
|
+
✅ Database connection successful
|
|
480
|
+
|
|
481
|
+
📂 Step 3: Validating migration files...
|
|
482
|
+
📂 Found 5 migration file(s) in ./drizzle
|
|
483
|
+
Total files: 5
|
|
484
|
+
Valid: 5
|
|
485
|
+
Invalid/Skipped: 0
|
|
486
|
+
|
|
487
|
+
🚀 Step 4: Executing migrations...
|
|
488
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
489
|
+
📋 Migration execution order (by timestamp):
|
|
490
|
+
1. 0001_create_users.sql (timestamp: 1)
|
|
491
|
+
2. 0002_create_projects.sql (timestamp: 2)
|
|
492
|
+
3. 0003_add_indexes.sql (timestamp: 3)
|
|
493
|
+
4. 0004_add_timestamps.sql (timestamp: 4)
|
|
494
|
+
5. 0005_add_constraints.sql (timestamp: 5)
|
|
495
|
+
|
|
496
|
+
🔍 Checking migration tracking table...
|
|
497
|
+
Found 4 previously applied migration(s)
|
|
498
|
+
Already applied migrations:
|
|
499
|
+
1. Hash: a1b2c3d4... (applied: 2024-01-15T10:00:00.000Z)
|
|
500
|
+
2. Hash: e5f6g7h8... (applied: 2024-01-15T10:00:05.000Z)
|
|
501
|
+
3. Hash: i9j0k1l2... (applied: 2024-01-15T10:00:10.000Z)
|
|
502
|
+
4. Hash: m3n4o5p6... (applied: 2024-01-15T10:00:15.000Z)
|
|
503
|
+
|
|
504
|
+
📊 Batch Migration Detection:
|
|
505
|
+
Total migration files: 5
|
|
506
|
+
Already applied: 4
|
|
507
|
+
Pending migrations: 1
|
|
508
|
+
|
|
509
|
+
📦 Applying 1 pending migration...
|
|
510
|
+
|
|
511
|
+
🔒 Transaction Atomicity Guarantees:
|
|
512
|
+
✓ Each migration runs in its own PostgreSQL transaction
|
|
513
|
+
✓ Success: Changes committed + tracking table updated
|
|
514
|
+
✓ Failure: Changes rolled back + tracking table unchanged
|
|
515
|
+
✓ No partial changes: All-or-nothing execution per migration
|
|
516
|
+
|
|
517
|
+
⚡ Executing migrations with transaction boundaries...
|
|
518
|
+
|
|
519
|
+
🔍 Verifying migration tracking table...
|
|
520
|
+
Total applied migrations: 5
|
|
521
|
+
Newly applied: 1
|
|
522
|
+
Execution time: 234ms
|
|
523
|
+
|
|
524
|
+
✅ Successfully Applied Migrations:
|
|
525
|
+
1. Hash: q7r8s9t0... (applied: 2024-01-15T10:00:20.000Z)
|
|
526
|
+
|
|
527
|
+
✅ Transaction Verification:
|
|
528
|
+
✓ All 1 migration(s) committed successfully
|
|
529
|
+
✓ Tracking table updated with 1 new entries
|
|
530
|
+
✓ Database state is consistent
|
|
531
|
+
|
|
532
|
+
✅ All migrations completed successfully!
|
|
533
|
+
|
|
534
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
535
|
+
📊 Migration Summary:
|
|
536
|
+
Status: ✅ Success
|
|
537
|
+
Migrations Applied: 1
|
|
538
|
+
Migrations Skipped: 4
|
|
539
|
+
Migrations Failed: 0
|
|
540
|
+
Execution Time: 1234ms
|
|
541
|
+
Environment: Preview
|
|
542
|
+
Branch: develop
|
|
543
|
+
Commit: a1b2c3d
|
|
544
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
### Successful Migration (Batch)
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
📦 Applying 3 pending migrations in batch mode...
|
|
551
|
+
|
|
552
|
+
🔒 Transaction Atomicity Guarantees:
|
|
553
|
+
✓ Each migration runs in its own PostgreSQL transaction
|
|
554
|
+
✓ Success: Changes committed + tracking table updated
|
|
555
|
+
✓ Failure: Changes rolled back + tracking table unchanged
|
|
556
|
+
✓ No partial changes: All-or-nothing execution per migration
|
|
557
|
+
|
|
558
|
+
🛡️ Batch Execution Guarantees:
|
|
559
|
+
✓ Migrations execute in chronological order (by timestamp)
|
|
560
|
+
✓ Halt-on-failure: First failure stops subsequent migrations
|
|
561
|
+
✓ Partial success: Completed migrations remain applied
|
|
562
|
+
✓ Per-migration progress: Each migration logged individually
|
|
563
|
+
|
|
564
|
+
⚡ Executing migrations with transaction boundaries...
|
|
565
|
+
|
|
566
|
+
🔍 Verifying migration tracking table...
|
|
567
|
+
Total applied migrations: 8
|
|
568
|
+
Newly applied: 3
|
|
569
|
+
Execution time: 456ms
|
|
570
|
+
|
|
571
|
+
✅ Successfully Applied Migrations:
|
|
572
|
+
1. Hash: a1b2c3d4... (applied: 2024-01-15T10:00:25.000Z)
|
|
573
|
+
2. Hash: e5f6g7h8... (applied: 2024-01-15T10:00:26.000Z)
|
|
574
|
+
3. Hash: i9j0k1l2... (applied: 2024-01-15T10:00:27.000Z)
|
|
575
|
+
|
|
576
|
+
✅ Transaction Verification:
|
|
577
|
+
✓ All 3 migration(s) committed successfully
|
|
578
|
+
✓ Tracking table updated with 3 new entries
|
|
579
|
+
✓ Database state is consistent
|
|
580
|
+
|
|
581
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
582
|
+
📊 Migration Summary:
|
|
583
|
+
Status: ✅ Success
|
|
584
|
+
Migrations Applied: 3
|
|
585
|
+
Migrations Skipped: 5
|
|
586
|
+
Migrations Failed: 0
|
|
587
|
+
Execution Time: 2345ms
|
|
588
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### Failed Migration (Syntax Error)
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
❌ Migration execution failed:
|
|
595
|
+
|
|
596
|
+
🔄 Transaction Rollback:
|
|
597
|
+
✓ Failed migration changes have been rolled back
|
|
598
|
+
✓ Database returned to pre-migration state
|
|
599
|
+
✓ Tracking table NOT updated for failed migration
|
|
600
|
+
✓ No partial changes applied
|
|
601
|
+
|
|
602
|
+
Context: Migration execution
|
|
603
|
+
Error: syntax error at or near "CREAT"
|
|
604
|
+
SQL State: 42601
|
|
605
|
+
Position: 1
|
|
606
|
+
|
|
607
|
+
Troubleshooting:
|
|
608
|
+
- SQL syntax error. Review the migration SQL for syntax issues.
|
|
609
|
+
- Review the error details above and check the migration SQL.
|
|
610
|
+
- Ensure the database is accessible and has sufficient resources.
|
|
611
|
+
|
|
612
|
+
::error::Migration failed - see details above
|
|
613
|
+
|
|
614
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
615
|
+
📊 Migration Summary:
|
|
616
|
+
Status: ❌ Failed
|
|
617
|
+
Migrations Applied: 0
|
|
618
|
+
Migrations Skipped: 5
|
|
619
|
+
Migrations Failed: 1
|
|
620
|
+
Execution Time: 1567ms
|
|
621
|
+
Environment: Preview
|
|
622
|
+
Branch: develop
|
|
623
|
+
Commit: a1b2c3d
|
|
624
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### Failed Migration (Constraint Violation)
|
|
628
|
+
|
|
629
|
+
```
|
|
630
|
+
❌ Migration execution failed:
|
|
631
|
+
|
|
632
|
+
🔄 Transaction Rollback:
|
|
633
|
+
✓ Failed migration changes have been rolled back
|
|
634
|
+
✓ Database returned to pre-migration state
|
|
635
|
+
✓ Tracking table NOT updated for failed migration
|
|
636
|
+
✓ No partial changes applied
|
|
637
|
+
|
|
638
|
+
Context: Migration execution
|
|
639
|
+
Error: duplicate key value violates unique constraint "users_email_key"
|
|
640
|
+
SQL State: 23505
|
|
641
|
+
Constraint: users_email_key
|
|
642
|
+
Table: users
|
|
643
|
+
Column: email
|
|
644
|
+
|
|
645
|
+
Troubleshooting:
|
|
646
|
+
- Unique constraint violation. Check for duplicate data.
|
|
647
|
+
- Review the error details above and check the migration SQL.
|
|
648
|
+
- Ensure the database is accessible and has sufficient resources.
|
|
649
|
+
|
|
650
|
+
::error::Migration failed - see details above
|
|
651
|
+
|
|
652
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
653
|
+
📊 Migration Summary:
|
|
654
|
+
Status: ❌ Failed
|
|
655
|
+
Migrations Applied: 0
|
|
656
|
+
Migrations Skipped: 5
|
|
657
|
+
Migrations Failed: 1
|
|
658
|
+
Execution Time: 1234ms
|
|
659
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
### No Pending Migrations
|
|
663
|
+
|
|
664
|
+
```
|
|
665
|
+
🔍 Checking migration tracking table...
|
|
666
|
+
Found 5 previously applied migration(s)
|
|
667
|
+
|
|
668
|
+
📊 Batch Migration Detection:
|
|
669
|
+
Total migration files: 5
|
|
670
|
+
Already applied: 5
|
|
671
|
+
Pending migrations: 0
|
|
672
|
+
|
|
673
|
+
✅ No pending migrations to apply. Database is up to date.
|
|
674
|
+
|
|
675
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
676
|
+
📊 Migration Summary:
|
|
677
|
+
Status: ✅ Success
|
|
678
|
+
Migrations Applied: 0
|
|
679
|
+
Migrations Skipped: 5
|
|
680
|
+
Migrations Failed: 0
|
|
681
|
+
Execution Time: 567ms
|
|
682
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
## 🔧 Recovery Procedures
|
|
688
|
+
|
|
689
|
+
### Procedure 1: Fix Failed Migration
|
|
690
|
+
|
|
691
|
+
```bash
|
|
692
|
+
# 1. Identify the failed migration from logs
|
|
693
|
+
# Look for the error message and migration file name
|
|
694
|
+
|
|
695
|
+
# 2. Review the migration file
|
|
696
|
+
cat drizzle/XXXX_failed_migration.sql
|
|
697
|
+
|
|
698
|
+
# 3. Fix the issue
|
|
699
|
+
# - Correct SQL syntax
|
|
700
|
+
# - Add missing IF NOT EXISTS clauses
|
|
701
|
+
# - Fix constraint violations
|
|
702
|
+
# - Adjust migration logic
|
|
703
|
+
|
|
704
|
+
# 4. Test locally
|
|
705
|
+
bun run db:push
|
|
706
|
+
|
|
707
|
+
# 5. Verify the fix
|
|
708
|
+
bun run db:studio
|
|
709
|
+
# Check that changes are correct
|
|
710
|
+
|
|
711
|
+
# 6. Commit and push
|
|
712
|
+
git add drizzle/
|
|
713
|
+
git commit -m "fix: resolve migration issue"
|
|
714
|
+
git push
|
|
715
|
+
|
|
716
|
+
# 7. Monitor workflow
|
|
717
|
+
gh run watch
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### Procedure 2: Rollback Migration
|
|
721
|
+
|
|
722
|
+
```bash
|
|
723
|
+
# Option A: Revert the commit
|
|
724
|
+
git log --oneline
|
|
725
|
+
git revert <commit-hash>
|
|
726
|
+
git push
|
|
727
|
+
|
|
728
|
+
# Option B: Create rollback migration
|
|
729
|
+
cat > drizzle/$(date +%s)_rollback_feature.sql << 'EOF'
|
|
730
|
+
-- Rollback: Remove feature table
|
|
731
|
+
DROP TABLE IF EXISTS feature_table CASCADE;
|
|
732
|
+
DROP INDEX IF EXISTS feature_index;
|
|
733
|
+
EOF
|
|
734
|
+
|
|
735
|
+
git add drizzle/
|
|
736
|
+
git commit -m "rollback: remove feature table"
|
|
737
|
+
git push
|
|
738
|
+
|
|
739
|
+
# Option C: Manual database fix + skip migration
|
|
740
|
+
# 1. Fix database manually via Supabase SQL Editor
|
|
741
|
+
# 2. Add migration to tracking table to skip it
|
|
742
|
+
INSERT INTO drizzle.__drizzle_migrations (hash, created_at)
|
|
743
|
+
VALUES ('migration_hash', EXTRACT(EPOCH FROM NOW()) * 1000);
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### Procedure 3: Reset and Reapply
|
|
747
|
+
|
|
748
|
+
```bash
|
|
749
|
+
# CAUTION: This destroys all data!
|
|
750
|
+
# Only use in development environments
|
|
751
|
+
|
|
752
|
+
# 1. Backup data if needed
|
|
753
|
+
# Via Supabase dashboard: Database → Backups
|
|
754
|
+
|
|
755
|
+
# 2. Reset database
|
|
756
|
+
bun run db:reset
|
|
757
|
+
|
|
758
|
+
# 3. Reapply all migrations
|
|
759
|
+
bun run db:migrate
|
|
760
|
+
|
|
761
|
+
# 4. Verify schema
|
|
762
|
+
bun run db:studio
|
|
763
|
+
|
|
764
|
+
# 5. Reseed data if needed
|
|
765
|
+
bun run db:seed
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
### Procedure 4: Manual Migration Application
|
|
769
|
+
|
|
770
|
+
```bash
|
|
771
|
+
# If automated migration fails repeatedly
|
|
772
|
+
|
|
773
|
+
# 1. Get the SQL from migration file
|
|
774
|
+
cat drizzle/XXXX_migration.sql
|
|
775
|
+
|
|
776
|
+
# 2. Apply manually via Supabase SQL Editor
|
|
777
|
+
# https://supabase.com/dashboard/project/PROJECT_ID/sql/new
|
|
778
|
+
|
|
779
|
+
# 3. Add to tracking table
|
|
780
|
+
INSERT INTO drizzle.__drizzle_migrations (hash, created_at)
|
|
781
|
+
VALUES (
|
|
782
|
+
'hash_from_meta_journal',
|
|
783
|
+
EXTRACT(EPOCH FROM NOW()) * 1000
|
|
784
|
+
);
|
|
785
|
+
|
|
786
|
+
# 4. Verify
|
|
787
|
+
SELECT * FROM drizzle.__drizzle_migrations ORDER BY created_at DESC;
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
792
|
+
## 🛡️ Prevention Best Practices
|
|
793
|
+
|
|
794
|
+
### Before Creating Migrations
|
|
795
|
+
|
|
796
|
+
✅ **DO:**
|
|
797
|
+
- Review schema changes carefully
|
|
798
|
+
- Test changes in local development first
|
|
799
|
+
- Use meaningful migration names
|
|
800
|
+
- Add comments for complex migrations
|
|
801
|
+
- Check for breaking changes
|
|
802
|
+
- Coordinate with team on schema changes
|
|
803
|
+
|
|
804
|
+
❌ **DON'T:**
|
|
805
|
+
- Make schema changes without migrations
|
|
806
|
+
- Skip local testing
|
|
807
|
+
- Create migrations for temporary changes
|
|
808
|
+
- Modify existing migration files
|
|
809
|
+
- Rush migrations to production
|
|
810
|
+
|
|
811
|
+
### During Migration Creation
|
|
812
|
+
|
|
813
|
+
✅ **DO:**
|
|
814
|
+
- Use `IF NOT EXISTS` for CREATE statements
|
|
815
|
+
- Use `IF EXISTS` for DROP statements
|
|
816
|
+
- Add default values for new NOT NULL columns
|
|
817
|
+
- Create indexes concurrently for large tables
|
|
818
|
+
- Test with realistic data volumes
|
|
819
|
+
- Review generated SQL before committing
|
|
820
|
+
|
|
821
|
+
❌ **DON'T:**
|
|
822
|
+
- Drop tables or columns without team approval
|
|
823
|
+
- Create NOT NULL columns without defaults
|
|
824
|
+
- Ignore migration warnings
|
|
825
|
+
- Skip SQL review
|
|
826
|
+
- Commit untested migrations
|
|
827
|
+
|
|
828
|
+
### After Migration Creation
|
|
829
|
+
|
|
830
|
+
✅ **DO:**
|
|
831
|
+
- Test migration locally with `bun run db:push`
|
|
832
|
+
- Verify schema in Drizzle Studio
|
|
833
|
+
- Check migration order and dependencies
|
|
834
|
+
- Commit migration files with code changes
|
|
835
|
+
- Monitor deployment in GitHub Actions
|
|
836
|
+
- Verify production after deployment
|
|
837
|
+
|
|
838
|
+
❌ **DON'T:**
|
|
839
|
+
- Push without local testing
|
|
840
|
+
- Ignore validation warnings
|
|
841
|
+
- Deploy during peak hours (production)
|
|
842
|
+
- Skip monitoring after deployment
|
|
843
|
+
- Assume success without verification
|
|
844
|
+
|
|
845
|
+
### Monitoring and Maintenance
|
|
846
|
+
|
|
847
|
+
✅ **DO:**
|
|
848
|
+
- Monitor GitHub Actions logs
|
|
849
|
+
- Check migration tracking table regularly
|
|
850
|
+
- Keep migration files organized
|
|
851
|
+
- Document complex migrations
|
|
852
|
+
- Maintain rollback procedures
|
|
853
|
+
- Review failed migrations promptly
|
|
854
|
+
|
|
855
|
+
❌ **DON'T:**
|
|
856
|
+
- Ignore failed migrations
|
|
857
|
+
- Let migration files accumulate without review
|
|
858
|
+
- Skip documentation for complex changes
|
|
859
|
+
- Disable migration validation
|
|
860
|
+
- Ignore warning messages
|
|
861
|
+
|
|
862
|
+
---
|
|
863
|
+
|
|
864
|
+
## 📚 Additional Resources
|
|
865
|
+
|
|
866
|
+
- [CI/CD Setup Guide](../ci-cd/CI_CD_SETUP.md) - Complete deployment workflow
|
|
867
|
+
- [Drizzle Commands Explained](./DRIZZLE_COMMANDS_EXPLAINED.md) - Drizzle CLI reference
|
|
868
|
+
- [Migration System Architecture](./MIGRATION_SYSTEM.md) - System design and architecture
|
|
869
|
+
- [Supabase Documentation](https://supabase.com/docs) - Database platform docs
|
|
870
|
+
- [PostgreSQL Error Codes](https://www.postgresql.org/docs/current/errcodes-appendix.html) - Complete error code reference
|
|
871
|
+
|
|
872
|
+
---
|
|
873
|
+
|
|
874
|
+
**Need Help?**
|
|
875
|
+
|
|
876
|
+
If you encounter an issue not covered in this guide:
|
|
877
|
+
1. Check GitHub Actions logs for detailed error messages
|
|
878
|
+
2. Review the migration SQL file for issues
|
|
879
|
+
3. Test the migration locally with `bun run db:push`
|
|
880
|
+
4. Consult the PostgreSQL error code reference
|
|
881
|
+
5. Ask for help with specific error details and context
|