change: MariaDB migration.

chores: Update dependencies.
add: IDE Helper.
master
WildEgo 2025-06-18 22:50:24 +01:00
parent bd124db2ed
commit 8057490475
106 changed files with 35060 additions and 7183 deletions

27760
_ide_helper.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -18,15 +18,12 @@ class RegisterController extends Controller
{ {
/** /**
* Get a validator for an incoming registration request. * Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Validation\Validator
*/ */
protected function validator(array $data): \Illuminate\Validation\Validator protected function validator(array $data): \Illuminate\Validation\Validator
{ {
return Validator::make($data, [ return Validator::make($data, [
'login' => ['required', 'string', 'min:5', 'max:16', 'unique:account.account'], 'login' => ['required', 'string', 'min:5', 'max:16', 'unique:account'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:account.account'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:account'],
'password' => ['required', 'string', 'min:5', 'max:16'], 'password' => ['required', 'string', 'min:5', 'max:16'],
'tac' => ['required'], 'tac' => ['required'],
]); ]);
@ -35,13 +32,11 @@ class RegisterController extends Controller
/** /**
* Create a new user instance after a valid registration. * Create a new user instance after a valid registration.
* *
* @param array $data
* @return Account
* @throws \Throwable * @throws \Throwable
*/ */
protected function create(array $data): Account protected function create(array $data): Account
{ {
$account = new Account(); $account = new Account;
$account->login = $data['login']; $account->login = $data['login'];
$account->email = $data['email']; $account->email = $data['email'];
$account->password = Hash::make($data['password']); $account->password = Hash::make($data['password']);
@ -54,8 +49,6 @@ class RegisterController extends Controller
/** /**
* Executes the registration logic on a validator input * Executes the registration logic on a validator input
* *
* @param \Illuminate\Validation\Validator $validator
* @return RedirectResponse
* @throws ValidationException * @throws ValidationException
* @throws \Throwable * @throws \Throwable
*/ */
@ -82,8 +75,6 @@ class RegisterController extends Controller
/** /**
* Show the application registration form. * Show the application registration form.
*
* @return View
*/ */
public function showRegistrationForm(): View public function showRegistrationForm(): View
{ {
@ -93,21 +84,18 @@ class RegisterController extends Controller
/** /**
* Handle a registration request for the application. * Handle a registration request for the application.
* *
* @param Request $request
* @return RedirectResponse
* @throws \Throwable * @throws \Throwable
*/ */
public function register(Request $request): RedirectResponse public function register(Request $request): RedirectResponse
{ {
$validator = $this->validator($request->all()); $validator = $this->validator($request->all());
return $this->runRegistrationLogic($validator); return $this->runRegistrationLogic($validator);
} }
/** /**
* Handle a registration request for the application. * Handle a registration request for the application.
* *
* @param Request $request
* @return RedirectResponse
* @throws \Throwable * @throws \Throwable
*/ */
public function registerFromHeader(Request $request): RedirectResponse public function registerFromHeader(Request $request): RedirectResponse

View File

@ -14,13 +14,6 @@ class Account extends User implements MustVerifyEmail
{ {
use HasApiTokens, HasFactory, Notifiable; use HasApiTokens, HasFactory, Notifiable;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'account';
/** /**
* The table associated with the model. * The table associated with the model.
* *
@ -60,7 +53,7 @@ class Account extends User implements MustVerifyEmail
protected $hidden = [ protected $hidden = [
'password', 'password',
'social_id', 'social_id',
'securitycode' 'securitycode',
]; ];
/** /**
@ -70,13 +63,11 @@ class Account extends User implements MustVerifyEmail
*/ */
protected $casts = [ protected $casts = [
'email_verified_at' => 'datetime', 'email_verified_at' => 'datetime',
'status' => AccountStatusEnum::class 'status' => AccountStatusEnum::class,
]; ];
/** /**
* Determine if the user has verified their email address. * Determine if the user has verified their email address.
*
* @return bool
*/ */
public function hasVerifiedEmail(): bool public function hasVerifiedEmail(): bool
{ {
@ -85,8 +76,6 @@ class Account extends User implements MustVerifyEmail
/** /**
* Mark the given user's email as verified. * Mark the given user's email as verified.
*
* @return bool
*/ */
public function markEmailAsVerified(): bool public function markEmailAsVerified(): bool
{ {
@ -97,8 +86,6 @@ class Account extends User implements MustVerifyEmail
/** /**
* Send the email verification notification. * Send the email verification notification.
*
* @return void
*/ */
public function sendEmailVerificationNotification(): void public function sendEmailVerificationNotification(): void
{ {
@ -107,8 +94,6 @@ class Account extends User implements MustVerifyEmail
/** /**
* Get the email address that should be used for verification. * Get the email address that should be used for verification.
*
* @return string
*/ */
public function getEmailForVerification(): string public function getEmailForVerification(): string
{ {

View File

@ -13,13 +13,6 @@ class Locale extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'common';
/** /**
* The table associated with the model. * The table associated with the model.
* *
@ -40,7 +33,7 @@ class Locale extends Model
* @var array<int, string> * @var array<int, string>
*/ */
protected $fillable = [ protected $fillable = [
'mKey', 'mValue' 'mKey', 'mValue',
]; ];
/** /**

View File

@ -14,13 +14,6 @@ class GuildHighscoreCache extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'website';
/** /**
* The table associated with the model. * The table associated with the model.
* *
@ -60,6 +53,6 @@ class GuildHighscoreCache extends Model
*/ */
protected $casts = [ protected $casts = [
'empire' => EmpireEnum::class, 'empire' => EmpireEnum::class,
'date' => 'datetime' 'date' => 'datetime',
]; ];
} }

View File

@ -15,13 +15,6 @@ class HighscoreCache extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'website';
/** /**
* The table associated with the model. * The table associated with the model.
* *
@ -62,6 +55,6 @@ class HighscoreCache extends Model
protected $casts = [ protected $casts = [
'job' => CharacterClassEnum::class, 'job' => CharacterClassEnum::class,
'empire' => EmpireEnum::class, 'empire' => EmpireEnum::class,
'date' => 'datetime' 'date' => 'datetime',
]; ];
} }

View File

@ -13,13 +13,6 @@ class Banword extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *
@ -40,7 +33,7 @@ class Banword extends Model
* @var array<int, string> * @var array<int, string>
*/ */
protected $fillable = [ protected $fillable = [
'word' 'word',
]; ];
/** /**

View File

@ -13,13 +13,6 @@ class ItemAttr extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class ItemAttrRare extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class ItemProto extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class Land extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class ObjectProto extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -18,13 +18,6 @@ class Player extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -3,7 +3,6 @@
namespace App\Models\Game\Player; namespace App\Models\Game\Player;
use App\Models\Account; use App\Models\Account;
use App\Models\Enums\CharacterJobEnum;
use App\Models\Enums\EmpireEnum; use App\Models\Enums\EmpireEnum;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
@ -17,13 +16,6 @@ class PlayerIndex extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class RefineProto extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class Shop extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class ShopItem extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -13,13 +13,6 @@ class SkillProto extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'player';
/** /**
* The table associated with the model. * The table associated with the model.
* *

View File

@ -14,13 +14,6 @@ class MallCategory extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'website';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
@ -50,8 +43,6 @@ class MallCategory extends Model
/** /**
* Get the items in this category * Get the items in this category
*
* @return HasMany
*/ */
public function items(): HasMany public function items(): HasMany
{ {

View File

@ -17,13 +17,6 @@ class MallItem extends Model
*/ */
public $timestamps = false; public $timestamps = false;
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'website';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
@ -61,46 +54,45 @@ class MallItem extends Model
/** /**
* Get the associated item_proto entry * Get the associated item_proto entry
*
* @return HasOne
*/ */
public function proto(): HasOne public function proto(): HasOne
{ {
return $this->hasOne(ItemProto::class, 'vnum', 'vnum'); return $this->hasOne(ItemProto::class, 'vnum', 'vnum');
} }
/**
* @return bool
*/
public function userCanBuy(): bool public function userCanBuy(): bool
{ {
$user = Auth::user(); $user = Auth::user();
if ($this->pricing == MallItemPricingEnum::CASH) if ($this->pricing == MallItemPricingEnum::CASH) {
return $user->cash >= $this->price; return $user->cash >= $this->price;
elseif ($this->pricing == MallItemPricingEnum::MILEAGE) } elseif ($this->pricing == MallItemPricingEnum::MILEAGE) {
return $user->mileage >= $this->price; return $user->mileage >= $this->price;
}
return false; return false;
} }
public static function getSuggestions(int $maxCount, MallItem $forItem = null, string $frontpageDisplay = null) public static function getSuggestions(int $maxCount, ?MallItem $forItem = null, ?string $frontpageDisplay = null)
{ {
$query = MallItem::query(); $query = MallItem::query();
// Ignore the current item if specified // Ignore the current item if specified
if ($forItem) if ($forItem) {
$query = $query->whereNotIn('vnum', [$forItem->vnum]); $query = $query->whereNotIn('vnum', [$forItem->vnum]);
}
// Select items that are to be shown on the frontpage // Select items that are to be shown on the frontpage
if ($frontpageDisplay) if ($frontpageDisplay) {
$query = $query->where('other', $frontpageDisplay); $query = $query->where('other', $frontpageDisplay);
}
$items = $query->get(); $items = $query->get();
// Just return what we selected if we don't have enough items in the database // Just return what we selected if we don't have enough items in the database
if ($items->count() <= $maxCount) if ($items->count() <= $maxCount) {
return $items; return $items;
}
return $items->random($maxCount); return $items->random($maxCount);
} }

View File

@ -2,8 +2,6 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
@ -14,11 +12,7 @@ class EventServiceProvider extends ServiceProvider
* *
* @var array<class-string, array<int, class-string>> * @var array<class-string, array<int, class-string>>
*/ */
protected $listen = [ protected $listen = [];
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/** /**
* Register any events for your application. * Register any events for your application.

View File

@ -15,6 +15,7 @@
"laravel/tinker": "^2.8" "laravel/tinker": "^2.8"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-ide-helper": "^3.5",
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^7.0", "kitloong/laravel-migrations-generator": "^7.0",
"laravel/pint": "^1.0", "laravel/pint": "^1.0",

1561
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@ return [
| |
*/ */
'default' => env('DB_CONNECTION', 'website'), 'default' => env('DB_CONNECTION', 'mariadb'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -35,55 +35,11 @@ return [
'connections' => [ 'connections' => [
'website' => [ 'mariadb' => [
'driver' => 'mysql', 'driver' => 'mariadb',
'host' => env('DB_HOST', '127.0.0.1'), 'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'), 'port' => env('DB_PORT', '3306'),
'database' => 'website', 'database' => env('DB_DATABASE', 'metin2'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'account' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => 'account',
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'common' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => 'common',
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'log' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => 'log',
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'player' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => 'player',
'username' => env('DB_USERNAME', 'forge'), 'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('account')->create('account', function (Blueprint $table) {
$table->integer('id', true);
$table->string('login', 30)->default('')->unique('login');
$table->text('password')->default('');
$table->string('social_id', 13)->default('')->index('social_id');
$table->string('email', 64)->default('');
$table->dateTime('create_time')->default('0000-00-00 00:00:00');
$table->string('status', 8)->default('OK');
$table->string('securitycode', 192)->nullable()->default('');
$table->dateTime('availDt')->default('0000-00-00 00:00:00');
$table->integer('mileage')->default(0);
$table->integer('cash')->default(0);
$table->dateTime('gold_expire')->default('0000-00-00 00:00:00');
$table->dateTime('silver_expire')->default('0000-00-00 00:00:00');
$table->dateTime('safebox_expire')->default('0000-00-00 00:00:00');
$table->dateTime('autoloot_expire')->default('0000-00-00 00:00:00');
$table->dateTime('fish_mind_expire')->default('0000-00-00 00:00:00');
$table->dateTime('marriage_fast_expire')->default('0000-00-00 00:00:00');
$table->dateTime('money_drop_rate_expire')->default('0000-00-00 00:00:00');
$table->string('ip')->nullable();
$table->dateTime('last_play');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('account')->dropIfExists('account');
}
};

View File

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('log')->create('cube', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('pid')->default(0)->index('pid');
$table->dateTime('time')->default('0000-00-00 00:00:00');
$table->unsignedInteger('x')->default(0);
$table->unsignedInteger('y')->default(0);
$table->unsignedInteger('item_vnum')->default(0)->index('item_vnum');
$table->unsignedInteger('item_uid')->default(0)->index('item_uid');
$table->unsignedInteger('item_count')->default(0);
$table->boolean('success')->default(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('log')->dropIfExists('cube');
}
};

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('log')->create('hack_crc_log', function (Blueprint $table) {
$table->dateTime('time')->default('0000-00-00 00:00:00');
$table->char('login', 16)->default('');
$table->char('name', 24)->default('');
$table->char('ip', 15)->default('');
$table->char('server', 100)->default('');
$table->char('why')->default('');
$table->integer('crc')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('log')->dropIfExists('hack_crc_log');
}
};

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('log')->create('hack_log', function (Blueprint $table) {
$table->dateTime('time')->default('0000-00-00 00:00:00');
$table->char('login', 16)->default('');
$table->char('name', 24)->default('');
$table->char('ip', 15)->default('');
$table->char('server', 100)->default('');
$table->char('why')->default('');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('log')->dropIfExists('hack_log');
}
};

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('log')->create('hackshield_log', function (Blueprint $table) {
$table->unsignedInteger('pid')->default(0);
$table->string('login', 32)->nullable();
$table->unsignedInteger('account_id');
$table->string('name', 25)->nullable();
$table->dateTime('time')->default('0000-00-00 00:00:00');
$table->string('reason', 25)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('log')->dropIfExists('hackshield_log');
}
};

View File

@ -1,39 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('log')->create('loginlog', function (Blueprint $table) {
$table->enum('type', ['LOGIN', 'LOGOUT'])->nullable();
$table->dateTime('time')->nullable();
$table->tinyInteger('channel')->nullable();
$table->unsignedInteger('account_id')->nullable();
$table->unsignedInteger('pid')->nullable();
$table->smallInteger('level')->nullable();
$table->tinyInteger('job')->nullable();
$table->unsignedInteger('playtime')->nullable();
$table->index(['pid', 'type'], 'pid');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('log')->dropIfExists('loginlog');
}
};

View File

@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('log')->create('playercount', function (Blueprint $table) {
$table->dateTime('date')->nullable();
$table->integer('count_red')->nullable();
$table->integer('count_yellow')->nullable();
$table->integer('count_blue')->nullable();
$table->integer('count_total')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('log')->dropIfExists('playercount');
}
};

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('player')->create('guild_war_bet', function (Blueprint $table) {
$table->string('login', 24)->default('');
$table->unsignedInteger('gold')->default(0);
$table->integer('guild')->default(0);
$table->unsignedInteger('war_id')->default(0);
$table->primary(['war_id', 'login']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('player')->dropIfExists('guild_war_bet');
}
};

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('player')->create('monarch_election', function (Blueprint $table) {
$table->unsignedInteger('pid')->default(0)->primary();
$table->unsignedInteger('selectedpid')->nullable()->default(0);
$table->dateTime('electiondata')->nullable()->default('0000-00-00 00:00:00');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('player')->dropIfExists('monarch_election');
}
};

View File

@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('player')->create('monarch', function (Blueprint $table) {
$table->unsignedInteger('empire')->default(0)->primary();
$table->unsignedInteger('pid')->nullable();
$table->dateTime('windate')->nullable();
$table->unsignedBigInteger('money')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('player')->dropIfExists('monarch');
}
};

View File

@ -1,39 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('player')->create('object', function (Blueprint $table) {
$table->integer('id', true);
$table->integer('land_id')->default(0);
$table->unsignedInteger('vnum')->default(0);
$table->integer('map_index')->default(0);
$table->integer('x')->default(0);
$table->integer('y')->default(0);
$table->float('x_rot', null, 0)->default(0);
$table->float('y_rot', null, 0)->default(0);
$table->float('z_rot', null, 0)->default(0);
$table->integer('life')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('player')->dropIfExists('object');
}
};

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('player')->create('player_index', function (Blueprint $table) {
$table->integer('id')->default(0)->primary();
$table->integer('pid1')->default(0)->index('pid1_key');
$table->integer('pid2')->default(0)->index('pid2_key');
$table->integer('pid3')->default(0)->index('pid3_key');
$table->integer('pid4')->default(0)->index('pid4_key');
$table->tinyInteger('empire')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('player')->dropIfExists('player_index');
}
};

View File

@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('account', function (Blueprint $table) {
$table->unsignedInteger('id', true)->primary();
$table->string('login', 30)->unique('login');
$table->text('password');
$table->string('social_id', 13)->default('')->index('social_id');
$table->string('email', 64);
$table->dateTime('create_time')->useCurrent();
$table->string('status', 8)->default('OK');
$table->string('securitycode', 192)->nullable();
$table->dateTime('availDt')->useCurrent();
$table->integer('mileage')->default(0);
$table->integer('cash')->default(0);
$table->dateTime('gold_expire')->useCurrent();
$table->dateTime('silver_expire')->useCurrent();
$table->dateTime('safebox_expire')->useCurrent();
$table->dateTime('autoloot_expire')->useCurrent();
$table->dateTime('fish_mind_expire')->useCurrent();
$table->dateTime('marriage_fast_expire')->useCurrent();
$table->dateTime('money_drop_rate_expire')->useCurrent();
$table->string('ip')->nullable();
$table->dateTime('last_play')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('account');
}
};

View File

@ -13,12 +13,12 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('player', function (Blueprint $table) { Schema::create('player', function (Blueprint $table) {
$table->integer('id', true); $table->unsignedInteger('id', true)->primary();
$table->integer('account_id')->default(0)->index('account_id_idx'); $table->unsignedInteger('account_id');
$table->string('name', 24)->default('NONAME')->index('name_idx'); $table->string('name', 24)->default('Noname')->index('name_idx');
$table->unsignedTinyInteger('job')->default(0); $table->unsignedTinyInteger('job');
$table->boolean('voice')->unsigned()->default(false); $table->boolean('voice')->default(false);
$table->tinyInteger('dir')->default(0); $table->tinyInteger('dir')->default(0);
$table->integer('x')->default(0); $table->integer('x')->default(0);
$table->integer('y')->default(0); $table->integer('y')->default(0);
@ -51,7 +51,7 @@ return new class extends Migration
$table->tinyInteger('skill_group')->default(0); $table->tinyInteger('skill_group')->default(0);
$table->binary('skill_level')->nullable(); $table->binary('skill_level')->nullable();
$table->integer('alignment')->default(0); $table->integer('alignment')->default(0);
$table->dateTime('last_play')->default('0000-00-00 00:00:00'); $table->dateTime('last_play')->useCurrent();
$table->boolean('change_name')->default(false); $table->boolean('change_name')->default(false);
$table->smallInteger('sub_skill_point')->default(0); $table->smallInteger('sub_skill_point')->default(0);
$table->tinyInteger('stat_reset_count')->default(0); $table->tinyInteger('stat_reset_count')->default(0);
@ -62,6 +62,8 @@ return new class extends Migration
$table->boolean('horse_riding')->default(false); $table->boolean('horse_riding')->default(false);
$table->smallInteger('horse_skill_point')->default(0); $table->smallInteger('horse_skill_point')->default(0);
$table->integer('bank_value')->default(0); $table->integer('bank_value')->default(0);
$table->foreign('account_id')->references('id')->on('account');
}); });
} }
@ -72,6 +74,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('player'); Schema::dropIfExists('player');
} }
}; };

View File

@ -13,15 +13,15 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('guild', function (Blueprint $table) { Schema::create('guild', function (Blueprint $table) {
$table->increments('id'); $table->unsignedInteger('id', true)->primary();
$table->string('name', 12)->default(''); $table->string('name', 12);
$table->smallInteger('sp')->default(1000); $table->smallInteger('sp')->default(1000);
$table->unsignedInteger('master')->default(0); $table->unsignedInteger('master')->default(0);
$table->tinyInteger('level')->nullable(); $table->tinyInteger('level');
$table->integer('exp')->nullable(); $table->integer('exp');
$table->tinyInteger('skill_point')->default(0); $table->tinyInteger('skill_point')->default(0);
$table->binary('skill')->nullable(); $table->binary('skill');
$table->integer('win')->default(0); $table->integer('win')->default(0);
$table->integer('draw')->default(0); $table->integer('draw')->default(0);
$table->integer('loss')->default(0); $table->integer('loss')->default(0);
@ -37,6 +37,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('guild'); Schema::dropIfExists('guild');
} }
}; };

View File

@ -13,7 +13,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('affect', function (Blueprint $table) { // TODO Check dwPID as it's the only one that might be related to something
Schema::create('affect', function (Blueprint $table) {
$table->unsignedInteger('dwPID')->default(0); $table->unsignedInteger('dwPID')->default(0);
$table->unsignedSmallInteger('bType')->default(0); $table->unsignedSmallInteger('bType')->default(0);
$table->unsignedTinyInteger('bApplyOn')->default(0); $table->unsignedTinyInteger('bApplyOn')->default(0);
@ -33,6 +34,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('affect'); Schema::dropIfExists('affect');
} }
}; };

View File

@ -14,8 +14,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('banword', function (Blueprint $table) { Schema::create('banword', function (Blueprint $table) {
$table->binary('word', length: 24)->default('')->primary(); $table->binary('word', length: 24)->primary();
}); });
// Populate the table data // Populate the table data
@ -30,6 +30,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('banword'); Schema::dropIfExists('banword');
} }
}; };

View File

@ -13,8 +13,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('bootlog', function (Blueprint $table) { Schema::create('bootlog', function (Blueprint $table) {
$table->dateTime('time')->default('0000-00-00 00:00:00'); $table->dateTime('time')->useCurrent();
$table->char('hostname', 128)->default('UNKNOWN'); $table->char('hostname', 128)->default('UNKNOWN');
$table->boolean('channel')->default(false); $table->boolean('channel')->default(false);
}); });
@ -27,6 +27,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('bootlog'); Schema::dropIfExists('bootlog');
} }
}; };

View File

@ -13,10 +13,12 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('change_empire', function (Blueprint $table) { Schema::create('change_empire', function (Blueprint $table) {
$table->integer('account_id')->default(0)->primary(); $table->unsignedInteger('account_id');
$table->tinyInteger('change_count')->nullable(); $table->tinyInteger('change_count')->nullable();
$table->dateTime('timestamp')->nullable(); $table->dateTime('timestamp')->nullable();
$table->foreign('account_id')->references('id')->on('account');
}); });
} }
@ -27,6 +29,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('change_empire'); Schema::dropIfExists('change_empire');
} }
}; };

View File

@ -13,12 +13,14 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('change_name', function (Blueprint $table) { Schema::create('change_name', function (Blueprint $table) {
$table->integer('pid')->nullable(); $table->unsignedInteger('pid');
$table->string('old_name')->nullable(); $table->string('old_name')->nullable();
$table->string('new_name')->nullable(); $table->string('new_name')->nullable();
$table->dateTime('time')->nullable(); $table->dateTime('time')->nullable();
$table->string('ip', 20)->nullable(); $table->string('ip', 20)->nullable();
$table->foreign('pid')->references('id')->on('player');
}); });
} }
@ -29,6 +31,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('change_name'); Schema::dropIfExists('change_name');
} }
}; };

