Added Nintendo Switch friend code profile field.
This commit is contained in:
parent
0a417b75af
commit
418ab0fcb2
2 changed files with 25 additions and 0 deletions
20
database/2018_12_07_175328_add_switch_friendcode_field.php
Normal file
20
database/2018_12_07_175328_add_switch_friendcode_field.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
namespace Misuzu\DatabaseMigrations\AddSwitchFriendcodeField;
|
||||||
|
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
function migrate_up(PDO $conn): void
|
||||||
|
{
|
||||||
|
$conn->exec("
|
||||||
|
ALTER TABLE `msz_users`
|
||||||
|
ADD COLUMN `user_ninswitch` VARCHAR(14) NOT NULL DEFAULT '' AFTER `user_steam`;
|
||||||
|
");
|
||||||
|
}
|
||||||
|
|
||||||
|
function migrate_down(PDO $conn): void
|
||||||
|
{
|
||||||
|
$conn->exec("
|
||||||
|
ALTER TABLE `msz_users`
|
||||||
|
DROP COLUMN `user_ninswitch`;
|
||||||
|
");
|
||||||
|
}
|
|
@ -46,6 +46,11 @@ define('MSZ_USER_PROFILE_FIELDS', [
|
||||||
'regex' => '#^(?:https?://(?:www.)?steamcommunity.com/(?:id|profiles)/)?([a-zA-Z0-9_-]{2,100})/?$#u',
|
'regex' => '#^(?:https?://(?:www.)?steamcommunity.com/(?:id|profiles)/)?([a-zA-Z0-9_-]{2,100})/?$#u',
|
||||||
'link' => 'https://steamcommunity.com/id/%s',
|
'link' => 'https://steamcommunity.com/id/%s',
|
||||||
],
|
],
|
||||||
|
'ninswitch' => [
|
||||||
|
'name' => 'Nintendo Switch',
|
||||||
|
'regex' => '#^(?:SW-)?([0-9]{4}-[0-9]{4}-[0-9]{4})$#u',
|
||||||
|
'format' => 'SW-%s',
|
||||||
|
],
|
||||||
'twitchtv' => [
|
'twitchtv' => [
|
||||||
'name' => 'Twitch.tv',
|
'name' => 'Twitch.tv',
|
||||||
'regex' => '#^(?:https?://(?:www.)?twitch.tv/)?([0-9A-Za-z_]{3,25})/?$#u',
|
'regex' => '#^(?:https?://(?:www.)?twitch.tv/)?([0-9A-Za-z_]{3,25})/?$#u',
|
||||||
|
|
Loading…
Add table
Reference in a new issue