Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
db-import
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
db-import
Commits
9134fbc7
Commit
9134fbc7
authored
Sep 1, 2022
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] Synchro : la colonne 'source_id' peut être présente dans la table/vue source.
parent
1ac56607
No related branches found
No related tags found
No related merge requests found
Pipeline
#15979
passed
Sep 2, 2022
Stage: publish
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
src/UnicaenDbImport/CodeGenerator/Helper/TableHelper.php
+12
-2
12 additions, 2 deletions
src/UnicaenDbImport/CodeGenerator/Helper/TableHelper.php
with
16 additions
and
2 deletions
CHANGELOG.md
+
4
−
0
View file @
9134fbc7
Changelog
=========
5.
2.2
-----
-
[FIX] Synchro : la colonne 'source_id' peut être présente dans la table/vue source.
5.
2.1
-----
-
[FIX] Dysfonctionnement total de la synchro avec table intermédiaire lorsque le 'code' de la source est spécifié dans la config
...
...
This diff is collapsed.
Click to expand it.
src/UnicaenDbImport/CodeGenerator/Helper/TableHelper.php
+
12
−
2
View file @
9134fbc7
...
...
@@ -342,6 +342,8 @@ EOT;
$diffViewName
=
$this
->
generateDiffViewName
(
$destinationTable
);
$now
=
$this
->
platform
->
getNowExpression
();
$sourceIdExistsInColumns
=
in_array
(
'source_id'
,
$columns
)
||
in_array
(
'SOURCE_ID'
,
$columns
);
$useSequenceForId
=
true
;
if
(
$idColumnSequence
===
false
)
{
// si false est spécifié comme nom de séquence pour la colonne 'id', le type de cette colonne devra être
...
...
@@ -358,11 +360,15 @@ EOT;
// génération des noms de colonnes de la table destination pour l'INSERT.
$destinationColumns
=
$columns
;
if
(
!
$sourceIdExistsInColumns
)
{
array_unshift
(
$destinationColumns
,
'source_id'
,
);
}
array_unshift
(
$destinationColumns
,
$createdOnCol
,
$createdByCol
,
$sourceCodeColumn
,
'source_id'
,
);
if
(
$useSequenceForId
)
{
array_unshift
(
$destinationColumns
,
...
...
@@ -374,11 +380,15 @@ EOT;
$selectExpressions
=
array_map
(
function
(
string
$columnName
)
{
return
Synchro
::
V_DIFF_SRC_COLUMN_PREFIX
.
strtoupper
(
$columnName
);
},
$columns
);
if
(
!
$sourceIdExistsInColumns
)
{
array_unshift
(
$destinationColumns
,
'source_id'
,
);
}
array_unshift
(
$selectExpressions
,
$now
,
$createdByValue
!==
null
?
$createdByValue
:
'NULL'
,
$sourceCodeColumn
,
'source_id'
,
);
if
(
$useSequenceForId
)
{
$idExpr
=
$this
->
generateSQLForSequenceNextVal
(
$idColumnSequence
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment