Problem/Motivation

Changing the schema of a field type is a little bit more complex as just using DB API.

See #937442: Field type modules cannot maintain their field schema (field type schema change C(R)UD is needed)

Steps to reproduce

Proposed resolution

Create a new update hook which also updates the field definitions schema.

Remaining tasks

* Make duration_field_update_8201 a no-op update
* Create a new update hook duration_field_update_82XY with proper API.

User interface changes

-

API changes

-

Data model changes

-

CommentFileSizeAuthor
#5 duration_field-3536787-5.patch1.3 KBalbert.garcia
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tobiasb created an issue. See original summary.

tobiasb’s picture

bluegeek9’s picture

Thank you for reporting this bug.

Which version of Duration field did you upgrade from?

I will take a look at the problem.

tobiasb’s picture

Issue summary: View changes

From 8.x-2.1.

albert.garcia’s picture

StatusFileSize
new1.3 KB

Possibly not related specifically to the issue of updating the schema properly, but also upgrading from 2.1 and running 8201 update throws error because it attempts to update non existing tables (in my case, commerce_product__revision__field_duration).

Here's a patch for 2.2 while the whole issue is being looked at, which checks if the table is there before hand.

tobiasb’s picture

Issue summary: View changes
Status: Active » Needs review
tobiasb’s picture

nagy.balint’s picture

I have the same issue now.

nagy.balint’s picture

Based on my testing MR50 #6 fixes my issue. Seems to have no side effect in my case.

rprager’s picture

The patch in #5 works for my case as well.

davidiio’s picture

Status: Needs review » Reviewed & tested by the community

We have applied this merge request plain diff as a patch on drupal 10.5 and duration_field 2.2.0
Update process looks OK.

bluegeek9’s picture

Assigned: Unassigned » bluegeek9

I am reviewing the changes. And intend to make a new release after it is merged.

bluegeek9 changed the visibility of the branch 8.x-2.x to hidden.