Skip to content

migrate:fresh doesn't drop tables with Postgres #142

Closed
@binaryfire

Description

@binaryfire

PHP Version

8.3

Swoole Extension Version

6

Database Driver & Version

Postgres

Description

php artisan migrate:fresh doesn't drop tables when using Postgres:
Image

When I check the db after running migrate:fresh the existing data is still there

Steps To Reproduce

  1. Install hyperf/database-pgsql

  2. Use the following config for the pgsql connection:

'pgsql' => [
    'driver' => env('DB_DRIVER', 'pgsql'),
    'host' => env('DB_HOST', 'localhost'),
    'database' => env('DB_DATABASE', 'hypervel'),
    'port' => env('DB_PORT', 5432),
    'username' => env('DB_USERNAME', 'root'),
    'password' => env('DB_PASSWORD', ''),
    'charset' => env('DB_CHARSET', 'utf8'),
    'pool' => [
        'min_connections' => 1,
        'max_connections' => env('DB_MAX_CONNECTIONS', 10),
        'connect_timeout' => 10.0,
        'wait_timeout' => 3.0,
        'heartbeat' => -1,
        'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
    ],
],
  1. Migrate the db, add some data, then run migrate:fresh. The old data will still be there.

PS. migrate:fresh works properly with Postgres in Hyperf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions