Completed
Push — master ( 57ad4c...31fe35 )
by Freek
03:26 queued 01:40
created

Postgresql   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A dropAllTables() 0 10 2
1
<?php
2
3
namespace Spatie\MigrateFresh\TableDroppers;
4
5
use DB;
6
7
class Postgresql implements TableDropper
8
{
9
    public function dropAllTables()
10
    {
11
        $tableProperties = DB::select("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname='public'");
12
13
        $tableNames = array_column($tableProperties, 'tablename');
14
15
        foreach ($tableNames as $tableName) {
16
            DB::statement("DROP TABLE {$tableName} CASCADE");
17
        }
18
    }
19
}
20