From fb2648f066eb2a85c36e32c45bc55b3d6f337590 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 16 Aug 2010 20:08:47 +0000 Subject: [PATCH] add foreign key stanza git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7103 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/schema/samples/Sample.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/schema/samples/Sample.pm b/xCAT-server/lib/xcat/schema/samples/Sample.pm index ad8de1135..d46ab5344 100644 --- a/xCAT-server/lib/xcat/schema/samples/Sample.pm +++ b/xCAT-server/lib/xcat/schema/samples/Sample.pm @@ -15,7 +15,7 @@ package xCAT_schema::Sample; # Please do not use SQL reserved words for your table names and column names. # Use this site to check the reserved words: # http://www.petefreitag.com/tools/sql_reserved_words_checker/ -# 5 Change the keys. +# 5 Change the keys. Foreign keys are optional # 6 Change the data types. For SQLite # the default data type is TEXT if not specified. # The supported data types are: @@ -34,6 +34,7 @@ package xCAT_schema::Sample; x_lljob => { #your table name should start with "x_". cols => [qw(jobid status comments disable)], #do not change 'disable' and 'comments', it is required by xCAT keys => [qw(jobid)], + keys => [qw(jobid)], required => [qw(jobid)], types => { jobid => 'INTEGER', @@ -49,6 +50,7 @@ package xCAT_schema::Sample; x_llnode => { cols => [qw(node jobid jobstatus cpu_usage comments disable)], keys => [qw(node)], + foreignkeys => [qw(node) REFERENCES x_lljob(node) ON DELETE CASCADE)], required => [qw(node jobid)], types => { jobid => 'INTEGER',