2007-08-13 23:27:20 +02:00
|
|
|
--
|
2008-09-27 03:13:41 +02:00
|
|
|
-- (C) 2007 Inverse inc.
|
2007-08-13 23:27:20 +02:00
|
|
|
--
|
|
|
|
|
2007-12-07 21:34:29 +01:00
|
|
|
CREATE TABLE @{tableName} (
|
2008-06-30 16:12:32 +02:00
|
|
|
c_folder_id INTEGER,
|
|
|
|
c_path VARCHAR(255) PRIMARY KEY, -- the full path to the folder
|
2007-08-13 23:27:20 +02:00
|
|
|
c_path1 VARCHAR(255) NOT NULL, -- parts (for fast queries)
|
|
|
|
c_path2 VARCHAR(255) NULL, -- parts (for fast queries)
|
|
|
|
c_path3 VARCHAR(255) NULL, -- parts (for fast queries)
|
|
|
|
c_path4 VARCHAR(255) NULL, -- parts (for fast queries)
|
|
|
|
c_foldername VARCHAR(255) NOT NULL, -- last path component
|
2016-03-10 22:34:06 +01:00
|
|
|
c_location VARCHAR(2048) NULL, -- URL to folder
|
2007-08-13 23:27:20 +02:00
|
|
|
c_quick_location VARCHAR(2048) NULL, -- URL to quicktable of folder
|
|
|
|
c_acl_location VARCHAR(2048) NULL, -- URL to quicktable of folder
|
|
|
|
c_folder_type VARCHAR(255) NOT NULL -- the folder type ...
|
|
|
|
);
|
|
|
|
|
2007-12-07 21:34:29 +01:00
|
|
|
CREATE SEQUENCE @{tableName}_seq;
|
|
|
|
CREATE OR REPLACE TRIGGER @{tableName}_autonumber
|
|
|
|
BEFORE INSERT ON @{tableName} FOR EACH ROW
|
2007-08-13 23:27:20 +02:00
|
|
|
BEGIN
|
|
|
|
IF :new.c_folder_id IS NULL THEN
|
2007-12-07 21:34:29 +01:00
|
|
|
SELECT @{tableName}_seq.nextval INTO :new.c_folder_id FROM DUAL;
|
2007-08-13 23:27:20 +02:00
|
|
|
END IF;
|
|
|
|
END;
|
|
|
|
/
|