Jump to:

5514 Posts in 1733 Topics by 1219 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Silverstripe creates only Indices but no Foreign Keys

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 358 Views
  • seba.wagner
    Avatar
    Community Member
    5 Posts

    Silverstripe creates only Indices but no Foreign Keys Link to this post

    I am using the PostgresSQL module for SilverStripe.

    My issue is that I can define relations with for example:

    public static $has_one = array(
    'PageRedirect' => 'SiteTree',
    );

    What this will code do is that it will create the database with a Indice with the naming pattern: ix_tablename_pageredirectId
    However no foreign key is created.

    Further SilverStripe seems to write "0" instead of "null" in columns that are empty relations. So actually you can't even create those foreigh key contraints as SIlverStripe will constantly violate them.

    How can one configure SilverStripe for proper Foreign Key Contraints in the database?

    Thanks!
    Sebastian

    358 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.