aboutsummaryrefslogtreecommitdiffstats
path: root/sql/fileshare.sql
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-13 14:10:46 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-13 14:10:46 +0200
commit820a552e7d69cdee9c040a4b683014f13b7ed6b2 (patch)
treef6c18c65b2cd5a5558f9309a40b8f420085a8f7b /sql/fileshare.sql
parent0d02fe02d61bfc4db1418c9bfad2206bbfc2f3c5 (diff)
parent8b1393b3f06fdd86abc3dca396670965c42ba8c2 (diff)
downloadfileup-820a552e7d69cdee9c040a4b683014f13b7ed6b2.tar.gz
Merge branch 'master' of https://github.com/alexvitkov/india
Diffstat (limited to 'sql/fileshare.sql')
-rw-r--r--sql/fileshare.sql10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/fileshare.sql b/sql/fileshare.sql
index 010b35d..8e69881 100644
--- a/sql/fileshare.sql
+++ b/sql/fileshare.sql
@@ -24,7 +24,7 @@ create table users (
email varchar(50),
home_directory int not null,
primary key (user_id),
- foreign key (home_directory) references nodes(node_id)
+ foreign key (home_directory) references nodes(node_id) on delete cascade
);
create table node_access (
@@ -33,8 +33,8 @@ create table node_access (
can_view boolean not null default true,
can_edit boolean not null default false,
- foreign key (node_id) references nodes(node_id),
- foreign key (user_id) references users(user_id)
+ foreign key (node_id) references nodes(node_id) on delete cascade,
+ foreign key (user_id) references users(user_id) on delete cascade
);
/*we can name a node in many different ways */
create table node_links (
@@ -43,8 +43,8 @@ create table node_links (
name varchar(100) not null default 'no name',
note varchar(200) not null default "",
check (directory_id != node_id),
- foreign key (directory_id) references nodes(node_id),
- foreign key (node_id) references nodes(node_id)
+ foreign key (directory_id) references nodes(node_id) on delete cascade,
+ foreign key (node_id) references nodes(node_id) on delete cascade
);