Bugzilla – Attachment 94801 Details for
Bug 23805
Add a dedicated credit_types table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23805: (follow-up) Database update corrections
Bug-23805-follow-up-Database-update-corrections.patch (text/plain), 2.19 KB, created by
Martin Renvoize (ashimema)
on 2019-10-26 06:50:00 UTC
(
hide
)
Description:
Bug 23805: (follow-up) Database update corrections
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-26 06:50:00 UTC
Size:
2.19 KB
patch
obsolete
>From a53641328c7f20ae5de9de246fb6f3a1d3edf80c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Sat, 26 Oct 2019 07:48:49 +0100 >Subject: [PATCH] Bug 23805: (follow-up) Database update corrections > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/updatedatabase.pl | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index c606cae496..a0c00b43fb 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -20015,9 +20015,8 @@ if ( CheckVersion($DBversion) ) { > qq{ > ALTER TABLE > accountlines >- ADD CONSTRAINT >+ DROP CHECK > `accountlines_check_type` >- CHECK (credit_type_code IS NOT NULL OR debit_type_code IS NOT NULL) > } > ); > >@@ -20073,19 +20072,35 @@ if ( CheckVersion($DBversion) ) { > # Populating credit_type_code > $dbh->do( > qq{ >- UPDATE accountlines SET credit_type_code = accounttype, accounttype = NULL WHERE accounttype IN (SELECT code from account_credit_types) >+ UPDATE >+ accountlines >+ SET >+ credit_type_code = accounttype, accounttype = NULL >+ WHERE accounttype IN (SELECT code from account_credit_types) > } > ); > > # Adding a check constraints to accountlines > $dbh->do( > qq{ >- ALTER TABLE accountlines ADD CONSTRAINT `accountlines_check_type` CHECK (accounttype IS NOT NULL OR credit_type_code IS NOT NULL) >+ ALTER TABLE >+ accountlines >+ ADD CONSTRAINT >+ `accountlines_check_type` >+ CHECK (credit_type_code IS NOT NULL OR debit_type_code IS NOT NULL) >+ } >+ ); >+ >+ # Drop accounttype field >+ $dbh->do( >+ qq{ >+ ALTER TABLE accountlines >+ DROP COLUMN `accounttype` > } > ); > > SetVersion($DBversion); >- print "Upgrade to $DBversion done (Bug 23049 - Add account credit_types)\n"; >+ print "Upgrade to $DBversion done (Bug 23805 - Add account credit_types)\n"; > } > > # SEE bug 13068 >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23805
:
94153
|
94154
|
94155
|
94156
|
94157
|
94158
|
94159
|
94160
|
94161
|
94162
|
94163
|
94164
|
94166
|
94167
|
94168
|
94169
|
94170
|
94171
|
94172
|
94173
|
94174
|
94175
|
94176
|
94177
|
94178
| 94801 |
94815
|
94832
|
94895