Switch to custom Schema facade

Updates the Schema facade to point to the custom one added in the
library repo, and sets all existing migrations to use our own
Blueprint class instead of the one provided by the Laravel framework.
This commit is contained in:
Dave Shoreman 2016-04-26 02:55:01 +01:00
parent 28a8f84692
commit 34f2aa7dcf
29 changed files with 61 additions and 42 deletions

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendUsers extends Migration
{
public function up()
{
Schema::create('backend_users', function ($table) {
Schema::create('backend_users', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('first_name')->nullable();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendUserGroups extends Migration
{
public function up()
{
Schema::create('backend_user_groups', function ($table) {
Schema::create('backend_user_groups', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name')->unique('name_unique');

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendUsersGroups extends Migration
{
public function up()
{
Schema::create('backend_users_groups', function ($table) {
Schema::create('backend_users_groups', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->integer('user_id')->unsigned();
$table->integer('user_group_id')->unsigned();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendUserThrottle extends Migration
{
public function up()
{
Schema::create('backend_user_throttle', function ($table) {
Schema::create('backend_user_throttle', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable()->index();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendUserPreferences extends Migration
{
public function up()
{
Schema::create('backend_user_preferences', function ($table) {
Schema::create('backend_user_preferences', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('user_id')->unsigned();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendAccessLog extends Migration
{
public function up()
{
Schema::create('backend_access_log', function ($table) {
Schema::create('backend_access_log', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('user_id')->unsigned();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbBackendAddDescriptionField extends Migration
{
public function up()
{
Schema::table('backend_user_groups', function ($table) {
Schema::table('backend_user_groups', function (Blueprint $table) {
$table->string('code')->nullable()->index('code_index');
$table->text('description')->nullable();
$table->boolean('is_new_user_default')->default(false);
@ -15,7 +16,7 @@ class DbBackendAddDescriptionField extends Migration
public function down()
{
// Schema::table('backend_user_groups', function ($table) {
// Schema::table('backend_user_groups', function (Blueprint $table) {
// $table->dropColumn('code');
// $table->dropColumn('description');
// $table->dropColumn('is_new_user_default');

View File

@ -1,5 +1,6 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
use Backend\Models\User as AdminModel;
@ -7,7 +8,7 @@ class DbBackendAddSuperuserFlag extends Migration
{
public function up()
{
Schema::table('backend_users', function ($table) {
Schema::table('backend_users', function (Blueprint $table) {
$table->boolean('is_superuser')->default(false);
});
@ -21,7 +22,7 @@ class DbBackendAddSuperuserFlag extends Migration
public function down()
{
// Schema::table('backend_users', function ($table) {
// Schema::table('backend_users', function (Blueprint $table) {
// $table->dropColumn('is_superuser');
// });
}

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbCmsThemeData extends Migration
{
public function up()
{
Schema::create('cms_theme_data', function ($table) {
Schema::create('cms_theme_data', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('theme')->nullable()->index();

View File

@ -26,7 +26,6 @@ return [
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Url' => Illuminate\Support\Facades\URL::class, // Preferred
@ -52,6 +51,7 @@ return [
'Ini' => October\Rain\Support\Facades\Ini::class,
'Twig' => October\Rain\Support\Facades\Twig::class,
'DbDongle' => October\Rain\Support\Facades\DbDongle::class,
'Schema' => October\Rain\Support\Facades\Schema::class,
'Backend' => Backend\Facades\Backend::class,
'BackendMenu' => Backend\Facades\BackendMenu::class,
'BackendAuth' => Backend\Facades\BackendAuth::class,

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbDeferredBindings extends Migration
{
public function up()
{
Schema::create('deferred_bindings', function ($table) {
Schema::create('deferred_bindings', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('master_type')->index();

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemFiles extends Migration
{
public function up()
{
Schema::create('system_files', function ($table) {
Schema::create('system_files', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('disk_name');

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemPluginVersions extends Migration
{
public function up()
{
Schema::create('system_plugin_versions', function ($table) {
Schema::create('system_plugin_versions', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('code')->index();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemPluginHistory extends Migration
{
public function up()
{
Schema::create('system_plugin_history', function ($table) {
Schema::create('system_plugin_history', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('code')->index();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemSettings extends Migration
{
public function up()
{
Schema::create('system_settings', function ($table) {
Schema::create('system_settings', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('item')->nullable()->index();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemParameters extends Migration
{
public function up()
{
Schema::create('system_parameters', function ($table) {
Schema::create('system_parameters', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('namespace', 100);

View File

@ -1,19 +1,20 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemAddDisabledFlag extends Migration
{
public function up()
{
Schema::table('system_plugin_versions', function ($table) {
Schema::table('system_plugin_versions', function (Blueprint $table) {
$table->boolean('is_disabled')->default(0);
});
}
public function down()
{
Schema::table('system_plugin_versions', function ($table) {
Schema::table('system_plugin_versions', function (Blueprint $table) {
$table->dropColumn('is_disabled');
});
}

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemMailTemplates extends Migration
{
public function up()
{
Schema::create('system_mail_templates', function ($table) {
Schema::create('system_mail_templates', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('code')->nullable();

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemMailLayouts extends Migration
{
public function up()
{
Schema::create('system_mail_layouts', function ($table) {
Schema::create('system_mail_layouts', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name')->nullable();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbJobs extends Migration
{
public function up()
{
Schema::create('jobs', function ($table) {
Schema::create('jobs', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id');
$table->string('queue');

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemEventLogs extends Migration
{
public function up()
{
Schema::create('system_event_logs', function ($table) {
Schema::create('system_event_logs', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('level')->nullable()->index();

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemRequestLogs extends Migration
{
public function up()
{
Schema::create('system_request_logs', function ($table) {
Schema::create('system_request_logs', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('status_code')->nullable();

View File

@ -1,10 +1,10 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemSessions extends Migration
{
/**
* Run the migrations.
*
@ -12,7 +12,7 @@ class DbSystemSessions extends Migration
*/
public function up()
{
Schema::create('sessions', function ($table) {
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->unique();
$table->text('payload')->nullable();
$table->integer('last_activity')->nullable();

View File

@ -1,6 +1,7 @@
<?php
use System\Models\MailLayout;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemMailLayoutRename extends Migration

View File

@ -1,19 +1,20 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemAddFrozenFlag extends Migration
{
public function up()
{
Schema::table('system_plugin_versions', function ($table) {
Schema::table('system_plugin_versions', function (Blueprint $table) {
$table->boolean('is_frozen')->default(0);
});
}
public function down()
{
Schema::table('system_plugin_versions', function ($table) {
Schema::table('system_plugin_versions', function (Blueprint $table) {
$table->dropColumn('is_frozen');
});
}

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbCache extends Migration
{
public function up()
{
Schema::create('cache', function ($table) {
Schema::create('cache', function (Blueprint $table) {
$table->string('key')->unique();
$table->text('value');
$table->integer('expiration');

View File

@ -1,13 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemRevisions extends Migration
{
public function up()
{
Schema::create('system_revisions', function ($table) {
Schema::create('system_revisions', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable()->index();

View File

@ -1,12 +1,13 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbFailedJobs extends Migration
{
public function up()
{
Schema::create('failed_jobs', function ($table) {
Schema::create('failed_jobs', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->text('connection');

View File

@ -1,19 +1,20 @@
<?php
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;
class DbSystemPluginHistoryDetailText extends Migration
{
public function up()
{
Schema::table('system_plugin_history', function ($table) {
Schema::table('system_plugin_history', function (Blueprint $table) {
$table->text('detail')->nullable()->change();
});
}
public function down()
{
Schema::table('system_plugin_history', function ($table) {
Schema::table('system_plugin_history', function (Blueprint $table) {
$table->string('detail')->nullable()->change();
});
}