Upgrade all database tables that use JSON to be LONGTEXT instead of what they were.

Addresses bug #10825
This commit is contained in:
Colin Kuskie 2009-08-25 21:42:16 +00:00
parent d0dd47a5a4
commit 7fcb339605
5 changed files with 49 additions and 3 deletions

View file

@ -1,4 +1,5 @@
7.7.19 7.7.19
- fixed #10825: Text and MediumText fields should be LongText
- fixed #10808: Ask user about using rich edit option causes error in IE6 - fixed #10808: Ask user about using rich edit option causes error in IE6
- fixed #10822: spectre pid sucks - fixed #10822: spectre pid sucks
- fixed #10817: Datatable not internationalized - fixed #10817: Datatable not internationalized

View file

@ -32,9 +32,9 @@ my $session = start(); # this line required
# upgrade functions go here # upgrade functions go here
addInboxSmsNotificationTemplateIdSetting($session); addInboxSmsNotificationTemplateIdSetting($session);
upgradeJSONDatabaseFields($session);
finish($session); # this line required finish($session); # this line required
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Describe what our function does # Describe what our function does
#sub exampleFunction { #sub exampleFunction {
@ -53,6 +53,45 @@ sub addInboxSmsNotificationTemplateIdSetting {
print "DONE!\n" unless $quiet; print "DONE!\n" unless $quiet;
} }
sub upgradeJSONDatabaseFields {
my $session = shift;
print "\tUpgrading all fields which use JSON to LONGTEXT... " unless $quiet;
print "\n\t\tUpgrading Sku fields... " unless $quiet;
$session->db->write(q|ALTER TABLE sku MODIFY taxConfiguration LONGTEXT|);
print "\n\t\tUpgrading Product fields... " unless $quiet;
$session->db->write(q|ALTER TABLE Product MODIFY variantsJSON LONGTEXT|);
$session->db->write(q|ALTER TABLE Product MODIFY accessoryJSON LONGTEXT|);
$session->db->write(q|ALTER TABLE Product MODIFY relatedJSON LONGTEXT|);
$session->db->write(q|ALTER TABLE Product MODIFY specificationJSON LONGTEXT|);
$session->db->write(q|ALTER TABLE Product MODIFY featureJSON LONGTEXT|);
$session->db->write(q|ALTER TABLE Product MODIFY benefitJSON LONGTEXT|);
print "\n\t\tUpgrading DataForm fields... " unless $quiet;
$session->db->write(q|ALTER TABLE DataForm MODIFY fieldConfiguration LONGTEXT|);
$session->db->write(q|ALTER TABLE DataForm MODIFY tabConfiguration LONGTEXT|);
print "\n\t\tUpgrading DataForm entry fields... " unless $quiet;
$session->db->write(q|ALTER TABLE DataForm_entry MODIFY entryData LONGTEXT|);
print "\n\t\tUpgrading Scheduler fields... " unless $quiet;
$session->db->write(q|ALTER TABLE WorkflowSchedule MODIFY parameters LONGTEXT|);
print "\n\t\tUpgrading Workflow Instance fields... " unless $quiet;
$session->db->write(q|ALTER TABLE WorkflowInstance MODIFY parameters LONGTEXT|);
print "\n\t\tUpgrading AssetAspect Comments fields... " unless $quiet;
$session->db->write(q|ALTER TABLE assetAspectComments MODIFY comments LONGTEXT|);
print "\n\t\tUpgrading Thingy Record fields... " unless $quiet;
$session->db->write(q|ALTER TABLE ThingyRecord MODIFY fieldPrice LONGTEXT|);
print "\n\t\tUpgrading Payment Gateway fields... " unless $quiet;
$session->db->write(q|ALTER TABLE paymentGateway MODIFY options LONGTEXT|);
print "\n\t\tUpgrading Shipping driver fields... " unless $quiet;
$session->db->write(q|ALTER TABLE shipper MODIFY options LONGTEXT|);
print "\n\t\tUpgrading Tax Driver fields... " unless $quiet;
$session->db->write(q|ALTER TABLE taxDriver MODIFY options LONGTEXT|);
print "\n\t\tUpgrading Transaction Item fields... " unless $quiet;
$session->db->write(q|ALTER TABLE transactionItem MODIFY options LONGTEXT|);
$session->db->write(q|ALTER TABLE transactionItem MODIFY taxConfiguration LONGTEXT|);
print "\n\t\tUpgrading Cart Item fields... " unless $quiet;
$session->db->write(q|ALTER TABLE cartItem MODIFY options LONGTEXT|);
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- # -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View file

@ -153,31 +153,37 @@ sub definition {
##Collateral data is stored as JSON in here ##Collateral data is stored as JSON in here
autoGenerate => 0, autoGenerate => 0,
defaultValue => '[]', defaultValue => '[]',
fieldType=>"textarea",
}, },
accessoryJSON => { accessoryJSON => {
##Collateral data is stored as JSON in here ##Collateral data is stored as JSON in here
autoGenerate => 0, autoGenerate => 0,
defaultValue => '[]', defaultValue => '[]',
fieldType=>"textarea",
}, },
relatedJSON => { relatedJSON => {
##Collateral data is stored as JSON in here ##Collateral data is stored as JSON in here
autoGenerate => 0, autoGenerate => 0,
defaultValue => '[]', defaultValue => '[]',
fieldType=>"textarea",
}, },
specificationJSON => { specificationJSON => {
##Collateral data is stored as JSON in here ##Collateral data is stored as JSON in here
autoGenerate => 0, autoGenerate => 0,
defaultValue => '[]', defaultValue => '[]',
fieldType=>"textarea",
}, },
featureJSON => { featureJSON => {
##Collateral data is stored as JSON in here ##Collateral data is stored as JSON in here
autoGenerate => 0, autoGenerate => 0,
defaultValue => '[]', defaultValue => '[]',
fieldType=>"textarea",
}, },
benefitJSON => { benefitJSON => {
##Collateral data is stored as JSON in here ##Collateral data is stored as JSON in here
autoGenerate => 0, autoGenerate => 0,
defaultValue => '[]', defaultValue => '[]',
fieldType=>"textarea",
}, },
); );
push(@{$definition}, { push(@{$definition}, {

View file

@ -96,7 +96,7 @@ sub definition {
}, },
fieldPrice => { fieldPrice => {
tab => "properties", tab => "properties",
fieldType => "text", fieldType => "textarea",
customDrawMethod => 'drawEditFieldPrice', customDrawMethod => 'drawEditFieldPrice',
label => $i18n->get( 'fieldPrice label' ), label => $i18n->get( 'fieldPrice label' ),
hoverHelp => $i18n->get( 'fieldPrice description'), hoverHelp => $i18n->get( 'fieldPrice description'),

View file

@ -163,7 +163,7 @@ sub definition {
defaultValue => '', defaultValue => '',
}, },
photo => { photo => {
fieldType => 'text', fieldType => 'textarea',
defaultValue => '[]', defaultValue => '[]',
noFormPost => 1, noFormPost => 1,
}, },