Skip to content

Commit e22aa9b

Browse files
committed
chore: consolidate view drop methods
1 parent d65b7df commit e22aa9b

File tree

5 files changed

+6
-33
lines changed

5 files changed

+6
-33
lines changed

src/Grammars/Grammar.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ public function compileDrop(SqlEntity $entity): string
4040

4141
abstract protected function compileViewCreate(View $entity): string;
4242

43-
abstract protected function compileViewDrop(View $entity): string;
43+
protected function compileViewDrop(View $entity): string
44+
{
45+
return <<<SQL
46+
DROP VIEW IF EXISTS {$entity->name()}
47+
SQL;
48+
}
4449

4550
/** @param list<string>|null $columns */
4651
protected function compileColumnsList(?array $columns): string

src/Grammars/MariaDbGrammar.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,4 @@ protected function compileViewCreate(View $entity): string
2121
{$checkOption}
2222
SQL;
2323
}
24-
25-
#[Override]
26-
protected function compileViewDrop(View $entity): string
27-
{
28-
return <<<SQL
29-
DROP VIEW IF EXISTS {$entity->name()}
30-
SQL;
31-
}
3224
}

src/Grammars/MySqlGrammar.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,4 @@ protected function compileViewCreate(View $entity): string
2121
{$checkOption}
2222
SQL;
2323
}
24-
25-
#[Override]
26-
protected function compileViewDrop(View $entity): string
27-
{
28-
return <<<SQL
29-
DROP VIEW IF EXISTS {$entity->name()}
30-
SQL;
31-
}
3224
}

src/Grammars/SQLiteGrammar.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,4 @@ protected function compileViewCreate(View $entity): string
1919
{$entity->toString()}
2020
SQL;
2121
}
22-
23-
#[Override]
24-
protected function compileViewDrop(View $entity): string
25-
{
26-
return <<<SQL
27-
DROP VIEW IF EXISTS {$entity->name()}
28-
SQL;
29-
}
3022
}

src/Grammars/SqlServerGrammar.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,4 @@ protected function compileViewCreate(View $entity): string
2121
{$checkOption}
2222
SQL;
2323
}
24-
25-
#[Override]
26-
protected function compileViewDrop(View $entity): string
27-
{
28-
return <<<SQL
29-
DROP VIEW IF EXISTS {$entity->name()}
30-
SQL;
31-
}
3224
}

0 commit comments

Comments
 (0)