Ticket #517 (new defect)

Opened 2 years ago

Last modified 2 years ago

Upgrade path from 2.2.7 to 2.3.8 is broken

Reported by: robert Owned by: robert
Priority: major Milestone: MediaMosa X.X
Component: Core Version:
Keywords: Cc:
MoSCoW: Should Have Estimated time after impact analysis:
Related to project: none Tested: no
Accepted: no Estimated Hours: 0

Description

Update hook #7088 will fail when upgrading.

patch available, included in ticket. 2.3.9 release will fix upgrade path.

Use either the code below and replace mediamosa_update_7088() in mediamosa.install file, or replace the mediamosa.install file with the attachment on this ticket.

/**
 * Change mediamosa_streaming_ticket table.
 * Add new field: time.
 * Add new indexes: ticket_id, time.
 */
function mediamosa_update_7088() {

  if (!db_field_exists('mediamosa_streaming_ticket', 'timeout')) {
    // Add time field.
    db_query("ALTER TABLE {mediamosa_streaming_ticket} ADD timeout datetime DEFAULT NULL COMMENT 'The date and time, when the ticket expires.' AFTER mediafile_id");
  }

  // Add value to time fields.
  db_query("UPDATE {mediamosa_streaming_ticket} SET timeout = :timeout", array(
    ':timeout' => mediamosa_datetime::utc_current_timestamp_add_hours(FALSE, 720),
  ));

  if (!db_index_exists('mediamosa_streaming_ticket', 'idx_ticket_id')) {
    // Ticket id.
    db_add_index(
      'mediamosa_streaming_ticket',
      'idx_ticket_id',
      array(
        'ticket_id',
      )
    );
  }

  if (!db_index_exists('mediamosa_streaming_ticket', 'idx_timeout')) {
    // Time.
    db_add_index(
      'mediamosa_streaming_ticket',
      'idx_timeout',
      array(
        'timeout',
      )
    );
  }
}

Attachments

mediamosa.install Download (73.2 KB) - added by robert 2 years ago.
replacement file for sites/all/modules/mediamosa/mediamosa.install

Change History

Changed 2 years ago by robert

Also added;

/**
 * Add possible missing columns in mediamosa_app table.
 */
function mediamosa_update_7099() {
  if (!db_field_exists('mediamosa_app', 'still_default_size')) {
    db_query("ALTER TABLE {mediamosa_app} ADD still_default_size varchar(25) DEFAULT '176x144' COMMENT 'The default size of the still image.' AFTER timezone");
  }

  if (!db_field_exists('mediamosa_app', 'still_padding')) {
    db_query("ALTER TABLE {mediamosa_app} ADD still_padding enum('NO','YES') NOT NULL DEFAULT 'YES' COMMENT 'Force padding, if aspect ratio is maintaned.' AFTER still_default_size");
  }

  if (!db_field_exists('mediamosa_app', 'still_maintain_aspect_ratio')) {
    db_query("ALTER TABLE {mediamosa_app} ADD still_maintain_aspect_ratio enum('NO','YES') NOT NULL DEFAULT 'YES' COMMENT 'Force maintain the original video aspect ratio or not.' AFTER still_padding");
  }
}

Changed 2 years ago by robert

replacement file for sites/all/modules/mediamosa/mediamosa.install

Note: See TracTickets for help on using tickets.