mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-05-15 12:37:34 +08:00
migrations boolean() -> smallInteger()
This commit is contained in:
@@ -16,7 +16,7 @@ return new class extends Migration
|
||||
$table->unsignedBigInteger('user_id')->index();
|
||||
$table->unsignedBigInteger('client_id');
|
||||
$table->text('scopes')->nullable();
|
||||
$table->boolean('revoked');
|
||||
$table->smallInteger('revoked');
|
||||
$table->dateTime('expires_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ return new class extends Migration
|
||||
$table->unsignedBigInteger('client_id');
|
||||
$table->string('name')->nullable();
|
||||
$table->text('scopes')->nullable();
|
||||
$table->boolean('revoked');
|
||||
$table->smallInteger('revoked');
|
||||
$table->timestamps();
|
||||
$table->dateTime('expires_at')->nullable();
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
|
||||
$table->string('id', 100)->primary();
|
||||
$table->string('access_token_id', 100)->index();
|
||||
$table->boolean('revoked');
|
||||
$table->smallInteger('revoked');
|
||||
$table->dateTime('expires_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ return new class extends Migration
|
||||
$table->string('secret', 100)->nullable();
|
||||
$table->string('provider')->nullable();
|
||||
$table->text('redirect');
|
||||
$table->boolean('personal_access_client');
|
||||
$table->boolean('password_client');
|
||||
$table->boolean('revoked');
|
||||
$table->smallInteger('personal_access_client');
|
||||
$table->smallInteger('password_client');
|
||||
$table->smallInteger('revoked');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateAdvertisementsTable extends Migration
|
||||
}
|
||||
Schema::create('advertisements', function (Blueprint $table) {
|
||||
$table->mediumIncrements('id');
|
||||
$table->boolean('enabled')->default(0);
|
||||
$table->smallInteger('enabled')->default(0);
|
||||
$table->enum('type', ['bbcodes', 'xhtml', 'text', 'image', 'flash']);
|
||||
$table->enum('position', ['header', 'footer', 'belownav', 'belowsearchbox', 'torrentdetail', 'comment', 'interoverforums', 'forumpost', 'popup']);
|
||||
$table->tinyInteger('displayorder')->default(0);
|
||||
|
||||
@@ -27,8 +27,8 @@ class CreateAttachmentsTable extends Migration
|
||||
$table->unsignedBigInteger('filesize')->default(0);
|
||||
$table->string('location')->default('');
|
||||
$table->mediumInteger('downloads')->default(0);
|
||||
$table->boolean('isimage')->unsigned()->default(0);
|
||||
$table->boolean('thumb')->unsigned()->default(0);
|
||||
$table->smallInteger('isimage')->unsigned()->default(0);
|
||||
$table->smallInteger('thumb')->unsigned()->default(0);
|
||||
$table->index(['userid', 'id'], 'pid');
|
||||
$table->index(['added', 'isimage', 'downloads'], 'dateline');
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class CreateCheatersTable extends Migration
|
||||
$table->unsignedMediumInteger('leechers')->default(0);
|
||||
$table->unsignedTinyInteger('hit')->default(0);
|
||||
$table->unsignedMediumInteger('dealtby')->default(0);
|
||||
$table->boolean('dealtwith')->default(0);
|
||||
$table->smallInteger('dealtwith')->default(0);
|
||||
$table->string('comment')->default('');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class CreateFriendsTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->unsignedMediumInteger('userid')->default(0);
|
||||
$table->unsignedMediumInteger('friendid')->default(0);
|
||||
$table->unique(['userid', 'friendid'], 'userfriend');
|
||||
$table->unique(['userid', 'friendid']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class CreateNewsTable extends Migration
|
||||
Schema::create('news', function (Blueprint $table) {
|
||||
$table->mediumIncrements('id');
|
||||
$table->unsignedMediumInteger('userid')->default(0);
|
||||
$table->dateTime('added')->nullable()->index('added');
|
||||
$table->dateTime('added')->nullable()->index();
|
||||
$table->text('body')->nullable();
|
||||
$table->string('title')->default('');
|
||||
$table->enum('notify', ['yes', 'no'])->default('no');
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateOffersTable extends Migration
|
||||
}
|
||||
Schema::create('offers', function (Blueprint $table) {
|
||||
$table->mediumIncrements('id');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->string('name', 225)->default('');
|
||||
$table->text('descr')->nullable();
|
||||
$table->dateTime('added')->nullable();
|
||||
|
||||
@@ -19,7 +19,7 @@ class CreateOffervotesTable extends Migration
|
||||
Schema::create('offervotes', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedMediumInteger('offerid')->default(0);
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->enum('vote', ['yeah', 'against'])->default('yeah');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class CreatePeersTable extends Migration
|
||||
$table->unsignedBigInteger('downloadoffset')->default(0);
|
||||
$table->unsignedBigInteger('uploadoffset')->default(0);
|
||||
$table->char('passkey', 32)->default('');
|
||||
$table->unique(['torrent', 'peer_id']);
|
||||
$table->unique(['torrent', 'peer_id', 'userid']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ class CreatePollanswersTable extends Migration
|
||||
}
|
||||
Schema::create('pollanswers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedMediumInteger('pollid')->default(0)->index('pollid');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->unsignedTinyInteger('selection')->default(0)->index('selection');
|
||||
$table->unsignedMediumInteger('pollid')->default(0)->index();
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->unsignedTinyInteger('selection')->default(0)->index();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ class CreatePostsTable extends Migration
|
||||
Schema::create('posts', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedMediumInteger('topicid')->default(0);
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->dateTime('added')->nullable()->index('added');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->dateTime('added')->nullable()->index();
|
||||
$table->text('body')->nullable();
|
||||
$table->text('ori_body')->nullable();
|
||||
$table->unsignedMediumInteger('editedby')->default(0);
|
||||
$table->dateTime('editdate')->nullable();
|
||||
$table->index(['topicid', 'id'], 'topicid_id');
|
||||
$table->index(['topicid', 'id']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ class CreateReadpostsTable extends Migration
|
||||
}
|
||||
Schema::create('readposts', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->unsignedMediumInteger('topicid')->default(0)->index('topicid');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->unsignedMediumInteger('topicid')->default(0)->index();
|
||||
$table->unsignedInteger('lastpostread')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class CreateReportsTable extends Migration
|
||||
$table->enum('type', ['torrent', 'user', 'offer', 'request', 'post', 'comment', 'subtitle'])->default('torrent');
|
||||
$table->string('reason')->default('');
|
||||
$table->unsignedMediumInteger('dealtby')->default(0);
|
||||
$table->boolean('dealtwith')->default(0);
|
||||
$table->smallInteger('dealtwith')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateRequestsTable extends Migration
|
||||
}
|
||||
Schema::create('requests', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('userid')->default(0)->index('userid');
|
||||
$table->unsignedInteger('userid')->default(0)->index();
|
||||
$table->string('request', 225)->default('');
|
||||
$table->text('descr');
|
||||
$table->unsignedInteger('comments')->default(0);
|
||||
@@ -31,7 +31,7 @@ class CreateRequestsTable extends Migration
|
||||
$table->string('ori_descr')->default('');
|
||||
$table->integer('ori_amount')->default(0);
|
||||
$table->dateTime('added')->nullable();
|
||||
$table->index(['finish', 'userid'], 'finish, userid');
|
||||
$table->index(['finish', 'userid']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class CreateSearchboxFieldsTable extends Migration
|
||||
$table->integer('field_id')->default(0);
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('update_at')->useCurrent();
|
||||
$table->unique(['searchbox_id', 'field_type', 'field_id'], 'uniq_searchbox_type_id');
|
||||
$table->unique(['searchbox_id', 'field_type', 'field_id']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ class CreateSearchboxTable extends Migration
|
||||
Schema::create('searchbox', function (Blueprint $table) {
|
||||
$table->smallIncrements('id');
|
||||
$table->string('name', 30)->nullable();
|
||||
$table->boolean('showsubcat')->default(0);
|
||||
$table->boolean('showsource')->default(0);
|
||||
$table->boolean('showmedium')->default(0);
|
||||
$table->boolean('showcodec')->default(0);
|
||||
$table->boolean('showstandard')->default(0);
|
||||
$table->boolean('showprocessing')->default(0);
|
||||
$table->boolean('showteam')->default(0);
|
||||
$table->boolean('showaudiocodec')->default(0);
|
||||
$table->smallInteger('showsubcat')->default(0);
|
||||
$table->smallInteger('showsource')->default(0);
|
||||
$table->smallInteger('showmedium')->default(0);
|
||||
$table->smallInteger('showcodec')->default(0);
|
||||
$table->smallInteger('showstandard')->default(0);
|
||||
$table->smallInteger('showprocessing')->default(0);
|
||||
$table->smallInteger('showteam')->default(0);
|
||||
$table->smallInteger('showaudiocodec')->default(0);
|
||||
$table->unsignedSmallInteger('catsperrow')->default(7);
|
||||
$table->unsignedSmallInteger('catpadding')->default(25);
|
||||
$table->text('custom_fields')->nullable();
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateSitelogTable extends Migration
|
||||
}
|
||||
Schema::create('sitelog', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->dateTime('added')->nullable()->index('added');
|
||||
$table->dateTime('added')->nullable()->index();
|
||||
$table->text('txt');
|
||||
$table->enum('security_level', ['normal', 'mod'])->default('normal');
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ class CreateSnatchedTable extends Migration
|
||||
Schema::create('snatched', function (Blueprint $table) {
|
||||
$table->bigIncrements('id', true);
|
||||
$table->unsignedMediumInteger('torrentid')->default(0);
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->string('ip', 64)->default('');
|
||||
$table->unsignedSmallInteger('port')->default(0);
|
||||
$table->unsignedBigInteger('uploaded')->default(0);
|
||||
@@ -31,7 +31,7 @@ class CreateSnatchedTable extends Migration
|
||||
$table->dateTime('startdat')->nullable();
|
||||
$table->dateTime('completedat')->nullable();
|
||||
$table->enum('finished', ['yes', 'no'])->default('no');
|
||||
$table->unique(['torrentid', 'userid'], 'torrentid_userid');
|
||||
$table->unique(['torrentid', 'userid']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class CreateStaffmessagesTable extends Migration
|
||||
$table->text('msg')->nullable();
|
||||
$table->string('subject', 128)->default('');
|
||||
$table->unsignedMediumInteger('answeredby')->default(0);
|
||||
$table->boolean('answered')->default(0);
|
||||
$table->smallInteger('answered')->default(0);
|
||||
$table->text('answer')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ class CreateTopicsTable extends Migration
|
||||
}
|
||||
Schema::create('topics', function (Blueprint $table) {
|
||||
$table->mediumIncrements('id');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
|
||||
$table->string('subject', 128)->default('')->index('subject');
|
||||
$table->unsignedMediumInteger('userid')->default(0)->index();
|
||||
$table->string('subject', 128)->default('')->index();
|
||||
$table->enum('locked', ['yes', 'no'])->default('no');
|
||||
$table->unsignedSmallInteger('forumid')->default(0);
|
||||
$table->unsignedInteger('firstpost')->default(0);
|
||||
@@ -27,8 +27,8 @@ class CreateTopicsTable extends Migration
|
||||
$table->enum('sticky', ['no', 'yes'])->default('no');
|
||||
$table->unsignedTinyInteger('hlcolor')->default(0);
|
||||
$table->unsignedInteger('views')->default(0);
|
||||
$table->index(['forumid', 'lastpost'], 'forumid_lastpost');
|
||||
$table->index(['forumid', 'sticky', 'lastpost'], 'forumid_sticky_lastpost');
|
||||
$table->index(['forumid', 'lastpost'], );
|
||||
$table->index(['forumid', 'sticky', 'lastpost'], );
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ class CreateTorrentSecretsTable extends Migration
|
||||
}
|
||||
Schema::create('torrent_secrets', function (Blueprint $table) {
|
||||
$table->integer('id', true);
|
||||
$table->integer('uid')->index('idx_uid');
|
||||
$table->integer('torrent_id')->default(0)->index('idx_torrent_id');
|
||||
$table->integer('uid')->index();
|
||||
$table->integer('torrent_id')->default(0)->index();
|
||||
$table->string('secret');
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
|
||||
@@ -18,16 +18,14 @@ class CreateTorrentsCustomFieldValuesTable extends Migration
|
||||
}
|
||||
Schema::create('torrents_custom_field_values', function (Blueprint $table) {
|
||||
$table->integer('id', true);
|
||||
$table->integer('torrent_id')->default(0)->index('idx_torrent_id');
|
||||
$table->integer('custom_field_id')->default(0)->index('idx_field_id');
|
||||
$table->integer('torrent_id')->default(0)->index();
|
||||
$table->integer('custom_field_id')->default(0)->index();
|
||||
$table->mediumText('custom_field_value')->nullable();
|
||||
$table->dateTime('created_at');
|
||||
$table->dateTime('updated_at');
|
||||
});
|
||||
if (\Nexus\Database\NexusDB::isMysql()) {
|
||||
\Illuminate\Support\Facades\DB::statement('alter table torrents_custom_field_values add index(custom_field_value(191))');
|
||||
} else if (Nexus\Database\NexusDB::isPgsql()) {
|
||||
\Illuminate\Support\Facades\DB::statement('alter table torrents_custom_field_values left(custom_field_value,191)');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ class CreateUserBanLogsTable extends Migration
|
||||
}
|
||||
Schema::create('user_ban_logs', function (Blueprint $table) {
|
||||
$table->bigInteger('id', true);
|
||||
$table->integer('uid')->default(0)->index('idx_uid');
|
||||
$table->string('username')->default('')->index('idx_username');
|
||||
$table->integer('uid')->default(0)->index();
|
||||
$table->string('username')->default('')->index();
|
||||
$table->integer('operator')->default(0);
|
||||
$table->string('reason')->nullable();
|
||||
$table->timestamp('created_at')->nullable()->useCurrent();
|
||||
|
||||
@@ -22,14 +22,14 @@ class CreateUsersTable extends Migration
|
||||
}
|
||||
Schema::create('users', function (Blueprint $table) use ($uidStarts) {
|
||||
$table->id('id')->startingValue($uidStarts);
|
||||
$table->string('username', 40)->default('')->unique('username');
|
||||
$table->string('username', 40)->default('')->unique();
|
||||
$table->string('passhash', 32)->default('');
|
||||
$table->binary('secret');
|
||||
$table->string('email', 80)->default('');
|
||||
$table->enum('status', ['pending', 'confirmed'])->default('pending');
|
||||
$table->dateTime('added')->nullable();
|
||||
$table->dateTime('last_login')->nullable();
|
||||
$table->dateTime('last_access')->nullable()->index('last_access');
|
||||
$table->dateTime('last_access')->nullable()->index();
|
||||
$table->dateTime('last_home')->nullable();
|
||||
$table->dateTime('last_offer')->nullable();
|
||||
$table->dateTime('forum_access')->nullable();
|
||||
@@ -48,25 +48,25 @@ class CreateUsersTable extends Migration
|
||||
$table->text('info')->nullable();
|
||||
$table->enum('acceptpms', ['yes', 'friends', 'no'])->default('yes');
|
||||
$table->enum('commentpm', ['yes', 'no'])->default('yes');
|
||||
$table->string('ip', 64)->default('')->index('ip');
|
||||
$table->unsignedTinyInteger('class')->default(1)->index('class');
|
||||
$table->string('ip', 64)->default('')->index();
|
||||
$table->unsignedTinyInteger('class')->default(1)->index();
|
||||
$table->tinyInteger('max_class_once')->default(1);
|
||||
$table->string('avatar')->default('');
|
||||
$table->unsignedBigInteger('uploaded')->default(0)->index('uploaded');
|
||||
$table->unsignedBigInteger('downloaded')->default(0)->index('downloaded');
|
||||
$table->unsignedBigInteger('uploaded')->default(0)->index();
|
||||
$table->unsignedBigInteger('downloaded')->default(0)->index();
|
||||
$table->unsignedBigInteger('seedtime')->default(0);
|
||||
$table->unsignedBigInteger('leechtime')->default(0);
|
||||
$table->string('title', 30)->default('');
|
||||
$table->unsignedSmallInteger('country')->default(107)->index('country');
|
||||
$table->unsignedSmallInteger('country')->default(107)->index();
|
||||
$table->string('notifs', 500)->nullable();
|
||||
$table->text('modcomment')->nullable();
|
||||
$table->enum('enabled', ['yes', 'no'])->default('yes')->index('enabled');
|
||||
$table->enum('enabled', ['yes', 'no'])->default('yes')->index();
|
||||
$table->enum('avatars', ['yes', 'no'])->default('yes');
|
||||
$table->enum('donor', ['yes', 'no'])->default('no');
|
||||
$table->decimal('donated')->default(0.00);
|
||||
$table->decimal('donated_cny')->default(0.00);
|
||||
$table->dateTime('donoruntil')->nullable();
|
||||
$table->enum('warned', ['yes', 'no'])->default('no')->index('warned');
|
||||
$table->enum('warned', ['yes', 'no'])->default('no')->index();
|
||||
$table->dateTime('warneduntil')->nullable();
|
||||
$table->enum('noad', ['yes', 'no'])->default('no');
|
||||
$table->dateTime('noaduntil')->nullable();
|
||||
@@ -84,7 +84,7 @@ class CreateUsersTable extends Migration
|
||||
$table->string('supportfor')->default('');
|
||||
$table->string('pickfor')->default('');
|
||||
$table->string('supportlang', 50)->default('');
|
||||
$table->string('passkey', 32)->default('')->index('passkey');
|
||||
$table->string('passkey', 32)->default('')->index();
|
||||
$table->string('promotion_link', 32)->nullable();
|
||||
$table->enum('uploadpos', ['yes', 'no'])->default('yes');
|
||||
$table->enum('forumpost', ['yes', 'no'])->default('yes');
|
||||
@@ -93,7 +93,7 @@ class CreateUsersTable extends Migration
|
||||
$table->enum('signatures', ['yes', 'no'])->default('yes');
|
||||
$table->string('signature', 800)->default('');
|
||||
$table->unsignedSmallInteger('lang')->default(6);
|
||||
$table->smallInteger('cheat')->default(0)->index('cheat');
|
||||
$table->smallInteger('cheat')->default(0)->index();
|
||||
$table->unsignedInteger('download')->default(0);
|
||||
$table->unsignedInteger('upload')->default(0);
|
||||
$table->unsignedTinyInteger('isp')->default(0);
|
||||
@@ -118,7 +118,7 @@ class CreateUsersTable extends Migration
|
||||
$table->enum('showdescription', ['yes', 'no'])->nullable()->default('yes');
|
||||
$table->enum('showcomment', ['yes', 'no'])->nullable()->default('yes');
|
||||
$table->enum('showclienterror', ['yes', 'no'])->default('no');
|
||||
$table->boolean('showdlnotice')->default(1);
|
||||
$table->smallInteger('showdlnotice')->default(1);
|
||||
$table->enum('tooltip', ['minorimdb', 'medianimdb', 'off'])->default('off');
|
||||
$table->enum('shownfo', ['yes', 'no'])->nullable()->default('yes');
|
||||
$table->enum('timetype', ['timeadded', 'timealive'])->nullable()->default('timealive');
|
||||
@@ -136,7 +136,7 @@ class CreateUsersTable extends Migration
|
||||
$table->unsignedSmallInteger('school')->default(35);
|
||||
$table->enum('showfb', ['yes', 'no'])->default('yes');
|
||||
$table->string('page')->nullable()->default('');
|
||||
$table->index(['status', 'added'], 'status_added');
|
||||
$table->index(['status', 'added']);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ return new class extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (\Nexus\Database\NexusDB::isPgsql()) {
|
||||
return;
|
||||
}
|
||||
$tableName = 'peers';
|
||||
$columnNames = ['torrent', 'peer_id'];
|
||||
// 1. 获取该表所有的索引信息
|
||||
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('searchbox', function (Blueprint $table) {
|
||||
$table->text('extra')->nullable();
|
||||
$table->json('extra')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ return new class extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('searchbox', function (Blueprint $table) {
|
||||
$table->json('extra')->nullable()->change();
|
||||
if (\Nexus\Database\NexusDB::isMysql()) {
|
||||
$table->json('extra')->nullable()->change();
|
||||
}
|
||||
$table->string('custom_fields_display_name')->nullable(true)->default('')->change();
|
||||
});
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ return new class extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (NexusDB::isPgsql()) {
|
||||
return;
|
||||
}
|
||||
$tableName = 'snatched';
|
||||
$columnNames = ['torrentid', 'userid'];
|
||||
// 1. 获取该表所有的索引信息
|
||||
|
||||
+5
-2
@@ -3,7 +3,7 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
@@ -14,10 +14,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (NexusDB::isPgsql()) {
|
||||
return;
|
||||
}
|
||||
$tableName = 'peers';
|
||||
$columnNames = ['torrent', 'peer_id', 'userid'];
|
||||
// 1. 获取该表所有的索引信息
|
||||
$indexesToDelete = \Nexus\Database\NexusDB::listColumnIndexNames($tableName, $columnNames);
|
||||
$indexesToDelete = NexusDB::listColumnIndexNames($tableName, $columnNames);
|
||||
|
||||
// 3. 执行删除操作
|
||||
Schema::table($tableName, function (Blueprint $table) use ($indexesToDelete) {
|
||||
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->decimal("seedbonus", 20, 1)->change();
|
||||
$table->decimal("seedbonus", 20, 1)->default(0)->change();
|
||||
});
|
||||
Schema::table('bonus_logs', function (Blueprint $table) {
|
||||
$table->decimal("old_total_value", 20, 1)->change();
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||
$table->boolean("skips_authorization")->default(false);
|
||||
$table->smallInteger("skips_authorization")->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ return new class extends Migration
|
||||
$table->string('email_claim')->nullable();
|
||||
$table->string('level_claim')->nullable();
|
||||
$table->string('level_limit')->nullable();
|
||||
$table->boolean('enabled');
|
||||
$table->smallInteger('enabled');
|
||||
$table->integer('priority');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user