Problem/Motivation

The schema in 2.x is this:

      'columns' => [
        'numerator' => [
          'description' => 'Fraction numerator value',
          'type' => 'int',
          'size' => 'big',
          'not null' => FALSE,
        ],
        'denominator' => [
          'description' => 'Fraction denominator value',
          'type' => 'int',
          'not null' => FALSE,
        ],
      ],

8.x-1.x has:

     'columns' => [
        'numerator' => [
          'description' => 'Fraction numerator value',
          'type' => 'int',
          'size' => 'big',
          'not null' => TRUE,
          'default' => 0,
        ],
        'denominator' => [
          'description' => 'Fraction denominator value',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 1,
        ],
      ],

This was changed in #3202832: Allow null values so Fraction can be used as an optional base field. The status page will show update errors without using the entity definition manager to update base and bundle fields.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork fraction-3223868

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

mglaman created an issue. See original summary.

m.stenta’s picture

Assigned: Unassigned » m.stenta

Ah thanks @mglaman! That was my mistake. I'll try to get the update hook for this together soon (definitely before the first 2.0.0 release).

pcambra made their first commit to this issue’s fork.

m.stenta’s picture

Status: Active » Needs review

Thanks for the merge request @pcambra!

I will try to review/test this soon. @mglaman if you are able/willing to test too, the more the merrier! :-)

mglaman’s picture

I was on a paired programming call, I'll let them know :)

  • pcambra committed 6737c16 on 3223868-needs-hookupdaten-to
    Issue #3223868: Needs hook_update_N to fix schema changes from 1.x-2.x
m.stenta’s picture

Thanks @mglaman and @pcambra for working on this! Is there anything left to do? Or do you think it's ready for final review/merge?

mglaman’s picture

I think it looks good, just had those few nits, nothing blocking. I pinged the person in question to see if they can test.

I'll try to find time to make the quick changes @pcambra thumbed up

pcambra’s picture

@mglaman if it's thumbed up, I should have solved them in the latest commit :) (unless I missed something), many thanks for the review!

mglaman’s picture

oh! @pcambra did you force push? I just saw one commit so I thought maybe it was valid.

I'm happy with it, then :) I'll see if I can get it tested

pcambra’s picture

Thanks @mglaman

I think I might have consolidated in one commit, tbh I don't recall why I did this :o

m.stenta’s picture

If this looks good to both of you I will merge and tag 2.0.0 (along with #3240702: Column not found when running updb when that's ready).

m.stenta’s picture

Status: Needs review » Needs work

Oh actually... ! This will need the same change from #3240702: Column not found when running updb to support single-value base fields.

m.stenta’s picture

Status: Needs work » Needs review

Added a commit that uses $table_mapping->getFieldColumnName() to get the column names, instead of building them ourselves. This should cover single-value base fields (as we ran into in #3240702: Column not found when running updb).

I also force pushed the 3223868-needs-hookupdaten-to branch to the fraction-3223868 remote for the MR to update. @pcambra had pushed it to origin previously, which is why the changes didn't show up in the MR here. I deleted origin/3223868-needs-hookupdaten-to.

  • m.stenta committed 856c6fb on 2.x authored by pcambra
    Issue #3223868: Needs hook_update_N to fix schema changes from 1.x-2.x
m.stenta’s picture

Status: Needs review » Fixed

I went ahead and merged this - I'm going to tag 2.0.0 soon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.