Skip to content

fix(cli): exclude Prisma migrations from SQLite pull#2427

Merged
ymc9 merged 1 commit intozenstackhq:devfrom
svetch:dev
Mar 2, 2026
Merged

fix(cli): exclude Prisma migrations from SQLite pull#2427
ymc9 merged 1 commit intozenstackhq:devfrom
svetch:dev

Conversation

@svetch
Copy link
Copy Markdown
Contributor

@svetch svetch commented Mar 1, 2026

Filters out the internal migration tracking table during the introspection process. This prevents the CLI from including system-level metadata in the generated schema, ensuring only user-defined tables and views are processed.

Fixes: #2420

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced SQLite schema query handling by properly filtering out system migration tracking tables. This improvement ensures cleaner, more accurate database structure information by removing internal metadata, allowing users to see their actual database schema clearly without system tracking information that could complicate or obscure important schema details.

Filters out the internal migration tracking table during the introspection process. This prevents the CLI from including system-level metadata in the generated schema, ensuring only user-defined tables and views are processed.
Copilot AI review requested due to automatic review settings March 1, 2026 19:58
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7de2af2 and 6e55d7e.

📒 Files selected for processing (1)
  • packages/cli/src/actions/pull/provider/sqlite.ts

📝 Walkthrough

Walkthrough

The change modifies the SQLite schema introspection query to exclude the Prisma migrations table by adding a filter condition (name <> '_prisma_migrations') to the SELECT statement on sqlite_schema, with a corresponding comment update.

Changes

Cohort / File(s) Summary
SQLite Migration Exclusion
packages/cli/src/actions/pull/provider/sqlite.ts
Adds WHERE clause filter to exclude '_prisma_migrations' table from sqlite_schema SELECT query and updates related comment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Poem

🐰 With whiskers twitching and a hop so keen,
We filter the schema, keeping it clean!
'_prisma_migrations' must not stay,
Clean queries hopping on their way! 🌿✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: excluding Prisma migrations table from SQLite introspection in the CLI, which matches the file modification and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates SQLite introspection logic in the CLI db pull flow to exclude Prisma’s internal migration tracking table so generated schemas only include user-defined tables/views, aligning SQLite behavior with other providers.

Changes:

  • Exclude _prisma_migrations from the SQLite sqlite_schema query used during introspection.
  • Update inline comments to document the additional exclusion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ymc9 ymc9 merged commit b2305cd into zenstackhq:dev Mar 2, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Db pull does not exclude PrismaMigrations model for SQLite

3 participants