coded the correct upgrade script

This commit is contained in:
daviddelikat 2009-10-01 00:03:54 -05:00
parent 09c39a8343
commit 88490bb329
2 changed files with 83 additions and 0 deletions

View file

@ -35,6 +35,7 @@ fixEMSTemplates( $session );
removeOldSubscriptionTables( $session );
removeSQLFormTables( $session );
fixBadRevisionDateColumns( $session );
addEMSSubmission( $session );
finish($session); # this line required
@ -100,6 +101,59 @@ sub fixEMSTemplates {
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add tables for the EMS Submission feature
sub addEMSSubmission {
my $session = shift;
print "\tAdding EMS Submission feature..." unless $quiet;
$session->db->write( <<'ESQL' );
CREATE TABLE EMSSubmissionForm (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
nextSubmissionId INT,
canSubmitGroupId CHAR(22) BINARY,
daysBeforeCleanup INT,
deleteCreatedItems INT(1),
formDescription TEXT,
PRIMARY KEY ( assetId, revisionDate )
)
ESQL
$session->db->write( <<'ESQL' );
CREATE TABLE EMSSubmission (
assetId CHAR(22) BINARY NOT NULL,
revisionDate BIGINT NOT NULL,
submissionId INT NOT NULL,
price FLOAT,
seatsAvailable INT,
startDate DATETIME,
duration FLOAT,
eventNumber INT,
location CHAR(100),
relatedBadgeGroups MEDIUMTEXT,
relatedRibbons MEDIUMTEXT,
eventMetaData MEDIUMTEXT,
sendEmailOnChange INT(1),
PRIMARY KEY ( assetId, revisionDate )
)
ESQL
$session->db->write( q{ ALTER TABLE EventManagementSystem
ADD COLUMN eventSubmissionTemplateId CHAR(22) BINARY; });
$session->db->write( q{ ALTER TABLE EventManagementSystem
ADD COLUMN viewEventSubmissionQueueTemplateId CHAR(22) BINARY; });
$session->db->write( q{ ALTER TABLE EventManagementSystem
ADD COLUMN editEventSubmissionTemplateId CHAR(22) BINARY; });
$session->db->write( q{ ALTER TABLE EventManagementSystem
ADD COLUMN eventSubmissionGroups MEDIUMTEXT; });
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------

View file

@ -107,6 +107,30 @@ sub definition {
hoverHelp => $i18n->get('print ticket template help'),
namespace => 'EMS/PrintTicket',
},
eventSubmissionTemplateId => {
fieldType => 'template',
defaultValue => 'yBwydfooiLvhEFawJb0VTQ',
tab => 'display',
label => $i18n->get('print ticket template'),
hoverHelp => $i18n->get('print ticket template help'),
namespace => 'EMS/PrintTicket',
},
viewEventSubmissionQueueTemplateId => {
fieldType => 'template',
defaultValue => 'yBwydfooiLvhEFawJb0VTQ',
tab => 'display',
label => $i18n->get('print ticket template'),
hoverHelp => $i18n->get('print ticket template help'),
namespace => 'EMS/PrintTicket',
},
editEventSubmissionTemplateId => {
fieldType => 'template',
defaultValue => 'yBwydfooiLvhEFawJb0VTQ',
tab => 'display',
label => $i18n->get('print ticket template'),
hoverHelp => $i18n->get('print ticket template help'),
namespace => 'EMS/PrintTicket',
},
badgeInstructions => {
fieldType => 'HTMLArea',
defaultValue => $i18n->get('default badge instructions'),
@ -142,6 +166,11 @@ sub definition {
label => $i18n->get('registration staff group'),
hoverHelp => $i18n->get('registration staff group help'),
},
eventSubmissionGroups => {
fieldType => 'hidden',
defaultValue => '',
noFormPost => 1,
},
);
push(@{$definition}, {
assetName=>$i18n->get('assetName'),