Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Many-Many link tables have Integer data-type?

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

Page: 1
Go to End
Author Topic: 362 Views
  • Antsb
    Avatar
    Community Member
    7 Posts

    Many-Many link tables have Integer data-type? Link to this post

    In the standard Many-Many tables used by SilverStripe, on my site (running on PostgreSQL), the foreign key columns have an integer datatype, as opposed to a bigint datatype similar to the "ID" primary keys on each table.

    Is this intentional and is there an automated way of changing this to bigints without having to do it by hand? Does SilverStripe perhaps scale the size of the foreign-key used to fit the amount of data in the tables?

    As an example, heres the definition of the Group_Members table:

    Table "public.Group_Members"
    Column | Type | Modifiers
    ----------+---------+--------------------------------------------------------------
    ID | bigint | not null default nextval('"Group_Members_ID_seq"'::regclass)
    GroupID | integer | default 0
    MemberID | integer | default 0
    Indexes:
    "Group_Members_pkey" PRIMARY KEY, btree ("ID")
    "ix_7a41fa7b78fca2fc710b259121fb520f" btree ("GroupID")
    "ix_f7f7aa45c138f0425dd5e5b52a084780" btree ("MemberID")
    "ix_group_members_groupid" btree ("GroupID")
    "ix_group_members_memberid" btree ("MemberID")

    362 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.