From: Matteo Nastasi (mop) Date: Mon, 30 Nov 2015 06:25:27 +0000 (+0100) Subject: removed inher field from usersnet table X-Git-Tag: v5.3.0~37 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=65b5b379e459d6be1c120c506e5c15abef57f0f5;p=brisk.git removed inher field from usersnet table --- diff --git a/TODO.txt b/TODO.txt index 9a0599b..14f91a5 100644 --- a/TODO.txt +++ b/TODO.txt @@ -18,6 +18,7 @@ DONE - sql DONE - dbase API DONE - add apprentices tables + - remove entry when set unknown - enhance info interface . disable parts of interface - minisplash at end of the match diff --git a/sql/sql.d/075-users-network.sql b/sql/sql.d/075-users-network.sql index d6c2f61..70c304a 100644 --- a/sql/sql.d/075-users-network.sql +++ b/sql/sql.d/075-users-network.sql @@ -5,8 +5,6 @@ DROP TABLE IF EXISTS #PFX#usersnet; CREATE TABLE #PFX#usersnet ( owner integer REFERENCES #PFX#users (code) ON DELETE cascade ON UPDATE cascade, -- network owner - inher integer NULL REFERENCES #PFX#users (code) - ON DELETE cascade ON UPDATE cascade, -- inheriting user target integer REFERENCES #PFX#users (code) ON DELETE cascade ON UPDATE cascade, -- evaluated user friend integer, -- friendship level @@ -20,14 +18,10 @@ CREATE TABLE #PFX#usersnet ( DROP INDEX IF EXISTS #PFX#usersnet_owner_idx; DROP INDEX IF EXISTS #PFX#usersnet_target_idx; DROP INDEX IF EXISTS #PFX#usersnet_owner_target_idx; -DROP INDEX IF EXISTS #PFX#usersnet_owner_inher_idx; -DROP INDEX IF EXISTS #PFX#usersnet_owner_target_inher_idx; CREATE INDEX #PFX#usersnet_owner_idx ON #PFX#usersnet (owner); CREATE INDEX #PFX#usersnet_target_idx ON #PFX#usersnet (target); -CREATE INDEX #PFX#usersnet_owner_target_idx ON #PFX#usersnet (owner, target); -CREATE INDEX #PFX#usersnet_owner_inher_idx ON #PFX#usersnet (owner,inher); -CREATE UNIQUE INDEX #PFX#usersnet_owner_target_inher_idx ON #PFX#usersnet (owner, target, inher); +CREATE UNIQUE INDEX #PFX#usersnet_owner_target_idx ON #PFX#usersnet (owner, target); DROP VIEW #PFX#usersnet_wideskill; CREATE VIEW #PFX#usersnet_wideskill diff --git a/sql/sql.d/910-usernet_devel.sql b/sql/sql.d/910-usernet_devel.sql index 2138d71..3be8d5c 100644 --- a/sql/sql.d/910-usernet_devel.sql +++ b/sql/sql.d/910-usernet_devel.sql @@ -1,24 +1,22 @@ -- primary owner 10101 -DELETE FROM #PFX#usersnet WHERE owner = 10101 AND inher = 10101 AND target = 10102; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10101, 10101, 10102, 4, 2, 5); -DELETE FROM #PFX#usersnet WHERE owner = 10101 AND inher = 10101 AND target = 10103; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10101, 10101, 10103, 5, 2, 3); +DELETE FROM #PFX#usersnet WHERE owner = 10101 AND target = 10102; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10101, 10102, 4, 2, 5); +DELETE FROM #PFX#usersnet WHERE owner = 10101 AND target = 10103; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10101, 10103, 5, 2, 3); -- primary owner: discarded target -DELETE FROM #PFX#usersnet WHERE owner = 10101 AND inher = 10101 AND target = 10104; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10101, 10101, 10104, 1, 2, 5); +DELETE FROM #PFX#usersnet WHERE owner = 10101 AND target = 10104; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10101, 10104, 1, 2, 5); -- secondary owners for 10101 -DELETE FROM #PFX#usersnet WHERE owner = 10102 AND inher = 10102 AND target = 10105; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10102, 10102, 10105, 4, 2, 3); -DELETE FROM #PFX#usersnet WHERE owner = 10103 AND inher = 10103 AND target = 10105; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10103, 10103, 10105, 4, 3, 4); -DELETE FROM #PFX#usersnet WHERE owner = 10104 AND inher = 10104 AND target = 10105; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10104, 10104, 10105, 4, 5, 4); +DELETE FROM #PFX#usersnet WHERE owner = 10102 AND target = 10105; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10102, 10105, 4, 2, 3); +DELETE FROM #PFX#usersnet WHERE owner = 10103 AND target = 10105; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10103, 10105, 4, 3, 4); +DELETE FROM #PFX#usersnet WHERE owner = 10104 AND target = 10105; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10104, 10105, 4, 5, 4); -DELETE FROM #PFX#usersnet WHERE owner = 10101 AND inher = 10101 AND target = 10107; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10101, 10101, 10107, 3, 3, 4); -DELETE FROM #PFX#usersnet WHERE owner = 10101 AND inher is NULL AND target = 10107; -INSERT INTO #PFX#usersnet (owner, inher, target, friend, skill, trust) VALUES (10101, NULL, 10107, 3, 3, 4); +DELETE FROM #PFX#usersnet WHERE owner = 10101 AND target = 10107; +INSERT INTO #PFX#usersnet (owner, target, friend, skill, trust) VALUES (10101, 10107, 3, 3, 4); SELECT * FROM bsk_usersnet_wideskill; SELECT * FROM bsk_usersnet_narrowskill;