summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-07-18 19:17:26 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2010-07-18 19:17:26 +0200
commit2addcaadedfe714bd0502911cc85cdab24736465 (patch)
tree0e58e2ce48866cdf7198d7d45df1348bf1e0859a /Bugzilla/Install
parentaef5cb18c3f2f6e1a438faed08e944af9db4847c (diff)
downloadbugzilla-2addcaadedfe714bd0502911cc85cdab24736465.tar.gz
bugzilla-2addcaadedfe714bd0502911cc85cdab24736465.tar.xz
Bug 119703: Create an attachment by pasting it into a text field
r/a=mkanat
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r--Bugzilla/Install/DB.pm19
1 files changed, 15 insertions, 4 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index 225e862de..33f37208f 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -429,10 +429,6 @@ sub update_table_definitions {
# PUBLIC is a reserved word in Oracle.
$dbh->bz_rename_column('series', 'public', 'is_public');
- # 2005-09-28 bugreport@peshkin.net Bug 149504
- $dbh->bz_add_column('attachments', 'isurl',
- {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 0});
-
# 2005-10-21 LpSolit@gmail.com - Bug 313020
$dbh->bz_add_column('namedqueries', 'query_type',
{TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 0});
@@ -630,6 +626,9 @@ sub update_table_definitions {
$dbh->bz_alter_column('products', 'allows_unconfirmed',
{ TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'TRUE' });
+ # 2010-07-18 LpSolit@gmail.com - Bug 119703
+ _remove_attachment_isurl();
+
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
@@ -3401,6 +3400,18 @@ sub _fix_series_creator_fk {
}
}
+sub _remove_attachment_isurl {
+ my $dbh = Bugzilla->dbh;
+
+ if ($dbh->bz_column_info('attachments', 'isurl')) {
+ # Now all attachments must have a filename.
+ $dbh->do('UPDATE attachments SET filename = ? WHERE isurl = 1',
+ undef, 'url.txt');
+ $dbh->bz_drop_column('attachments', 'isurl');
+ $dbh->do("DELETE FROM fielddefs WHERE name='attachments.isurl'");
+ }
+}
+
1;
__END__