View File

@ -13,15 +13,17 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('command_log', function (Blueprint $table) { Schema::create('command_log', function (Blueprint $table) {
$table->integer('id', true); $table->unsignedInteger('id', true)->primary();
$table->integer('userid')->default(0); $table->unsignedInteger('userid');
$table->integer('server')->default(0); $table->integer('server');
$table->string('ip', 15)->default(''); $table->string('ip', 15);
$table->integer('port')->default(0); $table->integer('port')->default(0);
$table->string('username', 50)->default(''); $table->string('username', 50);
$table->text('command'); $table->text('command');
$table->dateTime('date')->default('0000-00-00 00:00:00'); $table->dateTime('date')->useCurrent();
$table->foreign('userid')->references('id')->on('player');
}); });
} }
@ -32,6 +34,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('command_log'); Schema::dropIfExists('command_log');
} }
}; };

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cube', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('pid');
$table->dateTime('time')->useCurrent();
$table->unsignedInteger('x');
$table->unsignedInteger('y');
// Can't reference due to item_proto being reloaded
$table->unsignedInteger('item_vnum')->index('item_vnum');
$table->unsignedInteger('item_uid')->index('item_uid');
$table->unsignedInteger('item_count');
$table->boolean('success')->default(false);
$table->foreign('pid')->references('id')->on('player');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cube');
}
};

