Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8059201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:35:42+00:00 2026-06-05T09:35:42+00:00

I have two models : Card with has_many relation to Works I mean i

  • 0

I have two models :

Card with has_many relation to Works

I mean i have 7 static works in my database and i can choose some of them when i create a Card.

I defined a has_many relationship like this :

Has many relationship

My problem is strange… it seems to work, but when i explore my sqlite file, i don’t see any table relationship between Card and Work.

I am expecting a table with card_id and work_id.

How core data store has many relationship?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:35:44+00:00Added an answer on June 5, 2026 at 9:35 am

    Firstly, I’d caution you from opening up the sqlite files Core Data spits out and trying to infer things from them. It’s meant to be an opaque format: you’re only supposed to interact with Core Data persistent stores through the Core Data APIs.

    However, to answer your question: in general in database design, you wouldn’t use a linking table like you describe for a one-to-many relationship, only for a many-to-many. For a one-to-many, you’d have a foreign key field in the table at the ‘one’ end, and have the contents of that field be the primary key of another table. For example (sorry for the random example I found on Google):

    one-to-many

    tblOrder is in a one-to-many relationship with tblOrderDetails. This is implemented by having an Order# field in the to-many side of the relationship, which is a foreign key referring to the primary key of the tblOrder table. As you can see, no linking table is needed.

    A many-to-many relationship would need a linking table, but a one-to-many does not.

    One final point: I note in your screenshot that you don’t have an inverse relationship set up for your works or customer relationships. Core Data requires all relationships to have an inverse, otherwise your data may become corrupted. (That’s somewhat a simplification, since there are other ways to work around it, but in general making inverses is easiest.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have two models. Batch and Subject. The relation between them are Batch HAS_MANY
I have two models, Image and Tag . Each Image object can have more
I have two models: Person and Address which I'd like to create in a
I have two models Company and Role related by has_many and belongs_to association respectively.
I have two models Horse and Race. class Horse < ActiveRecord::Base has_many :races end
I have two models Project and UrlList . A project :has_many url_list and a
I have two models in Django linked together by ManyToMany relation like this: class
I have two models e.g. Book and Author . An author can have many
I have two models Project and 'Task` where project has_many tasks and task belongs
I have two models: Director, and Film. I want to create a web query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.