]> git.sur5r.net Git - openldap/blob - servers/slapd/back-sql/rdbms_depend/timesten/tttestdb_metadata.sql
Do not require ac/string.h for lber_pvt.h
[openldap] / servers / slapd / back-sql / rdbms_depend / timesten / tttestdb_metadata.sql
1
2 insert into ldap_oc_mappings 
3 (id,name,          keytbl,   keycol, create_proc,
4 delete_proc,expect_return)
5 values 
6 (1,'inetOrgPerson','persons','id',   'insert into persons (name) values ('');\n select last_insert_id();',
7 NULL,0);
8
9 insert into ldap_oc_mappings 
10 (id, name,      keytbl,     keycol,create_proc,delete_proc,expect_return)
11 values 
12 (2,  'document','documents','id',  NULL,       NULL,       0);
13
14 insert into ldap_oc_mappings 
15 (id,name,         keytbl,      keycol,create_proc,delete_proc,expect_return)
16 values 
17 (3,'organization','institutes','id',  NULL,       NULL,       0);
18
19
20 insert into ldap_attr_mappings 
21 (id, oc_map_id, name,  sel_expr,       sel_expr_u,      from_tbls,
22 join_where,add_proc, delete_proc,param_order,expect_return)
23 values 
24 (1,  1,         'cn',  'persons.name', 'persons.name_u','persons',
25 NULL,      NULL,     NULL,       3,          0);
26
27 insert into ldap_attr_mappings 
28 (id, oc_map_id, name,     sel_expr,        sel_expr_u, from_tbls,join_where,
29 add_proc, delete_proc,param_order,expect_return)
30 values 
31 (10, 1,         'title',  'persons.title', 'persons.title_u', 'persons',NULL,      NULL,     
32 NULL,       3,          0);
33
34 insert into ldap_attr_mappings 
35 (id, oc_map_id,name,             sel_expr,      from_tbls,
36 join_where,                  add_proc,delete_proc,param_order,expect_return)
37 values 
38 (2,  1,        'telephoneNumber','phones.phone','persons,phones',
39 'phones.pers_id=persons.id', NULL,    NULL,       3,          0);
40
41 insert into ldap_attr_mappings 
42 (id,oc_map_id, name, sel_expr,      from_tbls, join_where,add_proc,
43 delete_proc,param_order,expect_return)
44 values 
45 (3, 1,         'sn', 'persons.name','persons', NULL,      NULL, 
46 NULL,       3,          0);
47
48 insert into ldap_attr_mappings 
49 (id, oc_map_id, name, sel_expr,              from_tbls, join_where,add_proc,
50 delete_proc,param_order,expect_return)
51 values 
52 (30, 1,         'ou', 'persons.organization','persons', NULL,      NULL, 
53 NULL,       3,          0);
54
55 insert into ldap_attr_mappings 
56 (id, oc_map_id, name,          sel_expr,            from_tbls,  join_where,
57 add_proc,delete_proc,param_order,expect_return)
58 values 
59 (4,  2,         'description', 'documents.abstract','documents', NULL,
60 NULL,    NULL,       3,          0);
61
62 insert into ldap_attr_mappings 
63 (id, oc_map_id, name,           sel_expr,         from_tbls,  join_where,
64 add_proc,delete_proc,param_order,expect_return)
65 values 
66 (5,  2,         'documentTitle','documents.title','documents',NULL,
67 NULL,    NULL,       3,          0);
68
69 -- insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
70 -- values (6,2,'documentAuthor','persons.name','persons,documents,authors_docs',
71 --         'persons.id=authors_docs.pers_id AND documents.id=authors_docs.doc_id',
72 --      NULL,NULL,3,0);
73
74 insert into ldap_attr_mappings 
75 (id, oc_map_id, name, sel_expr,          from_tbls,    join_where,add_proc,
76 delete_proc,param_order,expect_return)
77 values 
78 (7,  3,         'o',  'institutes.name', 'institutes', NULL,      NULL,    
79 NULL,       3,          0);
80
81 insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
82 values (8,1,'documentDN','ldap_entries.dn','ldap_entries,documents,authors_docs,persons',
83         'ldap_entries.keyval=documents.id AND ldap_entries.oc_map_id=2 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',
84         NULL,NULL,3,0);
85
86 insert into ldap_attr_mappings (id,oc_map_id,name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return)
87 values (9,2,'documentAuthor','ldap_entries.dn','ldap_entries,documents,authors_docs,persons',
88         'ldap_entries.keyval=persons.id AND ldap_entries.oc_map_id=1 AND authors_docs.doc_id=documents.id AND authors_docs.pers_id=persons.id',
89         NULL,NULL,3,0);
90         
91 -- entries
92         
93 insert into ldap_entries 
94 (id, dn,           oc_map_id, parent, keyval)
95 values 
96 (1,  'o=sql,c=RU', 3,         0,      1);
97
98 insert into ldap_entries 
99 (id, dn,                            oc_map_id, parent, keyval)
100 values 
101 (2,  'cn=Mitya Kovalev,o=sql,c=RU', 1,         1,      1);
102
103 insert into ldap_entries (id,dn,oc_map_id,parent,keyval)
104 values (3,'cn=Torvlobnor Puzdoy,o=sql,c=RU',1,1,2);
105
106 insert into ldap_entries (id,dn,oc_map_id,parent,keyval)
107 values (4,'cn=Akakiy Zinberstein,o=sql,c=RU',1,1,3);
108
109 insert into ldap_entries (id,dn,oc_map_id,parent,keyval)
110 values (5,'documentTitle=book1,o=sql,c=RU',2,1,1);
111
112 insert into ldap_entries (id,dn,oc_map_id,parent,keyval)
113 values (6,'documentTitle=book2,o=sql,c=RU',2,1,2);
114         
115         
116 -- referrals
117
118 insert into ldap_entry_objclasses (entry_id,oc_name)
119 values (4,'referral');
120
121 insert into ldap_referrals (entry_id,url)
122 values (4,'http://localhost');