@Override
public UpdateRunningStatus runUpdate()
{
if (dao.doEntitiesExist(TeamEventAttachmentDO.class) == false) {
dao.dropTable(new Table(TeamEventAttendeeDO.class).getName()); // Table wasn't in use yet.
new SchemaGenerator(dao).add(TeamEventDO.class, TeamEventAttendeeDO.class, TeamEventAttachmentDO.class).createSchema();
}
if (dao.doTableAttributesExist(TeamEventDO.class, newEventAttributes52) == false) {
dao.addTableAttributes(TeamEventDO.class, newEventAttributes52);
}
if (dao.doTableAttributesExist(TeamEventAttendeeDO.class, "number") == false) {
dao.addTableAttributes(TeamEventAttendeeDO.class, "number");
}
return UpdateRunningStatus.DONE;
}
});
// /////////////////////////////////////////////////////////////////
// 5.1
// /////////////////////////////////////////////////////////////////
list.add(new UpdateEntryImpl(
TeamCalPlugin.ID,
"5.1",
"2013-04-25",
"Increase length of T_PLUGIN_CALENDAR_EVENT.NOTE (255-4000), re-create T_PLUGIN_CALENDAR_EVENT_ATTENDEE, add external subscription features (T_EVENT.abo*).") {
final Table eventTable = new Table(TeamEventDO.class);
@Override
public UpdatePreCheckStatus runPreCheck()
{
// Does the data-base table already exist?
if (dao.doTableAttributesExist(TeamEventAttendeeDO.class, "commentOfAttendee") == true
&& dao.doTableAttributesExist(TeamCalDO.class, newEventAttributes51) == true) {
return UpdatePreCheckStatus.ALREADY_UPDATED;
} else {
return UpdatePreCheckStatus.READY_FOR_UPDATE;
}
}
@Override
public UpdateRunningStatus runUpdate()
{
if (dao.doTableAttributesExist(TeamEventAttendeeDO.class, "commentOfAttendee") == false) {
dao.alterTableColumnVarCharLength(eventTable.getName(), "note", 4000);
dao.dropTable(new Table(TeamEventAttendeeDO.class).getName()); // Table wasn't in use yet.
// TeamEventDO is only needed for generating OneToMany relation with attendee table:
new SchemaGenerator(dao).add(TeamEventDO.class, TeamEventAttendeeDO.class).createSchema();
}
if (dao.doTableAttributesExist(TeamCalDO.class, newEventAttributes51) == false) {
dao.addTableAttributes(TeamCalDO.class, newEventAttributes51);
}
return UpdateRunningStatus.DONE;