Skip to content

Commit 353ba16

Browse files
authored
Task/rdmp 353 delta extractions (#2303)
* allow the addition of new columns to extraction archives * update changelog * allow extraction progess with no dqe set * add option to no clone extraction progress * update changelog * fix typo
1 parent 4fcaf9d commit 353ba16

File tree

5 files changed

+48
-9
lines changed

5 files changed

+48
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [9.1.2] - Unreleased
8+
- Allow new columns to be added to archive extractions
9+
- Simplify use of Extraction Progress
10+
711
## [9.1.1] - 2025-12-02
812
- Allow Atlassian service workers to write to Confluence from RDMP
913

Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandAddExtractionProgress.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ public ExecuteCommandAddExtractionProgress(IBasicActivateItems activator, ISelec
2828
SetImpossible("Catalogue already has an ExtractionProgress");
2929
return;
3030
}
31-
32-
if (_sds.GetCatalogue()?.TimeCoverage_ExtractionInformation_ID == null)
33-
{
34-
SetImpossible("Catalogue does not have a time coverage field configured");
35-
return;
36-
}
3731
}
3832

3933
public override Image<Rgba32> GetImage(IIconProvider iconProvider) =>

Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandCloneExtractionConfiguration.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ public override void Execute()
8080
CheckForDeprecatedCatalogues();
8181

8282
var clone = _extractionConfiguration.DeepCloneWithNewIDs();
83+
if (_activeItems.IsInteractive && clone.SelectedDataSets.Any(sds => sds.ExtractionProgressIfAny != null))
84+
{
85+
if(!_activeItems.YesNo("Do you want to include this extraction's extraction progress in this clone?", "Include Extraction Progress?")) {
86+
foreach (var ep in clone.SelectedDataSets.Where(sds => sds.ExtractionProgressIfAny != null).Select(sds => sds.ExtractionProgressIfAny))
87+
{
88+
ep.DeleteInDatabase();
89+
}
90+
}
91+
}
8392
foreach (var ds in _toRemove.Cast<ExtractableDataSet>())
8493
{
8594
clone.RemoveDatasetFromConfiguration(ds);

Rdmp.Core/DataExport/DataExtraction/Pipeline/Destinations/ExecuteFullExtractionToDatabaseMSSql.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,38 @@ private DataTableUploadDestination PrepareDestination(IDataLoadEventListener lis
216216
{
217217
present = false;
218218
}
219+
//check the columns are correct, we might have added some
220+
var existingColumns = existing.DiscoverColumns();
221+
var existingColumnNames = existingColumns.Select(ec => ec.GetRuntimeName());
222+
var toProcessColumnNames = toProcess.Columns.Cast<DataColumn>().Select(col => col.ColumnName);
223+
var newColumns = toProcessColumnNames.Where(c => !existingColumnNames.Contains(c));
224+
if (newColumns.Any())
225+
{
226+
var archiveTable = _destinationDatabase.ExpectTable(tblName+"_Archive");
227+
if (archiveTable.Exists())
228+
{
229+
foreach (var column in newColumns)
230+
{
231+
existing.AddColumn(column, new TypeGuesser.DatabaseTypeRequest(toProcess.Columns[column].DataType), true, 30000);
232+
archiveTable.AddColumn(column, new TypeGuesser.DatabaseTypeRequest(toProcess.Columns[column].DataType), true,30000);
233+
}
234+
if (present)
235+
{
236+
string triggerProblems = "";
237+
string triggerOK = "";
238+
implementor.DropTrigger(out triggerProblems, out triggerOK);
239+
if(triggerProblems != "")
240+
{
241+
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Error, triggerProblems));
242+
}
243+
244+
existing = _destinationDatabase.ExpectTable(tblName);
245+
implementor = triggerFactory.Create(existing);
246+
present = false;
247+
}
248+
}
249+
}
250+
219251
if (!present)
220252
{
221253
implementor.CreateTrigger(ThrowImmediatelyCheckNotifier.Quiet);

SharedAssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
[assembly: AssemblyTrademark("")]
1111
[assembly: AssemblyCulture("")]
1212

13-
[assembly: AssemblyVersion("9.1.1")]
14-
[assembly: AssemblyFileVersion("9.1.1")]
15-
[assembly: AssemblyInformationalVersion("9.1.1")]
13+
[assembly: AssemblyVersion("9.1.2")]
14+
[assembly: AssemblyFileVersion("9.1.2")]
15+
[assembly: AssemblyInformationalVersion("9.1.2")]

0 commit comments

Comments
 (0)