View File

@ -13,11 +13,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('dragon_slay_log', function (Blueprint $table) { Schema::create('dragon_slay_log', function (Blueprint $table) {
$table->unsignedInteger('guild_id'); $table->unsignedInteger('guild_id');
$table->unsignedInteger('vnum'); $table->unsignedInteger('vnum');
$table->timestamp('start_time')->default('0000-00-00 00:00:00'); $table->timestamp('start_time')->useCurrent();
$table->timestamp('end_time')->default('0000-00-00 00:00:00'); $table->timestamp('end_time')->useCurrent();
$table->foreign('guild_id')->references('id')->on('guild');
}); });
} }
@ -28,6 +30,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('dragon_slay_log'); Schema::dropIfExists('dragon_slay_log');
} }
}; };

View File

@ -13,15 +13,17 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('fish_log', function (Blueprint $table) { Schema::create('fish_log', function (Blueprint $table) {
$table->dateTime('time')->default('0000-00-00 00:00:00'); $table->dateTime('time')->useCurrent();
$table->unsignedInteger('player_id')->default(0); $table->unsignedInteger('player_id');
$table->tinyInteger('map_index')->default(0); $table->tinyInteger('map_index')->default(0);
$table->unsignedInteger('fish_id')->default(0); $table->unsignedInteger('fish_id')->index('fish_id');
$table->integer('fishing_level')->default(0); $table->integer('fishing_level');
$table->integer('waiting_time')->default(0); $table->integer('waiting_time');
$table->tinyInteger('success')->default(0); $table->boolean('success')->default(false);
$table->smallInteger('size')->default(0); $table->smallInteger('size')->default(0);
$table->foreign('player_id')->references('id')->on('player');
}); });
} }
@ -32,6 +34,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('fish_log'); Schema::dropIfExists('fish_log');
} }
}; };

View File

@ -13,8 +13,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('common')->create('gmhost', function (Blueprint $table) { Schema::create('gmhost', function (Blueprint $table) {
$table->string('mIP', 16)->default(''); $table->string('mIP', 16);
}); });
} }
@ -25,6 +25,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('common')->dropIfExists('gmhost'); Schema::dropIfExists('gmhost');
} }
}; };

View File

@ -13,13 +13,16 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('common')->create('gmlist', function (Blueprint $table) { Schema::create('gmlist', function (Blueprint $table) {
$table->increments('mID'); $table->increments('mID');
$table->string('mAccount', 32)->default(''); $table->string('mAccount', 30);
$table->string('mName', 32)->default(''); $table->string('mName', 32);
$table->string('mContactIP', 16)->default(''); $table->string('mContactIP', 16)->default('0.0.0.0');
$table->string('mServerIP', 16)->default('ALL'); $table->string('mServerIP', 16)->default('ALL');
$table->enum('mAuthority', ['IMPLEMENTOR', 'HIGH_WIZARD', 'GOD', 'LOW_WIZARD', 'PLAYER'])->nullable()->default('PLAYER'); $table->enum('mAuthority', ['IMPLEMENTOR', 'HIGH_WIZARD', 'GOD', 'LOW_WIZARD', 'PLAYER'])->nullable()->default('PLAYER');
$table->foreign('mAccount')->references('login')->on('account');
$table->foreign('mName')->references('name')->on('player')->cascadeOnUpdate();
}); });
} }
@ -30,6 +33,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('common')->dropIfExists('gmlist'); Schema::dropIfExists('gmlist');
} }
}; };

View File

@ -13,13 +13,16 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('goldlog', function (Blueprint $table) { Schema::create('goldlog', function (Blueprint $table) {
// TODO Using strings here is weird
$table->string('date', 10)->default('0000-00-00')->index('date_idx'); $table->string('date', 10)->default('0000-00-00')->index('date_idx');
$table->string('time', 8)->default('00:00:00'); $table->string('time', 8)->default('00:00:00');
$table->unsignedInteger('pid')->default(0)->index('pid_idx'); $table->unsignedInteger('pid');
$table->integer('what')->default(0)->index('what_idx'); $table->integer('what')->index('what_idx');
$table->set('how', ['BUY', 'SELL', 'SHOP_SELL', 'SHOP_BUY', 'EXCHANGE_TAKE', 'EXCHANGE_GIVE', 'QUEST'])->nullable()->index('how_idx'); $table->set('how', ['BUY', 'SELL', 'SHOP_SELL', 'SHOP_BUY', 'EXCHANGE_TAKE', 'EXCHANGE_GIVE', 'QUEST'])->nullable()->index('how_idx');
$table->string('hint', 50)->nullable(); $table->string('hint', 50)->nullable();
$table->foreign('pid')->references('id')->on('player');
}); });
} }
@ -30,6 +33,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('goldlog'); Schema::dropIfExists('goldlog');
} }
}; };

