• Resolved Mushfiqur

    (@aa11plus)


    I’ve been trying to work out how to create foreign keys between tables in wpDataAccess. Could you please point me in the right direction? I tried to add relationships in Data Projects but when viewing the table in Data Explorer and clicking on MANAGE, the foreign keys tab remains empty (says no keys defined).

    Would really appreciate your help. I’m trying to make a school administration system.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi aa11plus,

    You are a bit ahead of the plugin. The plugin does not yet support foreign key constraints. This is on my to do list with high priority. I just haven’t been able to find the time yet.

    At this time the plugin supports relationships, which can be defined in Manage Table Options and are used in Data Projects pages. They are not available in the Data Explorer.

    This might sound a bit odd, so let me explain… Not all WordPress installations are using databases that support foreign key constraints. Therefor Data Project pages are using relationships instead of foreign keys constraints. This allows all WordPress developers/users to create parent/child pages.

    You can use the link below to learn how to create a parent/child page that uses relationships:
    https://wpdataaccess.com/docs/documentation/data-projects/video-tutorials/#many-to-many-relationships

    Did I answer your question?

    If you plan to develop a school administration system, can I help?

    Best regards,
    Peter

    Thread Starter Mushfiqur

    (@aa11plus)

    Oh I see, for the moment, we have to consider parent/child pages in substitute for foreign keys?

    Would appreciate your help, of course. Should we PM on this occcasion?

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Great!

    You can use the contactform on the website or send me an invitation on LinkedIn if you like. A link to my LinkedIn page is on the plugin page and on the website.

    Best regards,
    Peter

    Thread Starter Mushfiqur

    (@aa11plus)

    Brilliant!

    The parent/child method in DATA PROJECTS works perfectly. It’s actually much easier to follow and really makes you think as to how to relate each column and table.

    Many thanks

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi aa11plus,

    Good to hear you like Data Projects!

    The plugin uses relationships because not all MySQL and MariaDB databases versions support foreign keys (and not all table types). With relationships however, you can create master detail functionality for every database version and every type of table.

    Foreign key constraints are on my to do list. The plugin will then need a redesign to use foreign keys when they are available and relationships otherwise.

    Best regards,
    Peter

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Foreign Key and how to create them’ is closed to new replies.