← Back to team overview

mahara-contributors team mailing list archive

[Bug 1651011] A change has been merged

 

Reviewed:  https://reviews.mahara.org/7368
Committed: https://git.mahara.org/mahara/mahara/commit/1d0b47eff7d16053e6bd8117bba1fc8b45e9169d
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    16.10_STABLE

commit 1d0b47eff7d16053e6bd8117bba1fc8b45e9169d
Author: Dmitrii Metelkin <dmitriim@xxxxxxxxxxxxxxx>
Date:   Wed Dec 28 15:06:45 2016 +1100

Bug1651011: remove unnecessary update hook

Removing update hook to prevent failing upgrades from older versions
like 15.10, 16.04 and older 16.10. It's safe as the next hook will
recreate a table and resync filetypes.

behatnotneeded

Change-Id: I285a3f297a8459a8758b29ac0b9f7d4e97f38202

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1651011

Title:
  Issue upgrading Mahara site to 17.04dev

Status in Mahara:
  Fix Committed
Status in Mahara 16.10 series:
  Fix Committed

Bug description:
  This issue arose from bug #1647885. The upgrade fails because the
  primary key is incorrect in the table artefact_file_mime_types

  Robert sayd: Rather than dropping and re-creating the table, it would
  be better to truncate the table and change the primary key. That way,
  the table structure stays the same.

  To replicate:

  1. Install 16.04 and go through the regular setup steps.
  2. Upgrade to master
  Expected result: The upgrade completes. Actual result: Upgrade fails on artefact.file with the following error message, which can only be seen when you attempt to run the upgrade again:

  [DBG] 0e (artefact/file/db/upgrade.php:446) Drop the old primary key constraint and add new id column from/to the table artefact_file_mime_types
  [DBG] 0e (lib/dml.php:157) postgres8 error: [-1: ERROR:  multiple primary keys for table "artefact_file_mime_types" are not allowed] in adodb_throw(ALTER TABLE "artefact_file_mime_types"
                              DROP CONSTRAINT IF EXISTS "artefilemimetype_mim_pk",
                              ADD COLUMN id SERIAL PRIMARY KEY, )
  Command was: ALTER TABLE "artefact_file_mime_types"
                              DROP CONSTRAINT IF EXISTS "artefilemimetype_mim_pk",
                              ADD COLUMN id SERIAL PRIMARY KEY
  [WAR] 0e (lib/errors.php:859) Could not execute command: ALTER TABLE "artefact_file_mime_types"
                              DROP CONSTRAINT IF EXISTS "artefilemimetype_mim_pk",
                              ADD COLUMN id SERIAL PRIMARY KEY
  Call stack (most recent first):

      log_message(string(size 207), integer, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:95
      log_warn(string(size 207)) at /home/kristina/code/mahara/htdocs/lib/errors.php:859
      SQLException->__construct(string(size 207)) at /home/kristina/code/mahara/htdocs/lib/dml.php:158
      execute_sql(string(size 180)) at /home/kristina/code/mahara/htdocs/artefact/file/db/upgrade.php:450
      xmldb_artefact_file_upgrade(string(size 10)) at /home/kristina/code/mahara/htdocs/lib/upgrade.php:423
      upgrade_plugin(object(stdClass)) at /home/kristina/code/mahara/htdocs/admin/upgrade.json.php:87

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1651011/+subscriptions


References