View File

@ -13,15 +13,17 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('guild_comment', function (Blueprint $table) { // TODO Source doesn't seem like it is working
$table->integer('id', true); Schema::create('guild_comment', function (Blueprint $table) {
$table->unsignedInteger('guild_id')->nullable()->index('guild_id'); $table->unsignedInteger('id', true)->primary();
$table->unsignedInteger('guild_id');
$table->string('name', 8)->nullable(); $table->string('name', 8)->nullable();
$table->tinyInteger('notice')->nullable(); $table->tinyInteger('notice')->nullable();
$table->string('content', 50)->nullable(); $table->string('content', 50)->nullable();
$table->dateTime('time')->nullable(); $table->dateTime('time')->nullable();
$table->index(['notice', 'id', 'guild_id'], 'aaa'); $table->index(['notice', 'id', 'guild_id'], 'aaa');
$table->foreign('guild_id')->references('id')->on('guild');
}); });
} }
@ -32,6 +34,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('guild_comment'); Schema::dropIfExists('guild_comment');
} }
}; };

View File

@ -13,13 +13,14 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('guild_grade', function (Blueprint $table) { Schema::create('guild_grade', function (Blueprint $table) {
$table->integer('guild_id')->default(0); $table->unsignedInteger('guild_id');
$table->tinyInteger('grade')->default(0); $table->tinyInteger('grade');
$table->string('name', 8)->default(''); $table->string('name', 8);
$table->set('auth', ['ADD_MEMBER', 'REMOVE_MEMEBER', 'NOTICE', 'USE_SKILL'])->nullable(); $table->set('auth', ['ADD_MEMBER', 'REMOVE_MEMEBER', 'NOTICE', 'USE_SKILL'])->nullable();
$table->primary(['guild_id', 'grade']); $table->primary(['guild_id', 'grade']);
$table->foreign('guild_id')->references('id')->on('guild');
}); });
} }
@ -30,6 +31,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('guild_grade'); Schema::dropIfExists('guild_grade');
} }
}; };

View File

@ -11,8 +11,8 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::connection('website')->create('guild_highscore_cache', function (Blueprint $table) { Schema::create('guild_highscore_cache', function (Blueprint $table) {
$table->bigInteger('id', true); $table->id();
$table->text('name'); $table->text('name');
$table->text('master'); $table->text('master');
$table->integer('empire'); $table->integer('empire');
@ -27,6 +27,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::connection('website')->dropIfExists('guild_highscore_cache'); Schema::dropIfExists('guild_highscore_cache');
} }
}; };

View File

@ -13,14 +13,16 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('guild_member', function (Blueprint $table) { Schema::create('guild_member', function (Blueprint $table) {
$table->unsignedInteger('pid')->default(0)->unique('pid'); $table->unsignedInteger('pid');
$table->unsignedInteger('guild_id')->default(0); $table->unsignedInteger('guild_id');
$table->tinyInteger('grade')->nullable(); $table->tinyInteger('grade');
$table->boolean('is_general')->default(false); $table->boolean('is_general')->default(false);
$table->unsignedInteger('offer')->nullable(); $table->unsignedInteger('offer');
$table->primary(['guild_id', 'pid']); $table->primary(['guild_id', 'pid']);
$table->foreign('pid')->references('id')->on('player');
$table->foreign('guild_id')->references('id')->on('guild');
}); });
} }
@ -31,6 +33,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('guild_member'); Schema::dropIfExists('guild_member');
} }
}; };

View File

@ -13,9 +13,10 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('guild_war', function (Blueprint $table) { // TODO Check
$table->integer('id_from')->default(0); Schema::create('guild_war', function (Blueprint $table) {
$table->integer('id_to')->default(0); $table->unsignedInteger('id_from')->default(0);
$table->unsignedInteger('id_to')->default(0);
$table->primary(['id_from', 'id_to']); $table->primary(['id_from', 'id_to']);
}); });
@ -28,6 +29,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('guild_war'); Schema::dropIfExists('guild_war');
} }
}; };

View File

@ -13,11 +13,11 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('guild_war_reservation', function (Blueprint $table) { Schema::create('guild_war_reservation', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->unsignedInteger('guild1')->default(0); $table->unsignedInteger('guild1');
$table->unsignedInteger('guild2')->default(0); $table->unsignedInteger('guild2');
$table->dateTime('time')->default('0000-00-00 00:00:00'); $table->dateTime('time')->useCurrent();
$table->unsignedTinyInteger('type')->default(0); $table->unsignedTinyInteger('type')->default(0);
$table->unsignedInteger('warprice')->default(0); $table->unsignedInteger('warprice')->default(0);
$table->unsignedInteger('initscore')->default(0); $table->unsignedInteger('initscore')->default(0);
@ -30,6 +30,9 @@ return new class extends Migration
$table->integer('handicap')->default(0); $table->integer('handicap')->default(0);
$table->integer('result1')->default(0); $table->integer('result1')->default(0);
$table->integer('result2')->default(0); $table->integer('result2')->default(0);
$table->foreign('guild1')->references('id')->on('guild');
$table->foreign('guild2')->references('id')->on('guild');
}); });
} }
@ -40,6 +43,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('guild_war_reservation'); Schema::dropIfExists('guild_war_reservation');
} }
}; };

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('guild_war_bet', function (Blueprint $table) {
$table->string('login', 30);
$table->unsignedInteger('gold');
$table->unsignedInteger('guild');
$table->unsignedInteger('war_id');
$table->primary(['war_id', 'login']);
$table->foreign('login')->references('login')->on('account');
$table->foreign('guild')->references('id')->on('guild');
$table->foreign('war_id')->references('id')->on('guild_war_reservation');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('guild_war_bet');
}
};

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('hack_log', function (Blueprint $table) {
$table->dateTime('time')->useCurrent();
$table->string('login', 30);
$table->string('name', 24);
$table->string('ip', 15);
$table->string('server', 100);
$table->string('why')->default('');
$table->foreign('login')->references('login')->on('account');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('hack_log');
}
};

View File

@ -11,8 +11,8 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::connection('website')->create('highscore_cache', function (Blueprint $table) { Schema::create('highscore_cache', function (Blueprint $table) {
$table->bigInteger('id', true); $table->id();
$table->text('name'); $table->text('name');
$table->integer('job'); $table->integer('job');
$table->integer('empire'); $table->integer('empire');
@ -27,6 +27,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::connection('website')->dropIfExists('highscore_cache'); Schema::dropIfExists('highscore_cache');
} }
}; };

View File

@ -13,9 +13,11 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('horse_name', function (Blueprint $table) { Schema::create('horse_name', function (Blueprint $table) {
$table->integer('id')->default(0)->primary(); $table->unsignedInteger('id');
$table->string('name', 24)->default('NONAME'); $table->string('name', 24)->default('Noname');
$table->foreign('id')->references('id')->on('player');
}); });
} }
@ -26,6 +28,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('horse_name'); Schema::dropIfExists('horse_name');
} }
}; };

View File

