Is it possible to run the task “symfony doctrine b

2019-02-19 17:34发布

If I run the folowing task, it builds everything and wipes out the database:

php symfony doctrine build --all

I would like this task to run only for the new table that I've put in schema.yml

Is it possible ?

1条回答
姐就是有狂的资本
2楼-- · 2019-02-19 18:14

I think you should use migration for that.

First, you need to restore the initial state (when schema, model and db are in sync). Remove your changes form schema.yml rebuild your model php symfony doctrine:build --all-classes and import the original database.

After that make your changes in schema.yml and run these commands:

php symfony doctrine:generate-migrations-diff
php symfony doctrine:migrate
php symfony doctrine:build --all-classes
查看更多
登录 后发表回答