Change description in flyway migration filename - flyway

I have a flyway migration script named V1_7__a_and_c.sql, but I realized that it wasn't about "a" and "c", but actually about "a" and "b", so the proper name for that file is in fact V1_7__a_and_b.sql.
Can I just rename this file, or are there consequences that may cause problems in the future?

If you rename the file, you should manually patch up the metadata table as well to avoid any validation errors.

Related

Why is object in AOT marked with red cross?

I have to extend report's query to add a new field.
I've created extension of a query, joined required datasources and can see new field in the list of fields.
For some reason the report in the AOT is displaying with red cross sign:
In properties i can see error in metadata: "There was an error reading metadata. Make sure the metadata xml file(s) are accessible, are well formed and are not corrupted with duplicate or missing xml elements.
The exception message is: Element named: 'Copy1' of type 'ModelElement' already exists among elements: 'Copy1'.
Parameter name: item
Additional information:
AOT/Reports/Reports/WHSInvent"
There is an .xml of that object in packages local directory, there are no any duplicate names in any node of that report.
Any ideas how it can be fixed?
I've run into this before and there are a two things that come to mind.
Often times it's due to an incorrect merge where changes are merged and metadata is accidentally duplicated (in your case it's possible there are two xml nodes with the same name/id in the .rdl file)
If this report is checked in with corrupt metadata, you need to manually modify the RDL file, which is not great, but hopefully the error contains enough hints. Open the report rdl file in your favourite editor (report likely located in a similar path as this: K:\AosService\PackagesLocalDirectory\YOURMODEL\Reports) and look for an xml node with an attribute Name="Copy1". With luck, you have two duplicate nodes next to each other due to the merge. Remove the offending duplicate node, save, and refresh the AOT in Visual Studio.
If the error is in your local changes only (xml file is corrupted for whatever reason) and you are sure that your source control contains the correct version and you simply wish to overwrite the local contents with the source controlled version, follow these steps. Note: this will overwrite local changes.
First, undo pending changes.
Then force a get latest:

MPXJ: Cant read field values when custom field headers are present in file

I'm using MPXJ to read Microsoft Project files (.mpp), but the current version of MPXJ (7.2.1) seems to refuse to read Lookup fields when I change a field to have a different name.
For example, create a new project, show Text1, set it to Lookup, add 0 and 1 to the Lookup list, and rename Text1 to anything ('Test'). Now generate a task and set it's Text1 (Test) to 1.
Now you can't read the 1 in Text1 (task.getText(1) returns null).
We parse many files, some of them are quite large, so it's not possible for me to continually modify our customers' headers, read them in, and then change them back. Further, I don't see any way to modify them programatically.
Has anyone else found this issue? Does anyone know how to workaround/fix this behavior?
This is a bug in MPXJ. I will be committing a fix to the MPXJ repo shortly.

Repository state Merging in JGit

I am trying to resolve the merge conflicts programmatically, i.e force merge.
After resolving merge conflicts, if i try to commit i get the below exception:
org.eclipse.jgit.api.errors.WrongRepositoryStateException: Cannot commit into a repository with state: MERGING.
How do I change the repository status or am I missing something.
Code snippet:
if((RepositoryState.SAFE == pullCommand.getRepository().getRepositoryState())) {
PullResult result = pullCommand.call();
if(MergeStatus.CONFLICTING == result.getMergeResult().getMergeStatus()){
mgCmd = git.merge();
mgCmd.include(repo.getRef("refs/remotes/origin/development"));
mgCmd.setStrategy(MergeStrategy.OURS);
mgCmd.setCommit(true);
res = mgCmd.call();
System.out.println("Failing Path ==="+res.getFailingPaths());
pullCommand.getRepository().resolve("C:\\CODE\\thin\\thinclient\\.git");
if(res.getMergeStatus().equals(MergeResult.MergeStatus.CONFLICTING)){
System.out.println("Merge status=========+++"+res.getMergeStatus());
}
The MergeCommand is not meant to resolve merge conflicts. The contrary is true, it will cause merge conflicts if the included ref(s) cannot be merged without conflicts.
The PullCommand is a composite command that first fetches commits from upstream and then tries to merge them using the MergeCommand.
In order to programmatically resolve merge conflicts, you need to change files in the local work directory accordingly, add them to the index, and then issue a merge commit.
Information about conflicting files can be found in pullResult.getMergeResult(). A merge commit can be created with the regular CommitCommand.

Doctrine migration couldn`t find non-existed class

I use doc:generate-migrations-diffto generate migration classes located in lib/migrations/. You already might know, that doc:generate-migrations-... tasks create some files in tmp directory. I had some problems with it and i delete all doctrine help files from tmp dir.
And now when I execute doc:generate-migrations-diff it fails with this message: Couldn't find class ToPrfxProduct2Site, I have Product2Site class, but there is no ToPrfxProduct2Site.
Any ideas?
Ok, i figured this out. Generating of migrations is based on existing models, so first try to find models that dont exists in your schema. For me there was Product2Site, Product2SiteTable' andBaseProduct2Site` models. Just delete this files and everything will be fine.

Autosys file watcher for a particular filename on Windows

I am trying to write a file watcher job in autosys that would watch out for a particular file. The file name format would be filename_ddmmyyyy.
The requirement is that the file comes at 7.15am everyday and the file watcher job starts running at 6.50am and the runs till 8am. If the file is received by then, job is successful else an alert is raised.
Now what I am trying to do is to watch out the file filename_ddmmyyyy for a particular day. e.g. if today is 22nd Feb 2013, the file name will be filename_22022013 and this is the file that I am looking for. If I use wildcards like filename_*, it would look for all possible files which I don't want.
I am not sure how to do this in Windows.
Any help would be much appreciated.
Let me know in case of questions.
You will need to use the profile job attribute to initalize variables when the job starts. One of these variables will need to be the date pattern you are looking for (you'll need another process that outputs that dynamically). Then once you set it to a variable in your profile script, you can refer to that variable name from within the watch_file attribute.
Create global variable as variable with date and us that variable :
example:filename_$${GV_DATE}
GV_DATE: ddmmyyyy
Pretty late to answer, but here is an answer without using global variable. You can use formatted system date variable in the file name.
File_to_watch: filename_%date:~10,4%%date:~4,2%%date:~7,2%

Resources