question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I update a foreign key directly?

See original GitHub issue

This doesn’t seem to work:

model.relatedmodel_id = 1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
coleifercommented, May 4, 2016

I actually decided to go ahead and support querying on the xxx_id field.

1reaction
coleifercommented, May 4, 2016

That should raise an exception, I will reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If You Have Foreign Keys, Don't Update Fields That Aren't ...
At that point, you're faced with a tough choice: either fix the T-SQL to only update columns that are changing, or… remove the...
Read more >
How to update a table with a foreign key constraint - Quora
If the table is already created then you can alter it using ALTER TABLE like so: · ALTER TABLE table_name ADD CONSTRAINT constraint_name...
Read more >
How to update foreign key value in mysql database
SET foreign_key_checks = 0; UPDATE languages SET id='xyz' WHERE id='abc'; UPDATE categories_languages SET language_id='xyz' WHERE language_id=' ...
Read more >
SQL Server Foreign Key Update and Delete Rules
The foreign key relation can be created either through SSMS GUI or T-SQL. Rules for update/delete operations may be specified explicitly.
Read more >
Update Foreign key | OutSystems
to update an entity attribute Identifier as a foreign key, you have to remove the referential integrity of the First table means which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found