Skip to content

Will there be auto-migrations generator like in DoctrineMigrations? #403

Closed

Description

@idchlife

Hi! Right now without auto-migrations I'm wondering, is there easy way to just collect SQL from syncing and just save it into file?

Activity

  1. pleerock commented on Apr 13, 2017

    @pleerock
    Member

    This is must-have feature and I plan to do it. However right now there so many other issues needs to be resolved, my hands just didnt touch this part yet.

  2. idchlife commented on Apr 13, 2017

    @idchlife
    ContributorAuthor

    @pleerock got it, thanks!

  3. pleerock commented on Jun 19, 2017

    @pleerock
    Member

    basic migration generation functionality is landed since 0.1.0-alpha.17. It has some features missing plus it do not generate sql for down method yet. Start testing it 🏭 Use migrations:generate command to generate migration.

  4. GuillaumeNury commented on Jun 22, 2017

    @GuillaumeNury

    @pleerock Awesome work !
    I tried migrations:generate in 0.1.0-alpha-19. Migration script contains all what is needed to update/add/remove columns, but he does not have anything about creating missing table.

  5. vance commented on Jul 19, 2017

    @vance

    Any good way to configure it with naming strategy?

  6. pleerock commented on Jul 21, 2017

    @pleerock
    Member

    @GuillaumeNury hmm thats strange, are you sure about it? It should create schema for new entities as well. Maybe you forgot to specify your entities in orm configuration?

    @vance what do you mean?

  7. ddyrcz commented on Aug 13, 2017

    @ddyrcz

    Is there any instruction how to use the migrations:generate command?

  8. added this to the 0.2.0 milestone on Oct 17, 2017
  9. yoz commented on Jan 23, 2018

    @yoz

    @vance maybe see #1482?

  10. AlexMesser commented on Feb 28, 2018

    @AlexMesser
    Collaborator

    fixed and released in [email protected]. You can try it via npm i typeorm@next.

  11. LogansUA commented on Aug 3, 2018

    @LogansUA

    @pleerock Sorry for popping this issue up but question is still remain for me.

    Can we somehow collect all synching queries and write them to some file?

    For now the only way I see to write custom logger and define method logQuery but filter those which are SELECT/DELETE/UPDATE. Is there better way to do it?

  12. pleerock commented on Aug 4, 2018

    @pleerock
    Member

    yes we can, there is a migration:generate command that you can use, see CLI documentation.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions