Add foreign keys between tables

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
iiyama
Posts: 1
Joined: 25 Mar 2019, 10:47

Add foreign keys between tables

Post by iiyama »

Hello,

I want to add a foreign key to a table, but i can't figure out how to create this foreign key in my schema file

function schema() {
return array(
array('CreateTableSQL', array(plugin_table('my_table'), "
id I NOTNULL UNSIGNED AUTOINCREMENT PRIMARY,
...,
<-------------- add a foreign key constraint + reference to the other table here + delete cascade
")),

And in the MantisBT documentation https://www.mantisbt.org/docs/master/en ... _Guide.pdf :

(page 9)
Schema DefinitionTODO: Discuss the ADODB datadict formats and the format MantisBT expects for schema definitions.Installation / Upgrade ProcessTODO: Discuss how MantisBT handles a database installation / upgrade, including the use of the configsystem and schema definitions

Soo .... Theses TODOs are here since the begining of mantisBT ?

Thanks

V2.3.0
Post Reply