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

[NFR] sql export function #25

Open
ruudboon opened this issue Dec 19, 2019 · 0 comments
Open

[NFR] sql export function #25

ruudboon opened this issue Dec 19, 2019 · 0 comments
Assignees
Labels
NFR New Feature Request

Comments

@ruudboon
Copy link
Member

Sometimes it can be useful to have an export function to export a schema.
A use case could be using your migrations for your testing framework.
To setup the database for the test you want to import an sql dump. It would be great if migrations can export the latest schema without the need to run all the migrations from version 1.

For example:

vendor/bin/phalcon-migrations migrations export 

Will output a full sql dump of the latest migration. For example this could be used with Codeception in the following way.

modules:
   enabled:
      - Db:
         dsn: 'mysql:host=localhost;dbname=testdb'
         user: 'root'
         password: ''
         populate: true # run populator before all tests
         cleanup: true # run populator before each test
         populator: 'mysql -u $user -h $host $dbname < `vendor/bin/phalcon-migrations migrations export `'

Or save a specific version (1.2.1) like

vendor/bin/phalcon-migrations migrations export 1.2.1  > export.sql
@Jeckerson Jeckerson added this to the 1.2.x milestone Jan 1, 2020
@Jeckerson Jeckerson added this to Backlog in Phalcon Roadmap Jan 19, 2020
@Jeckerson Jeckerson added the NFR New Feature Request label Jan 19, 2020
@Jeckerson Jeckerson self-assigned this Feb 2, 2020
@Jeckerson Jeckerson modified the milestones: 1.2.x, 2.0.x Feb 23, 2020
@Jeckerson Jeckerson modified the milestones: 2.0.x, 2.1.x, 3.0.x Mar 19, 2020
@Jeckerson Jeckerson removed this from the 3.0.x milestone May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NFR New Feature Request
Projects
Status: Backlog
Phalcon Roadmap
  
Backlog
Development

No branches or pull requests

2 participants