Need a help!

Get help from other users here.

Moderators: Developer, Contributor

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

Need a help!

Post by natejasper » Oct 12, 2019 10:22 am

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'), "
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 for your help

cas
Posts: 668
Joined: Mar 11, 2006 11:08 am
Contact:

Re: Need a help!

Post by cas » Oct 13, 2019 2:21 am

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