feat: add migration for title ids
This commit is contained in:
parent
a54f58cdfb
commit
0e8452d32e
2 changed files with 101 additions and 0 deletions
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Miiverse\DB;
|
||||
|
||||
class SeparateTitleIdsByRegionAndConsole extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$schema = DB::getSchemaBuilder();
|
||||
|
||||
$schema->table('community_title_ids', function (Blueprint $table) {
|
||||
$table->enum('console', [
|
||||
'3ds',
|
||||
'wiiu',
|
||||
])->nullable();
|
||||
|
||||
// Regions set and ordered by the account services
|
||||
// https://github.com/PretendoNetwork/nintendo-wiki/blob/master/docs/wiiu/account.md#headers
|
||||
$table->set('region', [
|
||||
'japan',
|
||||
'usa',
|
||||
'europe',
|
||||
'australia',
|
||||
'china',
|
||||
'korea',
|
||||
'taiwan'
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$schema = DB::getSchemaBuilder();
|
||||
|
||||
$schema->table('community_title_ids', function (Blueprint $table) {
|
||||
$table->dropColumn('console');
|
||||
$table->dropColumn('region');
|
||||
});
|
||||
}
|
||||
}
|
||||
49
database/2023_10_30_172534_default_region_for_titles.php
Normal file
49
database/2023_10_30_172534_default_region_for_titles.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Miiverse\DB;
|
||||
|
||||
class DefaultRegionForTitles extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$schema = DB::getSchemaBuilder();
|
||||
|
||||
$schema->table('communities', function (Blueprint $table) {
|
||||
// Regions set and ordered by the account services
|
||||
// https://github.com/PretendoNetwork/nintendo-wiki/blob/master/docs/wiiu/account.md#headers
|
||||
$regionList = [
|
||||
'japan',
|
||||
'usa',
|
||||
'europe',
|
||||
'australia',
|
||||
'china',
|
||||
'korea',
|
||||
'taiwan'
|
||||
];
|
||||
|
||||
// The default for titles is region free now
|
||||
$table->set('default_region', $regionList)->default(implode(',', $regionList));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$schema = DB::getSchemaBuilder();
|
||||
|
||||
$schema->table('communities', function (Blueprint $table) {
|
||||
$table->dropColumn('default_region');
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue