Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

Many-Many link tables have Integer data-type?


Go to End


1825 Views

Avatar
Antsb

Community Member, 7 Posts

14 October 2013 at 11:00am

Edited: 14/10/2013 11:00am

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")