File: horde_datatree.sql

package info (click to toggle)
horde3 3.0.4-4sarge7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 15,980 kB
  • ctags: 16,295
  • sloc: php: 68,726; xml: 2,382; sql: 498; makefile: 74; sh: 63; pascal: 6
file content (44 lines) | stat: -rw-r--r-- 1,593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
-- $Horde: horde/scripts/sql/horde_datatree.sql,v 1.1 2004/09/18 17:20:59 chuck Exp $

CREATE TABLE horde_datatree (
    datatree_id INT NOT NULL,
    group_uid VARCHAR(255) NOT NULL,
    user_uid VARCHAR(255) NOT NULL,
    datatree_name VARCHAR(255) NOT NULL,
    datatree_parents VARCHAR(255) NOT NULL,
    datatree_order INT,

-- There is no portable way to do this apparently. If your db doesn't
-- allow TEXT columns, then maybe it allows large VARCHAR columns, so
-- try the second line.
--
    datatree_data TEXT,
--  datatree_data VARCHAR(4096),

    datatree_serialized SMALLINT DEFAULT 0 NOT NULL,
    datatree_updated TIMESTAMP,

    PRIMARY KEY (datatree_id)
);

CREATE INDEX datatree_datatree_name_idx ON horde_datatree (datatree_name);
CREATE INDEX datatree_group_idx ON horde_datatree (group_uid);
CREATE INDEX datatree_user_idx ON horde_datatree (user_uid);
CREATE INDEX datatree_order_idx ON horde_datatree (datatree_order);
CREATE INDEX datatree_serialized_idx ON horde_datatree (datatree_serialized);


CREATE TABLE horde_datatree_attributes (
    datatree_id INT NOT NULL,
    attribute_name VARCHAR(255) NOT NULL,
    attribute_key VARCHAR(255),
    attribute_value TEXT
);

CREATE INDEX datatree_attribute_idx ON horde_datatree_attributes (datatree_id);
CREATE INDEX datatree_attribute_name_idx ON horde_datatree_attributes (attribute_name);
CREATE INDEX datatree_attribute_key_idx ON horde_datatree_attributes (attribute_key);


GRANT SELECT, INSERT, UPDATE, DELETE ON horde_datatree TO horde;
GRANT SELECT, INSERT, UPDATE, DELETE ON horde_datatree_attributes TO horde;