From 21e0818e63e150d8ddfca53661e5246c07778eaa Mon Sep 17 00:00:00 2001
From: Sonia Zorba <sonia.zorba@inaf.it>
Date: Mon, 1 Feb 2021 13:33:55 +0100
Subject: [PATCH] Minor change

---
 00-init.sql | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/00-init.sql b/00-init.sql
index f6f5ed1..0e81527 100644
--- a/00-init.sql
+++ b/00-init.sql
@@ -101,7 +101,7 @@ CREATE TABLE deleted_node (
     os_name                VARCHAR       default NULL,
     tstamp_wrapper_dir     VARCHAR       default NULL,
     type                   NodeType      NOT NULL,
-    location_id            SMALLINT      NOT NULL,
+    location_id            SMALLINT      default NULL,
     format                 VARCHAR       default NULL,
     -- format is used to distinguish between unstuctured (format=NULL) and structured nodes having a well defined format
     async_trans            BOOLEAN       default NULL,
@@ -129,7 +129,8 @@ CREATE TABLE deleted_node (
     protocols              TEXT[]        default NULL,
     -- add a deleted_on timestamp to keep track
     deleted_on             TIMESTAMP     default CURRENT_TIMESTAMP,
-    PRIMARY KEY (node_id)
+    PRIMARY KEY (node_id),
+    FOREIGN KEY (location_id) REFERENCES location (location_id)
 );
 
 
-- 
GitLab