Need a help!

Get help from other users here.

Moderators: Developer, Contributor

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

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'), "
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: 1587
Joined: 11 Mar 2006, 16:08
Contact:

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