forked from portabilis/i-educar
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove OIDS das tabelas do banco de dados
- Loading branch information
1 parent
0937d4f
commit b68a247
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class RemoveOids extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
$tables = DB::select( | ||
"select schemaname || '.' || tablename as table_name from pg_tables WHERE schemaname <> 'pg_catalog' AND schemaname <> 'information_schema';" | ||
); | ||
|
||
foreach ($tables as $table) { | ||
DB::unprepared("alter table {$table->table_name} SET WITHOUT oids;"); | ||
} | ||
} | ||
} |