From a6f3eabf4d91b4bd0eac2c6710b7983ec260ae62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Wed, 21 Jun 2017 19:26:36 +0200 Subject: [PATCH] example of FK definition --- htdocs/modulebuilder/template/sql/llx_myobject.key.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/modulebuilder/template/sql/llx_myobject.key.sql b/htdocs/modulebuilder/template/sql/llx_myobject.key.sql index 6fd4bb4cda6..9f1c8c20ea2 100644 --- a/htdocs/modulebuilder/template/sql/llx_myobject.key.sql +++ b/htdocs/modulebuilder/template/sql/llx_myobject.key.sql @@ -14,4 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. + ALTER TABLE llx_myobject ADD UNIQUE INDEX uk_fk_othertable (fk_othertable); +--ALTER TABLE llx_myobject ADD CONSTRAINT llx_mytable_field_id FOREIGN KEY (fk_field) REFERENCES llx_myOthertable(rowid); + -- GitLab