From 93705103df1a61dec5995a0d75473dcb98750afa Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 19 Dec 2025 11:06:13 +0100 Subject: [PATCH] feat: add statts --- app/Models/User.php | 5 +++- .../2025_12_19_100429_add_stats_to_users.php | 30 +++++++++++++++++++ docker-compose.prod.yml | 23 ++++++++------ 3 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 database/migrations/2025_12_19_100429_add_stats_to_users.php diff --git a/app/Models/User.php b/app/Models/User.php index 09b3702..c5a0f61 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -25,7 +25,10 @@ class User extends Authenticatable 'username', 'email', 'password', - 'role' + 'role', + 'xp', + 'participations', + 'victories' ]; /** diff --git a/database/migrations/2025_12_19_100429_add_stats_to_users.php b/database/migrations/2025_12_19_100429_add_stats_to_users.php new file mode 100644 index 0000000..be1dcd4 --- /dev/null +++ b/database/migrations/2025_12_19_100429_add_stats_to_users.php @@ -0,0 +1,30 @@ +integer('xp')->default(0); + $table->integer('participations')->default(0); + $table->integer('victories')->default(0); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + // + }); + } +}; diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 026c1af..d59edf5 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -64,6 +64,19 @@ services: echo '✅ Migrations applied.'; " + phpmyadmin: + image: phpmyadmin:latest + restart: unless-stopped + depends_on: + - mysql + ports: + - "8888:80" + environment: + PMA_HOST: mysql + PMA_PORT: 3306 + PMA_USER: "${DB_USERNAME}" + PMA_PASSWORD: "${DB_PASSWORD}" + mysql: image: mysql:8.0 restart: unless-stopped @@ -77,15 +90,7 @@ services: ports: - "3308:3306" # Optionnel, pour accès externe à MySQL healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "-p${MYSQL_ROOT_PASSWORD}", - ] + test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_ROOT_PASSWORD}" ] interval: 5s timeout: 5s retries: 10