Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update a field to be required once already created #10

Open
joelpierre opened this issue Jul 12, 2021 · 6 comments
Open

Cannot update a field to be required once already created #10

joelpierre opened this issue Jul 12, 2021 · 6 comments

Comments

@joelpierre
Copy link
Contributor

joelpierre commented Jul 12, 2021

I have a model with a simple field I created. In the next migration I wanted to make this field required, however the update was being rejected, even though I was passing a migration value.

When testing I noticed that I had to delete every entry and then I could update the field to be required.

In the UI this isn't an issue as it asks for a migration value. I assume there is some sort of ordering of mutations issue meaning that the migration is rejected?

e.g

model.addSimpleField({
  apiId: 'label',
  displayName: 'Label',
  type: FieldType.String,
  isLocalized: true
});

on next run when content has been added (this fails)

model.updateSimpleField({
  apiId: 'label',
  migrationValue: 'test',
  isRequired: true
});
@notrab
Copy link
Contributor

notrab commented Jul 12, 2021

Internal Issue: ENG-3642

@NicolasBiehler
Copy link

Just wanted to drop a word here saying this is still relevant today.

The migration gets rejected with 'FAILED Could not apply schema changes'

@joelpierre
Copy link
Contributor Author

@notrab - was there any movement on this one? Could it be solved by your draft PR #20 ?

@notrab
Copy link
Contributor

notrab commented Mar 18, 2022

@joelpierre this should be resolved now, right?

@joelpierre
Copy link
Contributor Author

@joelpierre this should be resolved now, right?

I am not sure haven't re-checked since Jan. I just generally avoid it 😅

@hananabud
Copy link

Hello any update on this issue?
I am having similar issue, trying to do upsert to a model based on the apiId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants