 
 DROP TRIGGER IF EXISTS on_ldata_update |
 CREATE TRIGGER on_ldata_update
-BEFORE UPDATE ON ldata_table
+AFTER UPDATE ON ldata_table
 FOR EACH ROW BEGIN
   IF NEW.datatype = 'logical.file' THEN
     IF NEW.pdriGroupRef != OLD.pdriGroupRef THEN

 status enum('unavailable', 'corrupted', 'OK')
) ENGINE=InnoDB;

CREATE TABLE permission_table (
 id SERIAL PRIMARY KEY,
 permType ENUM('read', 'write'), INDEX(permType),

DROP TABLE IF EXISTS permission_table, ldata_table, wp4_table, pdri_table, pdrigroup_table, storage_site_table, credential_table, requests_table;

CREATE TABLE pdrigroup_table (
  pdriGroupId SERIAL PRIMARY KEY,
