Base solution for your next web application
Open Closed

DB Missing Referential Integrity #1532


User avatar
0
rickwheeler created

Hi,

I've noticed that the database generated by ASP.NET Zero is severely lacking in any real referential integrity. There are no foreign keys on many of the tables which use a TenantId or a UserId.

Can you please explain why this is and if you have any plans to fix it? When a relational database has no relations it is a little concerning.

Thanks, Sean


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Relations of User and Tenant are deleted for Database Per Tenant architecture. If you are using single database, you can add those relations.

  • User Avatar
    0
    rickwheeler created

    Can you please provide an example of how to do this for organization unit?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can extend OrganizationUnit class and add required fields and navigation properties. In order to extend OrganizationUnit, you can take a look at this tutorial <a class="postlink" href="https://aspnetzero.com/Documents/Extending-Existing-Entities">https://aspnetzero.com/Documents/Extend ... g-Entities</a>