diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:35:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:35:32 +0000 |
commit | 5ea77a75dd2d2158401331879f3c8f47940a732c (patch) | |
tree | d89dc06e9f4850a900f161e25f84e922c4f86cc8 /servers/slapd/back-sql/rdbms_depend/mysql/testdb_create.sql | |
parent | Initial commit. (diff) | |
download | openldap-upstream.tar.xz openldap-upstream.zip |
Adding upstream version 2.5.13+dfsg.upstream/2.5.13+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | servers/slapd/back-sql/rdbms_depend/mysql/testdb_create.sql | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/servers/slapd/back-sql/rdbms_depend/mysql/testdb_create.sql b/servers/slapd/back-sql/rdbms_depend/mysql/testdb_create.sql new file mode 100644 index 0000000..b35261b --- /dev/null +++ b/servers/slapd/back-sql/rdbms_depend/mysql/testdb_create.sql @@ -0,0 +1,86 @@ +drop table if exists persons; +CREATE TABLE persons ( + id int NOT NULL, + name varchar(255) NOT NULL, + surname varchar(255) NOT NULL, + password varchar(64) +); + +drop table if exists institutes; +CREATE TABLE institutes ( + id int NOT NULL, + name varchar(255) +); + +drop table if exists documents; +CREATE TABLE documents ( + id int NOT NULL, + title varchar(255) NOT NULL, + abstract varchar(255) +); + +drop table if exists authors_docs; +CREATE TABLE authors_docs ( + pers_id int NOT NULL, + doc_id int NOT NULL +); + +drop table if exists phones; +CREATE TABLE phones ( + id int NOT NULL , + phone varchar(255) NOT NULL , + pers_id int NOT NULL +); + +drop table if exists certs; +CREATE TABLE certs ( + id int NOT NULL , + cert LONGBLOB NOT NULL, + pers_id int NOT NULL +); + +ALTER TABLE authors_docs ADD + CONSTRAINT PK_authors_docs PRIMARY KEY + ( + pers_id, + doc_id + ); + +ALTER TABLE documents ADD + CONSTRAINT PK_documents PRIMARY KEY + ( + id + ); + +ALTER TABLE institutes ADD + CONSTRAINT PK_institutes PRIMARY KEY + ( + id + ); + + +ALTER TABLE persons ADD + CONSTRAINT PK_persons PRIMARY KEY + ( + id + ); + +ALTER TABLE phones ADD + CONSTRAINT PK_phones PRIMARY KEY + ( + id + ); + +ALTER TABLE certs ADD + CONSTRAINT PK_certs PRIMARY KEY + ( + id + ); + +drop table if exists referrals; +CREATE TABLE referrals ( + id int NOT NULL, + name varchar(255) NOT NULL, + url varchar(255) NOT NULL +); + |