Is there any way Flyway Undo As per Installed rank instead of version? - flyway

As per the current implementation flyway undo happens as per
Undo all migrations equal and above target version
In the reverse order of migration - (descending order of installed_rank).
Here I have the migration order as 3,1,2,4. When I am saying Undo -target 1, undo happens in the order 4,2,1,3.
My requirement here is when I say Undo -target 1, it should undo only 4,2,1, NOT 3.
Right now I have the option to do cheryyPick, which will help me to implement the above solution. But in my production environment, I may have around 200-300 scripts for a major release. So adding everything to cherryPick is going to be a tedious task for me.
Ideal solution for me to pick 'installed_rank' in place of 'version'. For e.g. in the above scenario, if I say Undo -target=2(installed_rank) then flyway is going to undo installed rank 4,3,2 - that's versions 4,2,1.
Can anyone help me implement the above solution?

Related

Do not release all feature already merged into dev branch

We have 2 features A and B already merged into dev branch, branch dev using for test environment and both 2 features are tested. Now we just want to release only feature A, how to do it ? Did our git flow is wroong ?
Your git-flow looks fine so far. It is simply not meant to be used to release develop partially.
Whatever gets merged onto develop is meant to be released.
Here are some solutions you could use:
(1) Do not merge (or better don't even start working on it) a feature until you want to release it.
(2) If you want to merge unfinished features add a feature toggle to easily turn on and off whatever is on develop.
Heads-up: not everyone thinks this is good software design - me included. But for the sake of completeness I wanted to mention it.
(3) Also not a good approach but technically possible: Revert the features you don't want to release on your release branch. This might be your only option now if you don't want to re-write the commit history (which you should not).
(4) Create a new release branch starting at the commit just before feature B was merged in and cherry-pick feature A into that release branch.

Apply Entity Framework migration as a patch

I am using Entity Framework Code First migrations to control my database versioning. We have encountered a critical issue in production, which was already noticed and fixed in QA environment, but now needs to be applied to PROD.
The problem is that current latest PROD migration is far not the one that precedes the one we need to apply to fix the issue. I.e., the latest one in PROD is, for example, Migration1. Since that, we have developed Migration2, Migration3, ..., MigrationN-1, MigrationN, MigrationN+1, ... We need to apply MigrationN to PROD, but we cannot apply all intermediate ones, as they are not yet releasable (we are sure, though, that MigrationN can be applied to PROD, as it is not based on any of intermediate ones).
We can cherry-pick the relevant application code changes and prepare a hot-fix deployment, but we cannot do the same with migrations, as if after that we want to have a regular deployment, all intermediate migrations (2 - N-1) will then be ignored, if I get it right.
What should we do?

Packing Plone data

I am new to Plone and trying to learn how to setup and maintain a server. I realize I need to develop a schedule for packing the data. Right now I am just trying to test this using the pack function in the Zope control panel and also the command line (bin/zeopack).
I know in practice I should leave a week's worth of history, but if I pack to 0 days shouldn't I see all edit history disappear? I am not seeing this happen. What am I doing wrong?
You may be confusing the "undo" history with the version history. Packing the database gets rid of old, unused data. That eliminates your ability to undo older transactions.
Version history is not the same. Version history is not considered unused data, and is not eliminated in packs.
If you don't want edit history, turn off versioning.

SVN in ASP.NET with Ankh basics for day-to-day usage

My team now has an SVN + Ankh setup in ASP.NET with trunk, branches, and tags. We switch branches and work on code, but many times there will be inexplicable conflicts in files after simple changes. Why is this? I suspect we simply don't understand enough of how this works. Are there any do's and don'ts, or how should we be approaching our daily changes and commits, without causing conflicts? Is there a basic pecking order of operations to perform to achieve SVN zen? Are we updating before committing or something? Any help is greatly appreciated.
Always update before commit. If you really work with branches don't use switch or only if you really undstand the switch command and how it works otherwise checkout a branch into a fresh working copy in other words create a new one.
Always branch, merge on the solution element, make sure you're fully up to date before merging (ankhsvn will warn about this), also make sure you have no modified files before merging.
Read up on svnbook for when to use normal merging and when to use reintegrate.
Finally, if a conflict does occur, make sure you have a good 3way merge tool to solve the conflict. AnkhSVN recognizes a lot of them automatically, but I really like source gear diffmerge

Only increase build number for formal release?

what's your strategy to increase build number?
Most software has a hierarchy of version numbers:
The "marketing" version number (like "Windows 7")
The major version number - usually incremented when there's a major new version that breaks some compatibility with a previous version, adds a major new capability, requires purchasing an upgrade, or more.
The minor version number - upgraded every time there's a bug-fix or minor feature enhancement that's released to the public
The build number - this should be incremented every time any change is made to the program, so that if someone finds a problem in a nightly build or beta-test version, you can identify exactly which version was being tested. This number is often a revision number directly from your version control system like Subversion, or a timestamp, or something similar that makes it easy for you to roll back the code to that version if necessary.
All the dlls must have the same version number for one release.
Build number consists of "MajorVersion.MinorVersion.BuildNumber.Revision", usually I keep the Revision Number to be 0. Only the first 3 numbers are changed.
For every nightly build, BuildNumber will be incremented automatically. I will manually increase majorversion and minorversion if the changes are sufficiently big.
Every checkin should be tagged a version, use the subversion current version as the part of the build exe version.
It's quite reasonable to increase the build number for just every build. This way testers can tell more exactly which build they find a bug in and when it is verified to be fixed.
We have a build number that's incremented on every build (formal or otherwise). We use a CruiseControl.NET labeller for this.
We have a version number that's incremented by hand only on formal releases, and we define that centrally in one of the CC.NET scripts, which are held in source control.
Like everyone says, increment the build number for every build. We set the major/minor numbers by hand when we do a branch, a branch is usually done a few weeks before release, then that branch gets regression tested. Builds done on the branch still get incremented though.

Resources