Skip to content

Commit b2305cd

Browse files
authored
fix(cli): exclude Prisma migrations from SQLite pull (#2427)
1 parent 4629810 commit b2305cd

File tree

1 file changed

+3
-2
lines changed
  • packages/cli/src/actions/pull/provider

1 file changed

+3
-2
lines changed

packages/cli/src/actions/pull/provider/sqlite.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ export const sqlite: IntrospectionProvider = {
134134

135135
// List user tables and views from sqlite_schema (the master catalog).
136136
// sqlite_schema contains one row per table, view, index, and trigger.
137-
// We filter to only tables/views and exclude internal sqlite_* objects.
137+
// We filter to only tables/views and exclude internal sqlite_* objects
138+
// and the Prisma migration tracking table.
138139
// The 'sql' column contains the original CREATE TABLE/VIEW statement.
139140
const tablesRaw = all<{ name: string; type: 'table' | 'view'; definition: string | null }>(
140-
"SELECT name, type, sql AS definition FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' ORDER BY name",
141+
"SELECT name, type, sql AS definition FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name <> '_prisma_migrations' ORDER BY name",
141142
);
142143

143144
// Detect AUTOINCREMENT by parsing the CREATE TABLE statement

0 commit comments

Comments
 (0)