Compare commits
No commits in common. "master" and "master" have entirely different histories.
54
README.md
54
README.md
@ -1,50 +1,18 @@
|
|||||||
# The Metin2 Website
|
# The Metin2 Website
|
||||||
|
|
||||||
This is a replica of the old Metin2 website in the pre-2014 era, made in Laravel. Still very much a work in progress,
|
This is a replica of the old Metin2 website in the pre-2014 era, made in Laravel. Still very much a work in progress,
|
||||||
it aims to be the management centre for the Metin2 stack.
|
it aims to be the management centre for the Metin2 stack.
|
||||||
|
|
||||||
## What works
|
## What works
|
||||||
|
- Registering a new account
|
||||||
- Registering a new account
|
- Account login
|
||||||
- Account login
|
|
||||||
|
|
||||||
## What's unfinished
|
## What's unfinished
|
||||||
|
- User management
|
||||||
- User management
|
- Complete multilanguage system & English translations
|
||||||
- Complete multilanguage system & English translations
|
- Item-Shop with Stripe integration
|
||||||
- Item-Shop with Stripe integration
|
- Populating the database tables with the minimum information to start the server
|
||||||
- Populating the database tables with the minimum information to start the server
|
- Admin panel (which would allow you to post news, customize the navbar, etc. and also manage ingame actions such as bans)
|
||||||
- Admin panel (which would allow you to post news, customize the navbar, etc. and also manage ingame actions such as bans)
|
- Docker image
|
||||||
- Docker image
|
- Ranking (with cache system for fast search)
|
||||||
- Ranking (with cache system for fast search)
|
- Adding Grotto & DC landing pages
|
||||||
- Adding Grotto & DC landing pages
|
- Converting Flash-based media players to HTML5.
|
||||||
- Converting Flash-based media players to HTML5.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Image Building
|
|
||||||
|
|
||||||
To build the image, checkout the repo and run either of the following build statements
|
|
||||||
|
|
||||||
```shell
|
|
||||||
docker build -t metin2/web:test -f docker/image/prod/apache.Dockerfile .
|
|
||||||
# or
|
|
||||||
docker build -t metin2/web:test -f docker/image/prod/frankenphp.Dockerfile .
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to use this image in your deploy project, ensure to update the `WEB_IMAGE` variable in your `.env` to `metin2/web:test`.
|
|
||||||
|
|
||||||
### Testing Migrations
|
|
||||||
|
|
||||||
To test newly added migrations, use a temporary docker container that attaches to your existing deploy network.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
docker run --env-file .env --network deploy_default --rm metin2/web:test "php artisan migrate"
|
|
||||||
```
|
|
||||||
|
|
||||||
Ensure that the rollback of your migration is also working as expected.
|
|
||||||
Adapt the `--step` parameter according to the number of migration files you added.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
docker run --env-file .env --network deploy_default --rm metin2/web:test "php artisan migrate:rollback --step=1"
|
|
||||||
```
|
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The database connection that should be used by the migration.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $connection = 'common';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
// change word to 191 characters (max length for index on utf8mb4 in MySQL < 5.7)
|
|
||||||
Schema::table('spam_db', function (Blueprint $table) {
|
|
||||||
$table->string('word', 191)->charset('utf8mb4')->collation('utf8mb4_unicode_ci')->change();
|
|
||||||
});
|
|
||||||
// create index on type
|
|
||||||
Schema::table('spam_db', function (Blueprint $table) {
|
|
||||||
$table->index('type');
|
|
||||||
});
|
|
||||||
// update to modern standards (InnoDB & utf8mb4)
|
|
||||||
Schema::table('spam_db', function (Blueprint $table) {
|
|
||||||
DB::statement('ALTER TABLE common.spam_db ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci');
|
|
||||||
DB::statement('ALTER TABLE common.spam_db CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
// revert to old standards (MyISAM & utf8)
|
|
||||||
Schema::table('spam_db', function (Blueprint $table) {
|
|
||||||
DB::statement('ALTER TABLE spam_db ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci');
|
|
||||||
DB::statement('ALTER TABLE spam_db CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci');
|
|
||||||
});
|
|
||||||
// change word back to 256 characters
|
|
||||||
Schema::table('spam_db', function (Blueprint $table) {
|
|
||||||
$table->string('word', 256)->charset('utf8')->collation('utf8_general_ci')->change();
|
|
||||||
});
|
|
||||||
// drop index on type
|
|
||||||
Schema::table('spam_db', function (Blueprint $table) {
|
|
||||||
$table->dropIndex(['type']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user