@ -14,22 +14,22 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('item_attr_rare', function (Blueprint $table) { Schema::create('item_attr_rare', function (Blueprint $table) {
$table->enum('apply', ['MAX_HP', 'MAX_SP', 'CON', 'INT', 'STR', 'DEX', 'ATT_SPEED', 'MOV_SPEED', 'CAST_SPEED', 'HP_REGEN', 'SP_REGEN', 'POISON_PCT', 'STUN_PCT', 'SLOW_PCT', 'CRITICAL_PCT', 'PENETRATE_PCT', 'ATTBONUS_HUMAN', 'ATTBONUS_ANIMAL', 'ATTBONUS_ORC', 'ATTBONUS_MILGYO', 'ATTBONUS_UNDEAD', 'ATTBONUS_DEVIL', 'STEAL_HP', 'STEAL_SP', 'MANA_BURN_PCT', 'DAMAGE_SP_RECOVER', 'BLOCK', 'DODGE', 'RESIST_SWORD', 'RESIST_TWOHAND', 'RESIST_DAGGER', 'RESIST_BELL', 'RESIST_FAN', 'RESIST_BOW', 'RESIST_FIRE', 'RESIST_ELEC', 'RESIST_MAGIC', 'RESIST_WIND', 'REFLECT_MELEE', 'REFLECT_CURSE', 'POISON_REDUCE', 'KILL_SP_RECOVER', 'EXP_DOUBLE_BONUS', 'GOLD_DOUBLE_BONUS', 'ITEM_DROP_BONUS', 'POTION_BONUS', 'KILL_HP_RECOVER', 'IMMUNE_STUN', 'IMMUNE_SLOW', 'IMMUNE_FALL', 'SKILL', 'BOW_DISTANCE', 'ATT_GRADE_BONUS', 'DEF_GRADE_BONUS', 'MAGIC_ATT_GRADE', 'MAGIC_DEF_GRADE', 'CURSE_PCT', 'MAX_STAMINA', 'ATT_BONUS_TO_WARRIOR', 'ATT_BONUS_TO_ASSASSIN', 'ATT_BONUS_TO_SURA', 'ATT_BONUS_TO_SHAMAN', 'ATT_BONUS_TO_MONSTER', 'NORMAL_HIT_DEFEND_BONUS', 'SKILL_DEFEND_BONUS', 'NOUSE2\'\'NOUSE3', 'NOUSE4', 'NOUSE5', 'NOUSE6', 'NOUSE7', 'NOUSE8', 'NOUSE9', 'NOUSE10', 'NOUSE11', 'NOUSE12', 'NOUSE13', 'NOUSE14', 'RESIST_WARRIOR', 'RESIST_ASSASSIN', 'RESIST_SURA', 'RESIST_SHAMAN'])->default('MAX_HP'); $table->enum('apply', ['MAX_HP', 'MAX_SP', 'CON', 'INT', 'STR', 'DEX', 'ATT_SPEED', 'MOV_SPEED', 'CAST_SPEED', 'HP_REGEN', 'SP_REGEN', 'POISON_PCT', 'STUN_PCT', 'SLOW_PCT', 'CRITICAL_PCT', 'PENETRATE_PCT', 'ATTBONUS_HUMAN', 'ATTBONUS_ANIMAL', 'ATTBONUS_ORC', 'ATTBONUS_MILGYO', 'ATTBONUS_UNDEAD', 'ATTBONUS_DEVIL', 'STEAL_HP', 'STEAL_SP', 'MANA_BURN_PCT', 'DAMAGE_SP_RECOVER', 'BLOCK', 'DODGE', 'RESIST_SWORD', 'RESIST_TWOHAND', 'RESIST_DAGGER', 'RESIST_BELL', 'RESIST_FAN', 'RESIST_BOW', 'RESIST_FIRE', 'RESIST_ELEC', 'RESIST_MAGIC', 'RESIST_WIND', 'REFLECT_MELEE', 'REFLECT_CURSE', 'POISON_REDUCE', 'KILL_SP_RECOVER', 'EXP_DOUBLE_BONUS', 'GOLD_DOUBLE_BONUS', 'ITEM_DROP_BONUS', 'POTION_BONUS', 'KILL_HP_RECOVER', 'IMMUNE_STUN', 'IMMUNE_SLOW', 'IMMUNE_FALL', 'SKILL', 'BOW_DISTANCE', 'ATT_GRADE_BONUS', 'DEF_GRADE_BONUS', 'MAGIC_ATT_GRADE', 'MAGIC_DEF_GRADE', 'CURSE_PCT', 'MAX_STAMINA', 'ATT_BONUS_TO_WARRIOR', 'ATT_BONUS_TO_ASSASSIN', 'ATT_BONUS_TO_SURA', 'ATT_BONUS_TO_SHAMAN', 'ATT_BONUS_TO_MONSTER', 'NORMAL_HIT_DEFEND_BONUS', 'SKILL_DEFEND_BONUS', 'NOUSE2\'\'NOUSE3', 'NOUSE4', 'NOUSE5', 'NOUSE6', 'NOUSE7', 'NOUSE8', 'NOUSE9', 'NOUSE10', 'NOUSE11', 'NOUSE12', 'NOUSE13', 'NOUSE14', 'RESIST_WARRIOR', 'RESIST_ASSASSIN', 'RESIST_SURA', 'RESIST_SHAMAN'])->default('MAX_HP');
$table->string('prob', 100)->default(''); $table->string('prob', 100);
$table->string('lv1', 100)->default(''); $table->string('lv1', 100);
$table->string('lv2', 100)->default(''); $table->string('lv2', 100);
$table->string('lv3', 100)->default(''); $table->string('lv3', 100);
$table->string('lv4', 100)->default(''); $table->string('lv4', 100);
$table->string('lv5', 100)->default(''); $table->string('lv5', 100);
$table->string('weapon', 100)->default(''); $table->string('weapon', 100);
$table->string('body', 100)->default(''); $table->string('body', 100);
$table->string('wrist', 100)->default(''); $table->string('wrist', 100);
$table->string('foots', 100)->default(''); $table->string('foots', 100);
$table->string('neck', 100)->default(''); $table->string('neck', 100);
$table->string('head', 100)->default(''); $table->string('head', 100);
$table->string('shield', 100)->default(''); $table->string('shield', 100);
$table->string('ear', 100)->default(''); $table->string('ear', 100);
}); });
// Populate the table data // Populate the table data
@ -44,6 +44,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('item_attr_rare'); Schema::dropIfExists('item_attr_rare');
} }
}; };

View File

@ -14,22 +14,22 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('item_attr', function (Blueprint $table) { Schema::create('item_attr', function (Blueprint $table) {
$table->enum('apply', ['MAX_HP', 'MAX_SP', 'CON', 'INT', 'STR', 'DEX', 'ATT_SPEED', 'MOV_SPEED', 'CAST_SPEED', 'HP_REGEN', 'SP_REGEN', 'POISON_PCT', 'STUN_PCT', 'SLOW_PCT', 'CRITICAL_PCT', 'PENETRATE_PCT', 'ATTBONUS_HUMAN', 'ATTBONUS_ANIMAL', 'ATTBONUS_ORC', 'ATTBONUS_MILGYO', 'ATTBONUS_UNDEAD', 'ATTBONUS_DEVIL', 'STEAL_HP', 'STEAL_SP', 'MANA_BURN_PCT', 'DAMAGE_SP_RECOVER', 'BLOCK', 'DODGE', 'RESIST_SWORD', 'RESIST_TWOHAND', 'RESIST_DAGGER', 'RESIST_BELL', 'RESIST_FAN', 'RESIST_BOW', 'RESIST_FIRE', 'RESIST_ELEC', 'RESIST_MAGIC', 'RESIST_WIND', 'REFLECT_MELEE', 'REFLECT_CURSE', 'POISON_REDUCE', 'KILL_SP_RECOVER', 'EXP_DOUBLE_BONUS', 'GOLD_DOUBLE_BONUS', 'ITEM_DROP_BONUS', 'POTION_BONUS', 'KILL_HP_RECOVER', 'IMMUNE_STUN', 'IMMUNE_SLOW', 'IMMUNE_FALL', 'SKILL', 'BOW_DISTANCE', 'ATT_GRADE_BONUS', 'DEF_GRADE_BONUS', 'MAGIC_ATT_GRADE', 'MAGIC_DEF_GRADE', 'CURSE_PCT', 'MAX_STAMINA', 'ATTBONUS_WARRIOR', 'ATTBONUS_ASSASSIN', 'ATTBONUS_SURA', 'ATTBONUS_SHAMAN', 'ATTBONUS_MONSTER', 'MALL_ATTBONUS', 'MALL_DEFBONUS', 'MALL_EXPBONUS', 'MALL_ITEMBONUS', 'MALL_GOLDBONUS', 'MAX_HP_PCT', 'MAX_SP_PCT', 'SKILL_DAMAGE_BONUS', 'NORMAL_HIT_DAMAGE_BONUS', 'SKILL_DEFEND_BONUS', 'NORMAL_HIT_DEFEND_BONUS', 'PC_BANG_EXP_BONUS', 'PC_BANG_DROP_BONUS', 'EXTRACT_HP_PCT', 'RESIST_WARRIOR', 'RESIST_ASSASSIN', 'RESIST_SURA', 'RESIST_SHAMAN', 'ENERGY', 'DEF_GRADE', 'COSTUME_ATTR_BONUS', 'MAGIC_ATTBONUS_PER', 'MELEE_MAGIC_ATTBONUS_PER', 'RESIST_ICE', 'RESIST_EARTH', 'RESIST_DARK', 'ANTI_CRITICAL_PCT', 'ANTI_PENETRATE_PCT'])->default('MAX_HP'); $table->enum('apply', ['MAX_HP', 'MAX_SP', 'CON', 'INT', 'STR', 'DEX', 'ATT_SPEED', 'MOV_SPEED', 'CAST_SPEED', 'HP_REGEN', 'SP_REGEN', 'POISON_PCT', 'STUN_PCT', 'SLOW_PCT', 'CRITICAL_PCT', 'PENETRATE_PCT', 'ATTBONUS_HUMAN', 'ATTBONUS_ANIMAL', 'ATTBONUS_ORC', 'ATTBONUS_MILGYO', 'ATTBONUS_UNDEAD', 'ATTBONUS_DEVIL', 'STEAL_HP', 'STEAL_SP', 'MANA_BURN_PCT', 'DAMAGE_SP_RECOVER', 'BLOCK', 'DODGE', 'RESIST_SWORD', 'RESIST_TWOHAND', 'RESIST_DAGGER', 'RESIST_BELL', 'RESIST_FAN', 'RESIST_BOW', 'RESIST_FIRE', 'RESIST_ELEC', 'RESIST_MAGIC', 'RESIST_WIND', 'REFLECT_MELEE', 'REFLECT_CURSE', 'POISON_REDUCE', 'KILL_SP_RECOVER', 'EXP_DOUBLE_BONUS', 'GOLD_DOUBLE_BONUS', 'ITEM_DROP_BONUS', 'POTION_BONUS', 'KILL_HP_RECOVER', 'IMMUNE_STUN', 'IMMUNE_SLOW', 'IMMUNE_FALL', 'SKILL', 'BOW_DISTANCE', 'ATT_GRADE_BONUS', 'DEF_GRADE_BONUS', 'MAGIC_ATT_GRADE', 'MAGIC_DEF_GRADE', 'CURSE_PCT', 'MAX_STAMINA', 'ATTBONUS_WARRIOR', 'ATTBONUS_ASSASSIN', 'ATTBONUS_SURA', 'ATTBONUS_SHAMAN', 'ATTBONUS_MONSTER', 'MALL_ATTBONUS', 'MALL_DEFBONUS', 'MALL_EXPBONUS', 'MALL_ITEMBONUS', 'MALL_GOLDBONUS', 'MAX_HP_PCT', 'MAX_SP_PCT', 'SKILL_DAMAGE_BONUS', 'NORMAL_HIT_DAMAGE_BONUS', 'SKILL_DEFEND_BONUS', 'NORMAL_HIT_DEFEND_BONUS', 'PC_BANG_EXP_BONUS', 'PC_BANG_DROP_BONUS', 'EXTRACT_HP_PCT', 'RESIST_WARRIOR', 'RESIST_ASSASSIN', 'RESIST_SURA', 'RESIST_SHAMAN', 'ENERGY', 'DEF_GRADE', 'COSTUME_ATTR_BONUS', 'MAGIC_ATTBONUS_PER', 'MELEE_MAGIC_ATTBONUS_PER', 'RESIST_ICE', 'RESIST_EARTH', 'RESIST_DARK', 'ANTI_CRITICAL_PCT', 'ANTI_PENETRATE_PCT'])->default('MAX_HP');
$table->string('prob', 100)->default(''); $table->string('prob', 100);
$table->string('lv1', 100)->default(''); $table->string('lv1', 100);
$table->string('lv2', 100)->default(''); $table->string('lv2', 100);
$table->string('lv3', 100)->default(''); $table->string('lv3', 100);
$table->string('lv4', 100)->default(''); $table->string('lv4', 100);
$table->string('lv5', 100)->default(''); $table->string('lv5', 100);
$table->string('weapon', 100)->default(''); $table->string('weapon', 100);
$table->string('body', 100)->default(''); $table->string('body', 100);
$table->string('wrist', 100)->default(''); $table->string('wrist', 100);
$table->string('foots', 100)->default(''); $table->string('foots', 100);
$table->string('neck', 100)->default(''); $table->string('neck', 100);
$table->string('head', 100)->default(''); $table->string('head', 100);
$table->string('shield', 100)->default(''); $table->string('shield', 100);
$table->string('ear', 100)->default(''); $table->string('ear', 100);
}); });
// Populate the table data // Populate the table data
@ -44,6 +44,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('item_attr'); Schema::dropIfExists('item_attr');
} }
}; };

