diff --git a/.env.example b/.env.example index c0660ea..0348596 100644 --- a/.env.example +++ b/.env.example @@ -20,12 +20,12 @@ LOG_STACK=single LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=sqlite -# DB_HOST=127.0.0.1 -# DB_PORT=3306 -# DB_DATABASE=laravel -# DB_USERNAME=root -# DB_PASSWORD= +DB_CONNECTION=pgsql +DB_HOST=127.0.0.1 +DB_PORT=5432 +DB_DATABASE=tabeley_db +DB_USERNAME=postgres +DB_PASSWORD=secret SESSION_DRIVER=database SESSION_LIFETIME=120 diff --git a/Dockerfile b/Dockerfile index 917a136..4856b20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN apk add --no-cache \ freetype-dev \ libzip-dev \ oniguruma-dev \ + postgresql-dev \ tzdata \ && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ && docker-php-ext-install -j"$(nproc)" \ @@ -30,7 +31,7 @@ RUN apk add --no-cache \ exif \ gd \ intl \ - pdo_mysql \ + pdo_pgsql \ zip \ && apk del --no-cache \ icu-dev \ @@ -39,7 +40,8 @@ RUN apk add --no-cache \ libwebp-dev \ freetype-dev \ libzip-dev \ - oniguruma-dev + oniguruma-dev \ + postgresql-dev COPY --from=vendor /app/vendor ./vendor COPY . . diff --git a/database/migrations/2026_02_13_074913_update_users_table.php b/database/migrations/2026_02_13_074913_update_users_table.php index 3939a23..995a8f5 100644 --- a/database/migrations/2026_02_13_074913_update_users_table.php +++ b/database/migrations/2026_02_13_074913_update_users_table.php @@ -13,9 +13,9 @@ return new class extends Migration $table->dropColumn('name'); // نضيف الحقول تبع مشروعنا - $table->string('first_name')->after('id'); - $table->string('last_name')->after('first_name'); - $table->string('phone')->unique()->after('email'); + $table->string('first_name'); + $table->string('last_name'); + $table->string('phone')->unique(); }); } diff --git a/database/migrations/2026_02_13_100500_add_type_to_venues_table.php b/database/migrations/2026_02_13_100500_add_type_to_venues_table.php index a4bb1f6..c518134 100644 --- a/database/migrations/2026_02_13_100500_add_type_to_venues_table.php +++ b/database/migrations/2026_02_13_100500_add_type_to_venues_table.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { Schema::table('venues', function (Blueprint $table) { - $table->string('type')->default('restaurant')->after('name'); + $table->string('type')->default('restaurant'); }); } diff --git a/database/migrations/2026_02_13_101000_add_location_fields_to_venues_table.php b/database/migrations/2026_02_13_101000_add_location_fields_to_venues_table.php index 4a9806d..c83c5c3 100644 --- a/database/migrations/2026_02_13_101000_add_location_fields_to_venues_table.php +++ b/database/migrations/2026_02_13_101000_add_location_fields_to_venues_table.php @@ -9,9 +9,9 @@ return new class extends Migration public function up(): void { Schema::table('venues', function (Blueprint $table) { - $table->string('address_text')->nullable()->after('description'); - $table->decimal('lat', 10, 7)->nullable()->after('address_text'); - $table->decimal('lng', 10, 7)->nullable()->after('lat'); + $table->string('address_text')->nullable(); + $table->decimal('lat', 10, 7)->nullable(); + $table->decimal('lng', 10, 7)->nullable(); }); } diff --git a/database/migrations/2026_02_13_102000_add_is_active_to_venues_table.php b/database/migrations/2026_02_13_102000_add_is_active_to_venues_table.php index b23c20f..008e29c 100644 --- a/database/migrations/2026_02_13_102000_add_is_active_to_venues_table.php +++ b/database/migrations/2026_02_13_102000_add_is_active_to_venues_table.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { Schema::table('venues', function (Blueprint $table) { - $table->boolean('is_active')->default(true)->after('lng'); + $table->boolean('is_active')->default(true); }); } diff --git a/database/migrations/2026_02_13_103500_add_code_to_reservations_table.php b/database/migrations/2026_02_13_103500_add_code_to_reservations_table.php index cc08479..2633141 100644 --- a/database/migrations/2026_02_13_103500_add_code_to_reservations_table.php +++ b/database/migrations/2026_02_13_103500_add_code_to_reservations_table.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { Schema::table('reservations', function (Blueprint $table) { - $table->string('code', 8)->unique()->after('id'); + $table->string('code', 8)->unique(); }); } diff --git a/database/migrations/2026_02_13_104600_add_blacklist_fields_to_users_table.php b/database/migrations/2026_02_13_104600_add_blacklist_fields_to_users_table.php index 5bf043f..6fbe528 100644 --- a/database/migrations/2026_02_13_104600_add_blacklist_fields_to_users_table.php +++ b/database/migrations/2026_02_13_104600_add_blacklist_fields_to_users_table.php @@ -9,9 +9,9 @@ return new class extends Migration public function up(): void { Schema::table('users', function (Blueprint $table) { - $table->unsignedSmallInteger('strike_count')->default(0)->after('password'); - $table->timestamp('blocked_until')->nullable()->after('strike_count'); - $table->boolean('blocked_permanent')->default(false)->after('blocked_until'); + $table->unsignedSmallInteger('strike_count')->default(0); + $table->timestamp('blocked_until')->nullable(); + $table->boolean('blocked_permanent')->default(false); }); } diff --git a/database/migrations/2026_02_15_120000_add_amenities_to_venues_table.php b/database/migrations/2026_02_15_120000_add_amenities_to_venues_table.php index a9a5415..8ecc4ab 100644 --- a/database/migrations/2026_02_15_120000_add_amenities_to_venues_table.php +++ b/database/migrations/2026_02_15_120000_add_amenities_to_venues_table.php @@ -9,7 +9,7 @@ return new class extends Migration public function up(): void { Schema::table('venues', function (Blueprint $table) { - $table->json('amenities')->nullable()->after('phone'); + $table->json('amenities')->nullable(); }); } diff --git a/database/migrations/2026_02_15_130000_add_images_and_offers_to_venues_table.php b/database/migrations/2026_02_15_130000_add_images_and_offers_to_venues_table.php index af63525..ee86249 100644 --- a/database/migrations/2026_02_15_130000_add_images_and_offers_to_venues_table.php +++ b/database/migrations/2026_02_15_130000_add_images_and_offers_to_venues_table.php @@ -9,8 +9,8 @@ return new class extends Migration public function up(): void { Schema::table('venues', function (Blueprint $table) { - $table->json('image_urls')->nullable()->after('amenities'); - $table->json('offers')->nullable()->after('image_urls'); + $table->json('image_urls')->nullable(); + $table->json('offers')->nullable(); }); } diff --git a/docker-compose.yml b/docker-compose.yml index b0f1b0b..0754eca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,11 +11,11 @@ services: APP_ENV: production APP_DEBUG: "false" APP_URL: ${APP_URL:-http://127.0.0.1:8000} - DB_CONNECTION: mysql + DB_CONNECTION: pgsql DB_HOST: db - DB_PORT: 3306 + DB_PORT: 5432 DB_DATABASE: ${DB_DATABASE:-tabeley_db} - DB_USERNAME: ${DB_USERNAME:-root} + DB_USERNAME: ${DB_USERNAME:-postgres} DB_PASSWORD: ${DB_PASSWORD:-secret} RUN_MIGRATIONS: "true" depends_on: @@ -36,17 +36,17 @@ services: - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro db: - image: mysql:8.4 + image: postgres:17-alpine container_name: tabeley_db restart: unless-stopped environment: - MYSQL_DATABASE: ${DB_DATABASE:-tabeley_db} - MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-secret} - command: --default-authentication-plugin=mysql_native_password + POSTGRES_DB: ${DB_DATABASE:-tabeley_db} + POSTGRES_USER: ${DB_USERNAME:-postgres} + POSTGRES_PASSWORD: ${DB_PASSWORD:-secret} ports: - - "3307:3306" + - "5433:5432" volumes: - - db_data:/var/lib/mysql + - db_data:/var/lib/postgresql/data volumes: db_data: