Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is support for Laravel's Schema dump possible/planned? #2426

Open
DvDty opened this issue Jul 27, 2022 · 1 comment
Open

Is support for Laravel's Schema dump possible/planned? #2426

DvDty opened this issue Jul 27, 2022 · 1 comment

Comments

@DvDty
Copy link

DvDty commented Jul 27, 2022

Laravel added a schema:dump command in version 8: laravel/framework#32275
Running php artisan schema:dump --database=mongodb crashes with the following error:

  TypeError 

  call_user_func_array(): Argument #1 ($callback) must be a valid callback, class MongoDB\Database does not have a method "getSchemaState"

  at vendor/jenssegers/mongodb/src/Connection.php:304
    300▕      * @return mixed
    301▕      */
    302▕     public function __call($method, $parameters)
    303▕     {
  ➜ 304▕         return call_user_func_array([$this->db, $method], $parameters);
    305▕     }
    306▕ }
    307▕ 

Versions:

  • PHP 8.1
  • Laravel 9.21
  • jenssegers/mongodb 3.9.1
@GromNaN
Copy link
Member

GromNaN commented Nov 10, 2023

This Laravel feature uses mysqldump to export the database structure only.

mongodump output contains the documents in the database and the index definitions.

We could reimplement this feature using MongoDB\Collection::listIndexes(). We will have to specify our own data format. Ideally, we could directly generate a migration file to create indexes.

Tracking this feature request in PHPORM-115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants