forked from metin2/web
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
bd124db2ed | |||
65cc674531 | |||
1e44762b30 | |||
12e8012107 | |||
dfb5487829 |
32
README.md
32
README.md
@ -1,12 +1,15 @@
|
||||
# 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,
|
||||
it aims to be the management centre for the Metin2 stack.
|
||||
|
||||
## What works
|
||||
|
||||
- Registering a new account
|
||||
- Account login
|
||||
|
||||
## What's unfinished
|
||||
|
||||
- User management
|
||||
- Complete multilanguage system & English translations
|
||||
- Item-Shop with Stripe integration
|
||||
@ -16,3 +19,32 @@ ## What's unfinished
|
||||
- Ranking (with cache system for fast search)
|
||||
- Adding Grotto & DC landing pages
|
||||
- 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"
|
||||
```
|
||||
|
@ -0,0 +1,59 @@
|
||||
<?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