Add basic support for per-server databases
Still missing ability to define database servers
This commit is contained in:
parent
76049c5860
commit
7013d10987
8 changed files with 503 additions and 1 deletions
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDatabasesTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('databases', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('server')->unsigned();
|
||||
$table->integer('db_server')->unsigned();
|
||||
$table->string('database')->unique();
|
||||
$table->string('username')->unique();
|
||||
$table->string('remote')->default('%');
|
||||
$table->text('password');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('databases');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDatabaseServersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('database_servers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('host');
|
||||
$table->integer('port')->unsigned();
|
||||
$table->string('username');
|
||||
$table->text('password');
|
||||
$table->integer('max_databases')->unsigned()->nullable();
|
||||
$table->integer('linked_node')->unsigned()->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('database_servers');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue