contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
85 stars 33 forks source link

1.6.0 Database - update #718

Closed ChrMue closed 1 year ago

ChrMue commented 2 years ago

When I uncheck the checkbox only tables were not deleted. Is it possible to exclude the deletion of fields too?

aschempp commented 2 years ago

That should already be the case, but it might be a bug since we now merge operations again @ausi @m-vo ?

ChrMue commented 2 years ago

Possible that the field will not be deletete but the yellow dots are still there an so I don't dare to run the update

ausi commented 2 years ago

The issue seems to be, that when unchecking the β€œDROP” checkbox, all DROP TABLE queries get marked gray, but ALTER TABLE … DROP queries are not marked gray.

Setting the status to skipped is done here for the DROP TABLE case: https://github.com/contao/contao-manager/blob/feaa63bf2c4fe126f5e5e5910934d283e59832f5/src/components/views/Migration.vue#L214 and would probably need to be handled here too: https://github.com/contao/contao-manager/blob/feaa63bf2c4fe126f5e5e5910934d283e59832f5/src/components/views/Migration.vue#L271-L273

If the whole ALTER TABLE query only consists of DROP changes we should mark it as skipped too I think.

aschempp commented 2 years ago

well I would be curious to know whether the drop statements work as expected – the dots are not really relevant, maybe I just remove them πŸ˜†

ChrMue commented 2 years ago

Is it planned that you can, for example in a detailed view, decide individually which changes should be made?

ausi commented 2 years ago

Is it planned that you can, for example in a detailed view, decide individually which changes should be made?

No.

m-vo commented 2 years ago

Is it planned that you can, for example in a detailed view, decide individually which changes should be made?

No.

And adding to that: We intentionally removed the parsing and modifying of the generated SQL from the schema diff. Besides others, doctrine deliberately orders and groups some operations to make changes to tables with foreign key constraints work. We don't want to mess with that (anymore). :upside_down_face:

aschempp commented 2 years ago

@m-vo I know that, but will it now delete stuff even if I don't include the --with-deletes flag?

m-vo commented 2 years ago

@m-vo I know that, but will it now delete stuff even if I don't include the --with-deletes flag?

Should work like before. We're now directly adding things to the toSchema to prevent them from being in the diff and thus deleted:

https://github.com/contao/contao/blob/e7ee456282da3f0b821001ac2c571fa793dd32b7/core-bundle/src/Migration/CommandCompiler.php#L39-L58

But maybe there is still a bug in there? :thinking:

aschempp commented 2 years ago

Ah didn't know about that approach, but I guess that will work 😊

falkgeist commented 2 years ago

had the same consideration as Christian, until I dared it and realized, that its only visual. Please fix or remove the dots, its confusing the way it is.

aschempp commented 1 year ago

I have improved the visual display in 61d7e65706090c0223c5f655e7b4c180bf898c01