You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Could you please clarify for me the relation between schema:sync and migrations?
I expected migrations:create to diff my entities and write a revertible migrations file but it doesn't.
Schema:sync is not usable in web services since we can't allow uncontrolled db changes.
So my question is: Do I have to write RAW sql in migrations for CREATE TABLE ...? Can I refer to my Entity and build CREATE TABLE ... query from Entity metadata?
I mean, queryRunner can create a table using schema. How can I get that schema from my entity?
Thank you for such a good framework. I love it.
Thanks.
Do I have to write RAW sql in migrations for CREATE TABLE ...?
yes, you do have
Can I refer to my Entity and build CREATE TABLE ... query from Entity metadata?
I have a plan to add facade interface to make it easily, but for now you have to handle it by yourself exploring internal api. Expect this improvement in the near future.
migrations:create
this command simply creates a file with migrations where you can write migration queries. I think in the future we will have ability to generate those migrations using cli.
Would love to see automatic generation of migrations. For the forward/up migration would it be as simple as pulling the logic form schema:sync into the file generation?
@pleerock I noticed master has initial support for migration generation but the PostgresQueryRunner doesn't respect sqlMemoryMode yet. Would you be open to a PR that adds support (mimicking how it's implemented in the MysqlQueryRunner), or is there an issue with that pattern for Postgres?
Also, super stoked to see this feature making it's way in!
yeah there is experimental support for mysql already, but not for other drivers yet. Would be great if community will help to implement it in other drivers as well
Activity
pleerock commentedon Feb 3, 2017
Hi,
yes, you do have
I have a plan to add facade interface to make it easily, but for now you have to handle it by yourself exploring internal api. Expect this improvement in the near future.
this command simply creates a file with migrations where you can write migration queries. I think in the future we will have ability to generate those migrations using cli.
llwt commentedon Mar 6, 2017
Would love to see automatic generation of migrations. For the forward/up migration would it be as simple as pulling the logic form schema:sync into the file generation?
pleerock commentedon Mar 7, 2017
@llwt yes it should be something like that. I also would like to see automatic migration generation, thats a feature for the future.
llwt commentedon Jul 20, 2017
@pleerock I noticed master has initial support for migration generation but the
PostgresQueryRunnerdoesn't respectsqlMemoryModeyet. Would you be open to a PR that adds support (mimicking how it's implemented in theMysqlQueryRunner), or is there an issue with that pattern for Postgres?Also, super stoked to see this feature making it's way in!
pleerock commentedon Jul 21, 2017
yeah there is experimental support for mysql already, but not for other drivers yet. Would be great if community will help to implement it in other drivers as well
pleerock commentedon Jul 21, 2017
I'll close this issue in favour of #403