Skip to content

Commit

Permalink
Fixes migration error when trying to drop a specific index.
Browse files Browse the repository at this point in the history
  • Loading branch information
richan-fongdasen authored Apr 15, 2024
1 parent b61c233 commit 98de22a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Database/TursoSchemaGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TursoSchemaGrammar extends SQLiteGrammar
{
public function compileDropAllIndexes(): string
{
return "SELECT 'DROP INDEX IF EXISTS \"' || name || '\";' FROM sqlite_schema WHERE type = 'index'";
return "SELECT 'DROP INDEX IF EXISTS \"' || name || '\";' FROM sqlite_schema WHERE type = 'index' AND name NOT LIKE 'sqlite_%'";
}

public function compileDropAllTables(): string
Expand All @@ -21,7 +21,7 @@ public function compileDropAllTables(): string

public function compileDropAllTriggers(): string
{
return "SELECT 'DROP TRIGGER IF EXISTS \"' || name || '\";' FROM sqlite_schema WHERE type = 'trigger'";
return "SELECT 'DROP TRIGGER IF EXISTS \"' || name || '\";' FROM sqlite_schema WHERE type = 'trigger' AND name NOT LIKE 'sqlite_%'";
}

public function compileDropAllViews(): string
Expand Down

0 comments on commit 98de22a

Please sign in to comment.