| 1 |
create table ldap_oc_mappings ( |
| 2 |
id int identity (1, 1) not null , |
| 3 |
name varchar (64) not null , |
| 4 |
keytbl varchar (64) not null , |
| 5 |
keycol varchar (64) not null , |
| 6 |
create_proc varchar (255) NULL , |
| 7 |
delete_proc varchar (255) NULL, |
| 8 |
expect_return int not null |
| 9 |
) |
| 10 |
GO |
| 11 |
|
| 12 |
alter table ldap_oc_mappings add |
| 13 |
constraint pk_ldap_oc_mappings primary key |
| 14 |
( |
| 15 |
id |
| 16 |
) |
| 17 |
GO |
| 18 |
|
| 19 |
|
| 20 |
alter table ldap_oc_mappings add |
| 21 |
constraint unq1_ldap_oc_mappings unique |
| 22 |
( |
| 23 |
name |
| 24 |
) |
| 25 |
GO |
| 26 |
|
| 27 |
|
| 28 |
create table ldap_attr_mappings ( |
| 29 |
id int identity (1, 1) not null , |
| 30 |
oc_map_id int not null references ldap_oc_mappings(id), |
| 31 |
name varchar (255) not null , |
| 32 |
sel_expr varchar (255) not null , |
| 33 |
sel_expr_u varchar(255), |
| 34 |
from_tbls varchar (255) not null , |
| 35 |
join_where varchar (255) NULL , |
| 36 |
add_proc varchar (255) NULL , |
| 37 |
delete_proc varchar (255) NULL , |
| 38 |
param_order int not null, |
| 39 |
expect_return int not null |
| 40 |
) |
| 41 |
GO |
| 42 |
|
| 43 |
alter table ldap_attr_mappings add |
| 44 |
constraint pk_ldap_attr_mappings primary key |
| 45 |
( |
| 46 |
id |
| 47 |
) |
| 48 |
GO |
| 49 |
|
| 50 |
|
| 51 |
create table ldap_entries ( |
| 52 |
id int identity (1, 1) not null , |
| 53 |
dn varchar (255) not null , |
| 54 |
oc_map_id int not null references ldap_oc_mappings(id), |
| 55 |
parent int not null , |
| 56 |
keyval int not null |
| 57 |
) |
| 58 |
GO |
| 59 |
|
| 60 |
|
| 61 |
alter table ldap_entries add |
| 62 |
constraint pk_ldap_entries primary key |
| 63 |
( |
| 64 |
id |
| 65 |
) |
| 66 |
GO |
| 67 |
|
| 68 |
alter table ldap_entries add |
| 69 |
constraint unq1_ldap_entries unique |
| 70 |
( |
| 71 |
oc_map_id, |
| 72 |
keyval |
| 73 |
) |
| 74 |
GO |
| 75 |
|
| 76 |
alter table ldap_entries add |
| 77 |
constraint unq2_ldap_entries unique |
| 78 |
( |
| 79 |
dn |
| 80 |
) |
| 81 |
GO |
| 82 |
|
| 83 |
|
| 84 |
create table ldap_referrals |
| 85 |
( |
| 86 |
entry_id int not null references ldap_entries(id), |
| 87 |
url text not null |
| 88 |
) |
| 89 |
GO |
| 90 |
|
| 91 |
create index entry_idx on ldap_referrals(entry_id); |
| 92 |
|
| 93 |
create table ldap_entry_objclasses |
| 94 |
( |
| 95 |
entry_id int not null references ldap_entries(id), |
| 96 |
oc_name varchar(64) |
| 97 |
) |
| 98 |
GO |
| 99 |
|
| 100 |
create index entry_idx on ldap_entry_objclasses(entry_id); |