View File

@ -13,13 +13,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('item_award', function (Blueprint $table) { Schema::create('item_award', function (Blueprint $table) {
$table->integer('id', true); $table->unsignedInteger('id', true)->primary();
$table->unsignedInteger('pid')->default(0)->index('pid_idx'); $table->unsignedInteger('pid');
$table->string('login', 30)->default(''); $table->string('login', 30);
$table->unsignedInteger('vnum')->default(0); $table->unsignedInteger('vnum');
$table->unsignedInteger('count')->default(0); $table->unsignedInteger('count');
$table->dateTime('given_time')->default('0000-00-00 00:00:00')->index('given_time_idx'); $table->dateTime('given_time')->useCurrent()->index('given_time_idx');
$table->dateTime('taken_time')->nullable()->index('taken_time_idx'); $table->dateTime('taken_time')->nullable()->index('taken_time_idx');
$table->integer('item_id')->nullable(); $table->integer('item_id')->nullable();
$table->string('why', 128)->nullable(); $table->string('why', 128)->nullable();
@ -27,6 +27,9 @@ return new class extends Migration
$table->integer('socket1')->default(0); $table->integer('socket1')->default(0);
$table->integer('socket2')->default(0); $table->integer('socket2')->default(0);
$table->boolean('mall')->default(false); $table->boolean('mall')->default(false);
$table->foreign('pid')->references('id')->on('player');
$table->foreign('login')->references('login')->on('account');
}); });
} }
@ -37,6 +40,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('item_award'); Schema::dropIfExists('item_award');
} }
}; };

View File

@ -13,8 +13,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('item_proto', function (Blueprint $table) { Schema::create('item_proto', function (Blueprint $table) {
$table->unsignedInteger('vnum')->default(0)->primary(); $table->unsignedInteger('vnum')->primary();
$table->binary('name', length: 24)->default('Noname'); $table->binary('name', length: 24)->default('Noname');
$table->binary('locale_name', length: 24)->default('Noname'); $table->binary('locale_name', length: 24)->default('Noname');
$table->tinyInteger('type')->default(0); $table->tinyInteger('type')->default(0);
@ -55,7 +55,7 @@ return new class extends Migration
$table->tinyInteger('socket5')->nullable()->default(-1); $table->tinyInteger('socket5')->nullable()->default(-1);
$table->tinyInteger('specular')->default(0); $table->tinyInteger('specular')->default(0);
$table->tinyInteger('socket_pct')->default(0); $table->tinyInteger('socket_pct')->default(0);
$table->smallInteger('addon_type')->default(0); $table->unsignedSmallInteger('addon_type')->default(0);
}); });
} }
@ -66,6 +66,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('item_proto'); Schema::dropIfExists('item_proto');
} }
}; };

View File

@ -13,9 +13,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('item', function (Blueprint $table) { Schema::create('item', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->unsignedInteger('owner_id')->default(0)->index('owner_id_idx'); $table->unsignedInteger('owner_id')->index('owner_id_idx');
$table->enum('window', ['INVENTORY', 'EQUIPMENT', 'SAFEBOX', 'MALL', 'DRAGON_SOUL_INVENTORY', 'BELT_INVENTORY'])->default('INVENTORY'); $table->enum('window', ['INVENTORY', 'EQUIPMENT', 'SAFEBOX', 'MALL', 'DRAGON_SOUL_INVENTORY', 'BELT_INVENTORY'])->default('INVENTORY');
$table->unsignedSmallInteger('pos')->default(0); $table->unsignedSmallInteger('pos')->default(0);
$table->unsignedTinyInteger('count')->default(0); $table->unsignedTinyInteger('count')->default(0);
@ -50,6 +50,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('item'); Schema::dropIfExists('item');
} }
}; };

View File

@ -14,17 +14,19 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('land', function (Blueprint $table) { Schema::create('land', function (Blueprint $table) {
$table->integer('id', true); $table->unsignedInteger('id', true)->primary();
$table->integer('map_index')->default(0); $table->integer('map_index');
$table->integer('x')->default(0); $table->integer('x');
$table->integer('y')->default(0); $table->integer('y');
$table->integer('width')->default(0); $table->integer('width');
$table->integer('height')->default(0); $table->integer('height');
$table->unsignedInteger('guild_id')->default(0); $table->unsignedInteger('guild_id')->nullable();
$table->tinyInteger('guild_level_limit')->default(0); $table->tinyInteger('guild_level_limit');
$table->unsignedInteger('price')->default(0); $table->unsignedInteger('price')->default(0);
$table->enum('enable', ['YES', 'NO'])->default('NO'); $table->enum('enable', ['YES', 'NO'])->default('NO');
$table->foreign('guild_id')->references('id')->on('guild');
}); });
// Populate the table data // Populate the table data
@ -39,6 +41,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('land'); Schema::dropIfExists('land');
} }
}; };

View File

@ -13,15 +13,17 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('levellog', function (Blueprint $table) { Schema::create('levellog', function (Blueprint $table) {
$table->char('name', 24)->default(''); $table->char('name', 24)->default('');
$table->tinyInteger('level')->default(0); $table->tinyInteger('level')->default(0);
$table->dateTime('time')->default('0000-00-00 00:00:00'); $table->dateTime('time')->useCurrent();
$table->integer('playtime')->default(0); $table->integer('playtime')->default(0);
$table->integer('account_id'); $table->unsignedInteger('account_id');
$table->integer('pid'); $table->unsignedInteger('pid');
$table->primary(['name', 'level']); $table->primary(['name', 'level']);
$table->foreign('account_id')->references('id')->on('account');
$table->foreign('pid')->references('id')->on('player');
}); });
} }
@ -32,6 +34,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('levellog'); Schema::dropIfExists('levellog');
} }
}; };

View File

@ -14,9 +14,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('common')->create('locale', function (Blueprint $table) { Schema::create('locale', function (Blueprint $table) {
$table->string('mKey')->default('')->primary(); $table->string('mKey')->primary();
$table->string('mValue')->default(''); $table->string('mValue');
}); });
// Populate the table data // Populate the table data
@ -31,6 +31,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('common')->dropIfExists('locale'); Schema::dropIfExists('locale');
} }
}; };

View File

@ -13,9 +13,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('log', function (Blueprint $table) { Schema::create('log', function (Blueprint $table) {
$table->enum('type', ['ITEM', 'CHARACTER'])->default('ITEM'); $table->enum('type', ['ITEM', 'CHARACTER'])->default('ITEM');
$table->dateTime('time')->default('0000-00-00 00:00:00'); $table->dateTime('time')->useCurrent();
$table->unsignedInteger('who')->default(0)->index('who_idx'); $table->unsignedInteger('who')->default(0)->index('who_idx');
$table->unsignedInteger('x')->default(0); $table->unsignedInteger('x')->default(0);
$table->unsignedInteger('y')->default(0); $table->unsignedInteger('y')->default(0);
@ -34,6 +34,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('log'); Schema::dropIfExists('log');
} }
}; };

View File

@ -13,18 +13,22 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('loginlog2', function (Blueprint $table) { // TODO Check if this is useless, doesn't seem to be getting used at all
$table->integer('id', true); Schema::create('loginlog', function (Blueprint $table) {
$table->unsignedInteger('id', true)->primary();
$table->text('type')->nullable(); $table->text('type')->nullable();
$table->integer('is_gm')->nullable(); $table->boolean('is_gm')->default(false);
$table->dateTime('login_time')->nullable(); $table->dateTime('login_time')->nullable();
$table->integer('channel')->nullable(); $table->integer('channel')->nullable();
$table->integer('account_id')->nullable(); $table->unsignedInteger('account_id')->nullable();
$table->integer('pid')->nullable(); $table->unsignedInteger('pid')->nullable();
$table->text('client_version')->nullable(); $table->text('client_version')->nullable();
$table->text('ip')->nullable(); $table->text('ip')->nullable();
$table->dateTime('logout_time')->nullable(); $table->dateTime('logout_time')->nullable();
$table->integer('playtime')->default(0); $table->integer('playtime')->default(0);
$table->foreign('account_id')->references('id')->on('account');
$table->foreign('pid')->references('id')->on('player');
}); });
} }
@ -35,6 +39,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('loginlog2'); Schema::dropIfExists('loginlog2');
} }
}; };

