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',