Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
7de1ea08
Commit
7de1ea08
authored
Oct 26, 2010
by
Andreas Kusalananda Kähäri
Browse files
Add code to catch diffing descriptions and display_labels in
analysis_description.
parent
eccac333
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
3 deletions
+54
-3
misc-scripts/production_database/scripts/push_analysis_descriptions.pl
...production_database/scripts/push_analysis_descriptions.pl
+54
-3
No files found.
misc-scripts/production_database/scripts/push_analysis_descriptions.pl
View file @
7de1ea08
...
...
@@ -155,7 +155,6 @@ foreach my $server (@servers) {
$dbh
->
quote
(
lc
(
$logic_name
),
SQL_VARCHAR
),
$dbh
->
quote
(
$logic_name
,
SQL_VARCHAR
)
)
);
}
if
(
!
exists
(
$master
{
lc
(
$logic_name
)
}
)
)
{
...
...
@@ -186,10 +185,62 @@ foreach my $server (@servers) {
'
description
'
=>
$description
,
'
display_label
'
=>
$display_label
};
}
## end if ( !exists( $master{...}))
}
else
{
# Compare all fields.
if
(
$description
ne
$master
{
lc
(
$logic_name
)
}{'
description
'}
)
{
# Description differs.
printf
(
"
==> Description differs for logic_name '%s':
\n
",
$logic_name
);
printf
(
"
==> In table:
\t
%s
\n
",
$description
);
printf
(
"
==> In master:
\t
%s
\n
",
$master
{
lc
(
$logic_name
)
}{'
description
'}
);
push
(
@
{
$sql
{
$dbname
}
},
sprintf
(
"
UPDATE TABLE %s ad, %s a
\n\t
"
.
"
SET ad.description = %s
\n\t
"
.
"
WHERE a.logic_name = %s
\n\t
"
.
"
AND ad.analysis_id = a.analysis_id
",
$dbh
->
quote_identifier
(
undef
,
$dbname
,
'
analysis_description
'
),
$dbh
->
quote_identifier
(
undef
,
$dbname
,
'
analysis
'
),
$dbh
->
quote
(
$description
,
SQL_VARCHAR
),
$dbh
->
quote
(
$logic_name
,
SQL_VARCHAR
)
)
);
}
if
(
$display_label
ne
$master
{
lc
(
$logic_name
)
}{'
display_label
'}
)
{
# Display label differs.
printf
(
"
==> display_label differs for logic_name '%s':
\n
",
$logic_name
);
printf
(
"
==> In table:
\t
%s
\n
",
$display_label
);
printf
(
"
==> In master:
\t
%s
\n
",
$master
{
lc
(
$logic_name
)
}{'
display_label
'}
);
push
(
@
{
$sql
{
$dbname
}
},
sprintf
(
"
UPDATE TABLE %s ad, %s a
\n\t
"
.
"
SET ad.display_label = %s
\n\t
"
.
"
WHERE a.logic_name = %s
\n\t
"
.
"
AND ad.analysis_id = a.analysis_id
",
$dbh
->
quote_identifier
(
undef
,
$dbname
,
'
analysis_description
'
),
$dbh
->
quote_identifier
(
undef
,
$dbname
,
'
analysis
'
),
$dbh
->
quote
(
$display_label
,
SQL_VARCHAR
),
$dbh
->
quote
(
$logic_name
,
SQL_VARCHAR
)
)
);
}
## end if ( $display_label ne...)
}
## end else [ if ( !exists( $master{...}))]
}
## end while ( $sth2->fetch() )
}
## end while ( $sth->fetch() )
}
## end foreach my $dbtype (@dbtypes)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment