File: create.msde.sql

package info (click to toggle)
horde3 3.1.3-4etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,876 kB
  • ctags: 18,071
  • sloc: php: 75,151; xml: 2,979; sql: 1,069; makefile: 79; sh: 64
file content (136 lines) | stat: -rw-r--r-- 3,336 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
-- $Horde: horde/scripts/sql/create.msde.sql,v 1.1.2.5 2006/06/29 16:29:02 jan Exp $

USE master
GO

CREATE DATABASE horde
GO

EXEC sp_addlogin 'horde', 'horde_mgr', 'horde'
GO

USE horde
GO

EXEC sp_grantdbaccess 'horde'
GO

CREATE TABLE horde_users (
    user_uid VARCHAR(255) NOT NULL,
    user_pass VARCHAR(255) NOT NULL,

    PRIMARY KEY (user_uid)
)
GO

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_users TO horde
GO

CREATE TABLE horde_prefs (
    pref_uid VARCHAR(200) NOT NULL,
    pref_scope VARCHAR(16) NOT NULL DEFAULT '',
    pref_name VARCHAR(32) NOT NULL,
    pref_value TEXT NULL,

    PRIMARY KEY (pref_uid, pref_scope, pref_name)
)
GO

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_prefs TO horde
GO

CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid)
CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope)
GO

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,
    datatree_data TEXT,
    datatree_serialized SMALLINT DEFAULT 0 NOT NULL,

    PRIMARY KEY (datatree_id)
)
GO

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_datatree TO horde
GO

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_serialized_idx ON horde_datatree (datatree_serialized)
GO

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

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_datatree TO horde
GO

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)
GO

CREATE TABLE horde_tokens (
    token_address VARCHAR(100) NOT NULL,
    token_id VARCHAR(32) NOT NULL,
    token_timestamp BIGINT NOT NULL,

    PRIMARY KEY (token_address, token_id)
)
GO

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_tokens TO horde
GO

CREATE TABLE horde_vfs (
    vfs_id BIGINT NOT NULL,
    vfs_type SMALLINT NOT NULL,
    vfs_path VARCHAR(255) NOT NULL,
    vfs_name VARCHAR(255) NOT NULL,
    vfs_modified BIGINT NOT NULL,
    vfs_owner VARCHAR(255) NOT NULL,
    vfs_data TEXT,

    PRIMARY KEY   (vfs_id)
)
GO

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_vfs TO horde
GO

CREATE INDEX vfs_path_idx ON horde_vfs (vfs_path)
CREATE INDEX vfs_name_idx ON horde_vfs (vfs_name)
GO

CREATE TABLE horde_histories (
    history_id       BIGINT NOT NULL,
    object_uid       VARCHAR(255) NOT NULL,
    history_action   VARCHAR(32) NOT NULL,
    history_ts       BIGINT NOT NULL,
    history_desc     TEXT,
    history_who      VARCHAR(255),
    history_extra    TEXT,

    PRIMARY KEY (history_id)
)
GO

GRANT SELECT, INSERT, UPDATE, DELETE ON horde_histories TO horde
GO

CREATE INDEX history_action_idx ON horde_histories (history_action)
CREATE INDEX history_ts_idx ON horde_histories (history_ts)
CREATE INDEX history_uid_idx ON horde_histories (object_uid)
GO