Add a sqitch remove command #53

Open
rdunklau opened this Issue Oct 18, 2012 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

rdunklau commented Oct 18, 2012

It would be useful to have a remove command.

This command would take a change name, remove it from the plan and remove the associated deploy, revert and test script.

This should only work when no other change has a dependency on the named change.

@theory theory removed this from the v1.0.0 milestone Aug 26, 2014

@theory theory referenced this issue Jan 10, 2017

Closed

sqitch remove #295

chamini2 commented Feb 2, 2017

I was thinking of the remove command like a git revert, it should run the revert for the specified migration and add a line in the plan like in the following example:

tables/products/create # Creating the products table
tables/tags/create # Creating the tags table
tables/product_is_tagged/create [tables/tags/create tables/products/create] # Creating an intermediate table to link products to tags
@1.0.0 2017-01-10 ... # First release

Then deciding the tags table will be of no use after all:

$ sqitch remove tables/tags/create
The following migrations would be removed:
tables/product_is_tagged/create
tables/tags/create
Remove migrations? [Yes]

And this would only change the .plan file, making it look like the following:

tables/products/create # Creating the products table
tables/tags/create # Creating the tags table
tables/product_is_tagged/create [tables/tags/create tables/products/create] # Creating an intermediate table to link products to tags
@1.0.0 2017-01-10 ... # First release
REMOVE tables/product_is_tagged/create
REMOVE tables/tags/create

And running the deploy is what really drops the tables (running the reverts):

$ sqitch deploy
REMOVE tables/product_is_tagged/create ..... ok
REMOVE tables/tags/create .................. ok
Owner

theory commented Feb 2, 2017

You might be interested in #21, @chamini2, where I mention that there is already syntax for adding revert changes to the plan file, but I haven't through through the ramifications of how it ought to work. I would consider that separate from this issue, though, where I think the idea is just to remove a change from the plan file.

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