Need a help!

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Posts: 1
Joined: Oct 12, 2019 10:20 am

Need a help!

Post by natejasper »

Hello all people,

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'), "
<-------------- add a foreign key constraint + reference to the other table here + delete cascade

And in the MantisBT documentation ... _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 for your help

Posts: 777
Joined: Mar 11, 2006 11:08 am

Re: Need a help!

Post by cas »

the ToDo's are not there from the ebginning but from start of using ADODB.
If you cannot do it in the schema file, you still can use a regular sql statement to get it done, just be creative.
In addition you can come up with proposals how it could be done in the schema file.

Post Reply