View File

@ -13,11 +13,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('lotto_list', function (Blueprint $table) { Schema::create('lotto_list', function (Blueprint $table) {
$table->increments('id'); $table->unsignedInteger('id', true)->primary();
$table->string('server', 20)->nullable(); $table->string('server', 20)->nullable();
$table->unsignedInteger('pid')->nullable(); $table->unsignedInteger('pid')->nullable();
$table->dateTime('time')->nullable(); $table->dateTime('time')->nullable();
$table->foreign('pid')->references('id')->on('player');
}); });
} }
@ -28,6 +30,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('lotto_list'); Schema::dropIfExists('lotto_list');
} }
}; };

View File

@ -12,8 +12,8 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::connection('website')->create('mall_categories', function (Blueprint $table) { Schema::create('mall_categories', function (Blueprint $table) {
$table->integer('id', true); $table->id();
$table->text('name'); $table->text('name');
}); });
@ -27,6 +27,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::connection('website')->dropIfExists('mall_categories'); Schema::dropIfExists('mall_categories');
} }
}; };

View File

@ -11,8 +11,8 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::connection('website')->create('mall_data', function (Blueprint $table) { Schema::create('mall_data', function (Blueprint $table) {
$table->unsignedInteger('vnum')->default(0)->primary(); $table->unsignedInteger('vnum')->primary();
$table->unsignedInteger('socket0')->default(0); $table->unsignedInteger('socket0')->default(0);
$table->unsignedInteger('socket1')->default(0); $table->unsignedInteger('socket1')->default(0);
$table->unsignedInteger('socket2')->default(0); $table->unsignedInteger('socket2')->default(0);
@ -27,6 +27,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::connection('website')->dropIfExists('mall_data'); Schema::dropIfExists('mall_data');
} }
}; };

View File

@ -12,10 +12,10 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::connection('website')->create('mall_items', function (Blueprint $table) { Schema::create('mall_items', function (Blueprint $table) {
$table->integer('id', true); $table->id();
$table->integer('vnum'); $table->integer('vnum');
$table->integer('category_id'); $table->unsignedBigInteger('category_id');
$table->integer('old_price')->nullable(); $table->integer('old_price')->nullable();
$table->integer('price'); $table->integer('price');
$table->enum('pricing', ['CASH', 'MILEAGE'])->default('CASH'); $table->enum('pricing', ['CASH', 'MILEAGE'])->default('CASH');
@ -23,6 +23,8 @@ return new class extends Migration
$table->text('image')->nullable(); $table->text('image')->nullable();
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->enum('other', ['recommend', 'recommend_desc'])->nullable(); $table->enum('other', ['recommend', 'recommend_desc'])->nullable();
$table->foreign('category_id')->references('id')->on('mall_categories');
}); });
// Populate the table data // Populate the table data
@ -35,6 +37,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::connection('website')->dropIfExists('mall_items'); Schema::dropIfExists('mall_items');
} }
}; };

View File

@ -11,11 +11,11 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::connection('website')->create('mall_storage', function (Blueprint $table) { Schema::create('mall_storage', function (Blueprint $table) {
$table->bigInteger('id', true); $table->id();
$table->unsignedInteger('owner_id')->default(0)->index('owner_id_idx'); $table->unsignedInteger('owner_id')->index('owner_id_idx');
$table->unsignedTinyInteger('count')->default(0); $table->unsignedTinyInteger('count')->default(1);
$table->unsignedInteger('vnum')->default(0)->index('item_vnum_index'); $table->unsignedInteger('vnum')->index('item_vnum_index');
$table->unsignedInteger('socket0')->default(0); $table->unsignedInteger('socket0')->default(0);
$table->unsignedInteger('socket1')->default(0); $table->unsignedInteger('socket1')->default(0);
$table->unsignedInteger('socket2')->default(0); $table->unsignedInteger('socket2')->default(0);
@ -44,6 +44,6 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::connection('website')->dropIfExists('mall_storage'); Schema::dropIfExists('mall_storage');
} }
}; };

View File

@ -13,14 +13,16 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('marriage', function (Blueprint $table) { Schema::create('marriage', function (Blueprint $table) {
$table->tinyInteger('is_married')->default(0); $table->boolean('is_married')->default(false);
$table->unsignedInteger('pid1')->default(0); $table->unsignedInteger('pid1');
$table->unsignedInteger('pid2')->default(0); $table->unsignedInteger('pid2');
$table->unsignedInteger('love_point')->nullable(); $table->unsignedInteger('love_point')->nullable();
$table->unsignedInteger('time')->default(0); $table->unsignedInteger('time');
$table->primary(['pid1', 'pid2']); $table->primary(['pid1', 'pid2']);
$table->foreign('pid1')->references('id')->on('player');
$table->foreign('pid2')->references('id')->on('player');
}); });
} }
@ -31,6 +33,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('marriage'); Schema::dropIfExists('marriage');
} }
}; };

View File

@ -13,9 +13,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('messenger_list', function (Blueprint $table) { Schema::create('messenger_list', function (Blueprint $table) {
$table->string('account', 16)->default(''); $table->string('account', 16);
$table->string('companion', 16)->default(''); $table->string('companion', 16);
$table->primary(['account', 'companion']); $table->primary(['account', 'companion']);
}); });
@ -28,6 +28,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('messenger_list'); Schema::dropIfExists('messenger_list');
} }
}; };

View File

@ -13,8 +13,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('mob_proto', function (Blueprint $table) { Schema::create('mob_proto', function (Blueprint $table) {
$table->integer('vnum')->default(0)->primary(); $table->integer('vnum')->primary();
$table->binary('name', length: 24)->default('Noname'); $table->binary('name', length: 24)->default('Noname');
$table->binary('locale_name', length: 24)->default('Noname'); $table->binary('locale_name', length: 24)->default('Noname');
$table->tinyInteger('rank')->default(0); $table->tinyInteger('rank')->default(0);
@ -96,6 +96,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('mob_proto'); Schema::dropIfExists('mob_proto');
} }
}; };

View File

@ -13,11 +13,14 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('monarch_candidacy', function (Blueprint $table) { Schema::create('monarch_candidacy', function (Blueprint $table) {
$table->unsignedInteger('pid')->default(0)->primary(); $table->unsignedInteger('pid');
$table->dateTime('date')->nullable()->default('0000-00-00 00:00:00'); $table->dateTime('date')->useCurrent();
// TODO Check if these two below are ever used
$table->string('name', 16)->nullable(); $table->string('name', 16)->nullable();
$table->dateTime('windate')->nullable(); $table->dateTime('windate')->nullable();
$table->foreign('pid')->references('id')->on('player');
}); });
} }
@ -28,6 +31,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('monarch_candidacy'); Schema::dropIfExists('monarch_candidacy');
} }
}; };

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('monarch_election', function (Blueprint $table) {
$table->unsignedInteger('pid');
$table->unsignedInteger('selectedpid');
$table->dateTime('electiondata')->useCurrent();
$table->foreign('pid')->references('id')->on('player');
$table->foreign('selectedpid')->references('id')->on('player');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('monarch_election');
}
};

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('monarch', function (Blueprint $table) {
$table->unsignedInteger('empire')->primary();
$table->unsignedInteger('pid');
$table->dateTime('windate');
$table->unsignedBigInteger('money');
$table->foreign('pid')->references('id')->on('player');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('monarch');
}
};

View File

@ -13,7 +13,7 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('money_log', function (Blueprint $table) { Schema::create('money_log', function (Blueprint $table) {
$table->dateTime('time')->nullable(); $table->dateTime('time')->nullable();
$table->enum('type', ['MONSTER', 'SHOP', 'REFINE', 'QUEST', 'GUILD', 'MISC', 'KILL', 'DROP'])->nullable(); $table->enum('type', ['MONSTER', 'SHOP', 'REFINE', 'QUEST', 'GUILD', 'MISC', 'KILL', 'DROP'])->nullable();
$table->integer('vnum')->default(0); $table->integer('vnum')->default(0);
@ -30,6 +30,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('money_log'); Schema::dropIfExists('money_log');
} }
}; };

View File

@ -13,12 +13,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('myshop_pricelist', function (Blueprint $table) { Schema::create('myshop_pricelist', function (Blueprint $table) {
$table->unsignedInteger('owner_id')->default(0); $table->unsignedInteger('owner_id');
$table->unsignedInteger('item_vnum')->default(0); $table->unsignedInteger('item_vnum');
$table->unsignedInteger('price')->default(0); $table->unsignedInteger('price');
$table->unique(['owner_id', 'item_vnum'], 'list_id'); $table->unique(['owner_id', 'item_vnum'], 'list_id');
$table->foreign('owner_id')->references('id')->on('player');
}); });
} }
@ -29,6 +30,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('myshop_pricelist'); Schema::dropIfExists('myshop_pricelist');
} }
}; };

View File

