Is there a way to remove a migration added to sqitch? - sqitch

In sqitch there is the ADD command to add a new migration.
Is there any command to remove that ADDITION?

This is the way I do it:
revert the change from the database.
Remove it manually from the plan or plan files
Remove manually the scripts in deploy/, verify/ and revert/
My cases have been simple, so the above works without issue. I could see complications if the change you are trying to remove is required by other changes down stream. In that situation or as alternative to above I would look at creating a change that reverses the effect of the change you are trying to undo.

Related

Creating on demand workflow directly in Production instance

I need a temporary workflow to update records in Production instance. I was thinking to just create one in production directly and run it on records and delete it. Whats the best way to do it, should I just create it in customization area (i.e. Default solution) and then delete it later or create a new solution, add this work flow to that solution and then delete that solution?
Or should I create it in Dev and then move the solution to Test/Production like we normally do?
As a best practice, create it in Dev using a new Hotfix solution - test it against some Dev records. Then export the solution (may be Managed one) & deploy in Test/UAT/Prod.
Once data fix is completed in Prod using our WF, delete the Managed solution (which will delete the WF too).
If you want - you can just deactivate the WF in Prod: Settings - Processes for future usage & to maintain environments in sync.
Never customize in the default solution - unless you're working on a managed solution (of which you have no control in Dev/Test), or are looking for a full list of components in an entity without adding them to your Solution (example - when writing a plugin, you need to know the field names of OOTB fields - I go to Default Solution to get these).
You didn't tell us in the message what your Workflow should be doing, and if it needs to be done in DEV or TEST.
What I would do is build the WF in DEV or test, re-create the situation that needs to be fixed in PROD, and test it in DEV/TEST. Once you know it will work, you can either push it over as a solution (or as a part of your existing solution), or, you can simply add it to your solution in PROD and then run it as required. If you need to delete it, great, delete it. If not, just de-activate it so people don't accidentally run it.

Is rollback possible in Database-project?

I have created database project in visual studio 2013 from existing database. Then I have done lot of changes in database project like modify stored procedures, post deployment script, table structure, etc . Now database project is ready to deploy. But I am worry if any script fails then How I can retain the original state though it build properly.
Please suggest that if any query fails then I want ROLLBACK the all changes that I have made in database project.
Firstly you need to trust your tools and either believe they will work or find other tools.
While you are building the trust I would add a create backup to the pre-deployment script or run a backup before you deploy then if anything goes wrong you can restore and figure out what went wrong.
As David said to roll-back, you would get the previously deployed dacpac and generate a new deployment script from that but fixing forward is almost always the correct thing to do rather than rolling back to a previous version.
ed
Have you been checking your changes into version control? If so, all you need to do is to revert back to the last known good version.
Or... simply work out why it's failing now and fix the root cause?
I used Db projects some time ago and as far as I remember the deploy script was wrapped in a transaction. It is possible to generate sql script without executing it. That setting was somewhere in DB project settings. You can take a look inside that script and make sure that it'll rollback on error.
Doing a backup would still be a recommended practice especially when you deploy to production.
when working on important scripts I developed a habit of always starting a transaction and commenting out the commit.
If you accidentally run it, it won't take effect. The commented out commit would only come out when the thing was done.
While this answer indicates that you CAN revert in source control (Assuming SSDT at this point) it would be nice to get a pointer to the exact process to do this. On a file by file basis the history works the same but how to revert the entire database at once isn't immediately obvious.

how to prevent over writing file while 'composer update' command

I am working on laravel 5.1 project. I have updated few files for customization e.g. vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php file. It needed to install new package so I had modified composer.json and run command 'composer update' and package was installed but all the code I had updated in AuthenticatesUsers.php file was replaced with original.
How to prevent this over-writing while updating composer?
You are not supposed to edit files in the vendor folder if you also want to use Composer to easily update your dependencies. Editing files of external packages effectively means you are forking that project and maintain it yourself. This either means you only apply your change once and then stop all further development, or you constantly have to check for updates of the original package and merge their changes with your changes.
I am pretty sure there are ways to solve the underlying problem with adding changes to existing files, but your current question suffers from the XY problem - you want to add a change to Laravel but don't know how to do properly, find that editing may solve the problem, but now need to prevent overwriting that file, and ask about preventing that overwriting - instead of asking how to add change to Laravel classes.
A nice and clean solution would be to fork the repository and add it to packagist. Then simply change the composer dependency with your version of improved (so to speak) laravel's source code.

Is there any way to semi-automatically commit?

Please bear with me here, because I'm a beginner when it comes to version control systems. I've decided to start with the very simple GitHub app. What I want to do is (because I work in Dreamweaver) when I save a file a window to pop-up and ask me if I want to commit, is something like this achievable and if so... then how?
Perhaps there's a solution that uses a directory watcher to watch for changes and then prompt?
In my opinion, this isn't really a good solution though - you don't just want to use Git as a "backup" solution, you want each commit to be a mini-milestone that represents some logical group of changes. I can't think of a single instance where the first time I saved a change to a file it was commit-worthy. If you were to commit with every save, how would you ever test those changes?
I haven't used it myself but the GitWeaver extension may be what you are looking for.

Will adding .xcdatamodel/layout to the .gitignore cause problems?

When using Core Data, Xcode seems to modify the .xcdatamodel/layout file every time I view the data model. I don't want to commit that change because I haven't done anything. Is it safe to add that file to the .gitignore?
In my experiment it was safe. However, I recommend just letting git back it up. The overhead is minimal, so why should this bother you?

Resources