datatable.directory codebase
https://datatable.directory/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
719 B
31 lines
719 B
6 years ago
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class AddColumnSequence extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
DB::unprepared('CREATE SEQUENCE IF NOT EXISTS global_column_id_seq START 0 MINVALUE 0;');
|
||
|
// mandatory first increment to make the multi_nextval function work
|
||
|
DB::select("SELECT nextval('global_column_id_seq') as nv;");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
DB::unprepared('DROP SEQUENCE IF EXISTS global_column_id_seq;');
|
||
|
}
|
||
|
}
|