@ -14,11 +14,11 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('object_proto', function (Blueprint $table) { Schema::create('object_proto', function (Blueprint $table) {
$table->unsignedInteger('vnum')->default(0)->primary(); $table->unsignedInteger('vnum')->primary();
$table->string('name', 32)->default(''); $table->string('name', 32);
$table->unsignedInteger('price')->default(0); $table->unsignedInteger('price');
$table->string('materials', 64)->default(''); $table->string('materials', 64);
$table->unsignedInteger('upgrade_vnum')->default(0); $table->unsignedInteger('upgrade_vnum')->default(0);
$table->unsignedInteger('upgrade_limit_time')->default(0); $table->unsignedInteger('upgrade_limit_time')->default(0);
$table->integer('life')->default(0); $table->integer('life')->default(0);
@ -27,6 +27,7 @@ return new class extends Migration
$table->integer('reg_3')->default(0); $table->integer('reg_3')->default(0);
$table->integer('reg_4')->default(0); $table->integer('reg_4')->default(0);
$table->unsignedInteger('npc')->default(0); $table->unsignedInteger('npc')->default(0);
// TODO Check the items below as they might be indexeable
$table->unsignedInteger('group_vnum')->default(0); $table->unsignedInteger('group_vnum')->default(0);
$table->unsignedInteger('dependent_group')->default(0); $table->unsignedInteger('dependent_group')->default(0);
}); });
@ -43,6 +44,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('object_proto'); Schema::dropIfExists('object_proto');
} }
}; };

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('object', function (Blueprint $table) {
$table->unsignedInteger('id', true)->primary();
$table->unsignedInteger('land_id');
$table->unsignedInteger('vnum');
$table->integer('map_index');
$table->integer('x');
$table->integer('y');
$table->float('x_rot', null, 0);
$table->float('y_rot', null, 0);
$table->float('z_rot', null, 0);
$table->integer('life')->default(0);
$table->foreign('land_id')->references('id')->on('land');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('object');
}
};

View File

@ -13,10 +13,10 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('player_deleted', function (Blueprint $table) { Schema::create('player_deleted', function (Blueprint $table) {
$table->integer('id', true); $table->unsignedInteger('id', true)->primary();
$table->integer('account_id')->default(0)->index('account_id_idx'); $table->unsignedInteger('account_id');
$table->string('name', 24)->default('NONAME')->index('name_idx'); $table->string('name', 24)->default('Noname')->index('name_idx');
$table->unsignedTinyInteger('job')->default(0); $table->unsignedTinyInteger('job')->default(0);
$table->boolean('voice')->unsigned()->default(false); $table->boolean('voice')->unsigned()->default(false);
$table->tinyInteger('dir')->default(0); $table->tinyInteger('dir')->default(0);
@ -51,7 +51,7 @@ return new class extends Migration
$table->tinyInteger('skill_group')->default(0); $table->tinyInteger('skill_group')->default(0);
$table->binary('skill_level')->nullable(); $table->binary('skill_level')->nullable();
$table->integer('alignment')->default(0); $table->integer('alignment')->default(0);
$table->dateTime('last_play')->default('0000-00-00 00:00:00'); $table->dateTime('last_play')->useCurrent();
$table->boolean('change_name')->default(false); $table->boolean('change_name')->default(false);
$table->smallInteger('sub_skill_point')->default(0); $table->smallInteger('sub_skill_point')->default(0);
$table->tinyInteger('stat_reset_count')->default(0); $table->tinyInteger('stat_reset_count')->default(0);
@ -62,6 +62,8 @@ return new class extends Migration
$table->boolean('horse_riding')->default(false); $table->boolean('horse_riding')->default(false);
$table->smallInteger('horse_skill_point')->default(0); $table->smallInteger('horse_skill_point')->default(0);
$table->integer('bank_value')->nullable()->default(0); $table->integer('bank_value')->nullable()->default(0);
$table->foreign('account_id')->references('id')->on('account');
}); });
} }
@ -72,6 +74,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('player_deleted'); Schema::dropIfExists('player_deleted');
} }
}; };

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('player_index', function (Blueprint $table) {
$table->unsignedInteger('id');
$table->unsignedInteger('pid1')->nullable();
$table->unsignedInteger('pid2')->nullable();
$table->unsignedInteger('pid3')->nullable();
$table->unsignedInteger('pid4')->nullable();
$table->tinyInteger('empire')->default(0);
$table->foreign('id')->references('id')->on('account');
$table->foreign('pid1')->references('id')->on('player');
$table->foreign('pid2')->references('id')->on('player');
$table->foreign('pid3')->references('id')->on('player');
$table->foreign('pid4')->references('id')->on('player');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('player_index');
}
};

View File

@ -13,14 +13,16 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('quest_reward_log', function (Blueprint $table) { Schema::create('quest_reward_log', function (Blueprint $table) {
$table->string('quest_name', 32)->nullable(); $table->string('quest_name', 32)->nullable();
$table->unsignedInteger('player_id')->nullable()->index('player_id'); $table->unsignedInteger('player_id');
$table->tinyInteger('player_level')->nullable(); $table->tinyInteger('player_level');
$table->enum('reward_type', ['EXP', 'ITEM'])->nullable(); $table->enum('reward_type', ['EXP', 'ITEM'])->nullable();
$table->unsignedInteger('reward_value1')->nullable(); $table->unsignedInteger('reward_value1');
$table->integer('reward_value2')->nullable(); $table->integer('reward_value2');
$table->dateTime('time')->nullable(); $table->dateTime('time')->nullable();
$table->foreign('player_id')->references('id')->on('player');
}); });
} }
@ -31,6 +33,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('quest_reward_log'); Schema::dropIfExists('quest_reward_log');
} }
}; };

View File

@ -13,13 +13,14 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('quest', function (Blueprint $table) { Schema::create('quest', function (Blueprint $table) {
$table->unsignedInteger('dwPID')->default(0)->index('pid_idx'); $table->unsignedInteger('dwPID')->nullable();
$table->string('szName', 32)->default('')->index('name_idx'); $table->string('szName', 32)->index('name_idx');
$table->string('szState', 64)->default('')->index('state_idx'); $table->string('szState', 64)->default('')->index('state_idx');
$table->integer('lValue')->default(0); $table->integer('lValue')->default(0);
$table->primary(['dwPID', 'szName', 'szState']); $table->index(['dwPID', 'szName', 'szState']);
$table->foreign('dwPID')->references('id')->on('player');
}); });
} }
@ -30,6 +31,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('quest'); Schema::dropIfExists('quest');
} }
}; };

View File

@ -14,8 +14,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('refine_proto', function (Blueprint $table) { Schema::create('refine_proto', function (Blueprint $table) {
$table->integer('id', true); $table->unsignedInteger('id', true)->primary();
$table->unsignedInteger('vnum0')->default(0); $table->unsignedInteger('vnum0')->default(0);
$table->smallInteger('count0')->default(0); $table->smallInteger('count0')->default(0);
$table->unsignedInteger('vnum1')->default(0); $table->unsignedInteger('vnum1')->default(0);
@ -44,6 +44,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('refine_proto'); Schema::dropIfExists('refine_proto');
} }
}; };

View File

@ -13,12 +13,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('log')->create('refinelog', function (Blueprint $table) { Schema::create('refinelog', function (Blueprint $table) {
$table->unsignedInteger('pid')->nullable(); $table->unsignedInteger('pid')->nullable();
$table->string('item_name', 24)->default(''); // TODO Remove this since we have item_id
$table->integer('item_id')->default(0); $table->string('item_name', 24);
$table->string('step', 50)->default(''); $table->integer('item_id');
$table->dateTime('time')->default('0000-00-00 00:00:00'); $table->string('step', 50);
$table->dateTime('time')->useCurrent();
$table->boolean('is_success')->default(false); $table->boolean('is_success')->default(false);
$table->set('setType', ['SOCKET', 'POWER', 'ROD', 'GUILD', 'SCROLL', 'HYUNIRON', 'GOD_SCROLL', 'MUSIN_SCROLL'])->nullable(); $table->set('setType', ['SOCKET', 'POWER', 'ROD', 'GUILD', 'SCROLL', 'HYUNIRON', 'GOD_SCROLL', 'MUSIN_SCROLL'])->nullable();
}); });
@ -31,6 +32,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('log')->dropIfExists('refinelog'); Schema::dropIfExists('refinelog');
} }
}; };

View File

@ -13,11 +13,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('safebox', function (Blueprint $table) { Schema::create('safebox', function (Blueprint $table) {
$table->unsignedInteger('account_id')->default(0)->primary(); $table->unsignedInteger('account_id');
$table->unsignedTinyInteger('size')->default(0); $table->unsignedTinyInteger('size')->default(0);
$table->string('password', 6)->default(''); $table->string('password', 6)->default('');
$table->integer('gold')->default(0); $table->integer('gold')->default(0);
$table->foreign('account_id')->references('id')->on('account');
}); });
} }
@ -28,6 +30,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('safebox'); Schema::dropIfExists('safebox');
} }
}; };

View File

@ -14,8 +14,8 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('shop', function (Blueprint $table) { Schema::create('shop', function (Blueprint $table) {
$table->integer('vnum')->default(0)->primary(); $table->unsignedInteger('vnum')->primary();
$table->string('name', 32)->default('Noname'); $table->string('name', 32)->default('Noname');
$table->smallInteger('npc_vnum')->default(0); $table->smallInteger('npc_vnum')->default(0);
}); });
@ -32,6 +32,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('shop'); Schema::dropIfExists('shop');
} }
}; };

View File

@ -14,12 +14,13 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::connection('player')->create('shop_item', function (Blueprint $table) { Schema::create('shop_item', function (Blueprint $table) {
$table->integer('shop_vnum')->default(0); $table->unsignedInteger('shop_vnum');
$table->integer('item_vnum')->default(0); $table->unsignedInteger('item_vnum');
$table->unsignedTinyInteger('count')->default(1); $table->unsignedTinyInteger('count')->default(1);
$table->unique(['shop_vnum', 'item_vnum', 'count'], 'vnum_unique'); $table->unique(['shop_vnum', 'item_vnum', 'count'], 'vnum_unique');
$table->foreign('shop_vnum')->references('vnum')->on('shop');
}); });
// Populate the table data // Populate the table data
@ -34,6 +35,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::connection('player')->dropIfExists('shop_item'); Schema::dropIfExists('shop_item');
} }
}; };

Some files were not shown because too many files have changed in this diff Show More