From 2addcaadedfe714bd0502911cc85cdab24736465 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Sun, 18 Jul 2010 19:17:26 +0200 Subject: Bug 119703: Create an attachment by pasting it into a text field r/a=mkanat --- Bugzilla/Install/DB.pm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Bugzilla/Install') 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__ -- cgit v1.2.3-24-g4f1b