jive的資料庫sybase7
CREATE TABLE jiveForum (
forumID INT NOT NULL PRIMARY KEY,
name VARCHAR(255) UNIQUE NOT NULL,
description TEXT NULL,
modDefaultThreadVal INT NOT NULL,
modMinThreadVal INT NOT NULL,
modDefaultMsgVal INT NOT NULL,
modMinMsgVal INT NOT NULL,
modifiedDate VARCHAR(15) NOT NULL,
creationDate VARCHAR(15) NOT NULL,
);
CREATE TABLE jiveForumProp (
forumID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (forumID, name),
);
CREATE TABLE jiveThread (
threadID INT NOT NULL PRIMARY KEY,
forumID INT NOT NULL,
rootMessageID INT NOT NULL,
modValue INT NOT NULL,
rewardPoints INT NOT NULL,
creationDate CHAR(15) NOT NULL,
modifiedDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveThread_forumID_idx ON jiveThread (forumID);
CREATE INDEX jiveThread_modValue_idx ON jiveThread (modValue);
CREATE INDEX jiveThread_cDate_idx ON jiveThread (creationDate);
CREATE INDEX jiveThread_mDate_idx ON jiveThread (modifiedDate);
CREATE TABLE jiveThreadProp (
threadID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (threadID, name)
);
CREATE TABLE jiveMessage (
messageID INT NOT NULL PRIMARY KEY,
parentMessageID INT NULL,
threadID INT NOT NULL,
forumID INT NOT NULL,
userID INT NULL,
subject VARCHAR(255) NULL,
body TEXT NULL,
modValue INT NOT NULL,
rewardPoints INT NOT NULL,
creationDate CHAR(15) NOT NULL,
modifiedDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveMessage_threadID_idx ON jiveMessage (threadID);
CREATE INDEX jiveMessage_forumID_modVal_idx ON jiveMessage(forumID, modValue);
CREATE INDEX jiveMessage_userID_idx ON jiveMessage (userID);
CREATE INDEX jiveMessage_cDate_idx ON jiveMessage (creationDate);
CREATE INDEX jiveMessage_mDate_idx ON jiveMessage (modifiedDate);
CREATE TABLE jiveMessageProp (
messageID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (messageID, name)
);
CREATE TABLE jiveUser (
userID INT NOT NULL PRIMARY KEY ,
username VARCHAR(30) UNIQUE NOT NULL,
passwordHash VARCHAR(32) NOT NULL,
name VARCHAR(100) NULL,
nameVisible INT NOT NULL,
email VARCHAR(100) NOT NULL,
emailVisible INT NOT NULL,
rewardPoints INT NOT NULL,
creationDate CHAR(15) NOT NULL,
modifiedDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveUser_cDate_idx ON jiveUser (creationDate);
CREATE TABLE jiveUserPerm (
forumID INT NULL,
userID INT NULL,
userType INT NOT NULL,
permission INT NOT NULL,
);
CREATE INDEX jiveUserPerm_forumID_idx ON jiveUserPerm (forumID);
CREATE INDEX jiveUserPerm_userID_idx ON jiveUserPerm (userID);
CREATE TABLE jiveUserProp (
userID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (userID, name)
);
CREATE TABLE jiveGroup (
groupID INT NOT NULL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
description VARCHAR(255) NULL,
modifiedDate CHAR(15) NOT NULL,
creationDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveGroup_cDate_idx ON jiveGroup (creationDate);
CREATE TABLE jiveGroupPerm (
forumID INT NOT NULL,
groupID INT NOT NULL,
permission INT NOT NULL,
PRIMARY KEY (forumID, groupID,permission)
);
CREATE INDEX jiveGroupPerm_groupID_idx ON jiveGroupPerm (groupID);
CREATE TABLE jiveGroupProp (
groupID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (groupID, name)
);
CREATE TABLE jiveGroupUser (
groupID INT NOT NULL ,
userID INT NOT NULL ,
administrator INT NOT NULL,
PRIMARY KEY (groupID, userID)
);
CREATE INDEX jiveGroupUser_userID_idx ON jiveGroupUser (userID);
CREATE TABLE jiveID (
idType INT NOT NULL PRIMARY KEY,
id INT NOT NULL,
);
CREATE TABLE jiveModeration (
objectID INT NOT NULL,
objectType INT NOT NULL,
userID INT NULL,
modDate VARCHAR(15) NOT NULL,
modValue INT NOT NULL,
);
CREATE INDEX jiveModeration_objectID_idx ON jiveModeration (objectID);
CREATE INDEX jiveModeration_userID_idx ON JiveModeration (userID);
CREATE INDEX jiveModeration_objectType_idx ON JiveModeration (objectType);
CREATE TABLE jiveWatch (
userID INT NOT NULL ,
forumID INT NOT NULL ,
threadID INT NOT NULL ,
watchType INT NOT NULL ,
expirable INT NOT NULL,
PRIMARY KEY (userID, forumID,watchType)
);
CREATE INDEX jiveWatch_userID_idx ON jiveWatch (userID);
CREATE INDEX jiveWatch_forumID_idx ON jiveWatch (forumID);
CREATE INDEX jiveWatch_threadID_idx ON jiveWatch (threadID);
CREATE INDEX jiveWatch_type_idx ON jiveWatch (watchType);
CREATE TABLE jiveReward (
userID INT NOT NULL,
creationDate VARCHAR(15) NOT NULL,
rewardPoints INT NOT NULL,
messageID INT NULL,
threadID INT NULL,
PRIMARY KEY (userID, creationDate)
);
CREATE INDEX jiveReward_userID_idx ON jiveReward (userID);
CREATE INDEX jiveReward_creationDate_idx ON jiveReward (creationDate);
CREATE INDEX jiveReward_messageID_idx ON jiveReward (messageID);
CREATE INDEX jiveReward_threadID_idx ON jiveReward (threadID);
ALTER TABLE jiveForumProp ADD CONSTRAINT jiveForumProp_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveThread ADD CONSTRAINT jiveThread_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
/*
Note: need to figure out how to make constraints deferrable
under SQL Server. Until then, disable certain fk's.
*/
ALTER TABLE jiveThreadProp ADD CONSTRAINT jiveThreadProp_threadID_fk
FOREIGN KEY (threadID) REFERENCES jiveThread;
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_parentMsgID_fk
FOREIGN KEY (parentMessageID) REFERENCES jiveMessage(messageID);
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_threadID_fk
FOREIGN KEY (threadID) REFERENCES jiveThread;
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
ALTER TABLE jiveMessageProp ADD CONSTRAINT jiveMessageProp_msgID_fk
FOREIGN KEY (messageID) REFERENCES jiveMessage;
ALTER TABLE jiveUserPerm ADD CONSTRAINT jiveUserPerm_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveUserPerm ADD CONSTRAINT jiveUserPerm_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
ALTER TABLE jiveUserProp ADD CONSTRAINT jiveUserProp_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
ALTER TABLE jiveGroupPerm ADD CONSTRAINT jiveGroupPerm_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveGroupPerm ADD CONSTRAINT jiveGroupPerm_groupID_fk
FOREIGN KEY (groupID) REFERENCES jiveGroup;
ALTER TABLE jiveGroupProp ADD CONSTRAINT jiveGroupProp_groupID_fk
FOREIGN KEY (groupID) REFERENCES jiveGroup;
ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_groupID_fk
FOREIGN KEY (groupID) REFERENCES jiveGroup;
ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
/* Unique ID entry for forum, thread, messages, user, group. */
/* The User ID entry starts at 2 (after admin user entry). */
INSERT INTO jiveID VALUES (0, 1);
INSERT INTO jiveID VALUES (1, 1);
INSERT INTO jiveID VALUES (2, 1);
INSERT INTO jiveID VALUES (3, 2);
INSERT INTO jiveID VALUES (4, 1);
/* Entry for admin user -- password is 'admin' */
INSERT INTO jiveUser (userID,username,passwordHash,name,nameVisible,email,emailVisible,rewardPoints,creationDate,modifiedDate)
VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3','Administrator',1,'admin@yoursite.com',1,0,'0','0');
INSERT INTO jiveUserPerm(forumID,userID,userType,permission)
VALUES (NULL,1,3,1);
forumID INT NOT NULL PRIMARY KEY,
name VARCHAR(255) UNIQUE NOT NULL,
description TEXT NULL,
modDefaultThreadVal INT NOT NULL,
modMinThreadVal INT NOT NULL,
modDefaultMsgVal INT NOT NULL,
modMinMsgVal INT NOT NULL,
modifiedDate VARCHAR(15) NOT NULL,
creationDate VARCHAR(15) NOT NULL,
);
CREATE TABLE jiveForumProp (
forumID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (forumID, name),
);
CREATE TABLE jiveThread (
threadID INT NOT NULL PRIMARY KEY,
forumID INT NOT NULL,
rootMessageID INT NOT NULL,
modValue INT NOT NULL,
rewardPoints INT NOT NULL,
creationDate CHAR(15) NOT NULL,
modifiedDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveThread_forumID_idx ON jiveThread (forumID);
CREATE INDEX jiveThread_modValue_idx ON jiveThread (modValue);
CREATE INDEX jiveThread_cDate_idx ON jiveThread (creationDate);
CREATE INDEX jiveThread_mDate_idx ON jiveThread (modifiedDate);
CREATE TABLE jiveThreadProp (
threadID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (threadID, name)
);
CREATE TABLE jiveMessage (
messageID INT NOT NULL PRIMARY KEY,
parentMessageID INT NULL,
threadID INT NOT NULL,
forumID INT NOT NULL,
userID INT NULL,
subject VARCHAR(255) NULL,
body TEXT NULL,
modValue INT NOT NULL,
rewardPoints INT NOT NULL,
creationDate CHAR(15) NOT NULL,
modifiedDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveMessage_threadID_idx ON jiveMessage (threadID);
CREATE INDEX jiveMessage_forumID_modVal_idx ON jiveMessage(forumID, modValue);
CREATE INDEX jiveMessage_userID_idx ON jiveMessage (userID);
CREATE INDEX jiveMessage_cDate_idx ON jiveMessage (creationDate);
CREATE INDEX jiveMessage_mDate_idx ON jiveMessage (modifiedDate);
CREATE TABLE jiveMessageProp (
messageID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (messageID, name)
);
CREATE TABLE jiveUser (
userID INT NOT NULL PRIMARY KEY ,
username VARCHAR(30) UNIQUE NOT NULL,
passwordHash VARCHAR(32) NOT NULL,
name VARCHAR(100) NULL,
nameVisible INT NOT NULL,
email VARCHAR(100) NOT NULL,
emailVisible INT NOT NULL,
rewardPoints INT NOT NULL,
creationDate CHAR(15) NOT NULL,
modifiedDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveUser_cDate_idx ON jiveUser (creationDate);
CREATE TABLE jiveUserPerm (
forumID INT NULL,
userID INT NULL,
userType INT NOT NULL,
permission INT NOT NULL,
);
CREATE INDEX jiveUserPerm_forumID_idx ON jiveUserPerm (forumID);
CREATE INDEX jiveUserPerm_userID_idx ON jiveUserPerm (userID);
CREATE TABLE jiveUserProp (
userID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (userID, name)
);
CREATE TABLE jiveGroup (
groupID INT NOT NULL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
description VARCHAR(255) NULL,
modifiedDate CHAR(15) NOT NULL,
creationDate CHAR(15) NOT NULL,
);
CREATE INDEX jiveGroup_cDate_idx ON jiveGroup (creationDate);
CREATE TABLE jiveGroupPerm (
forumID INT NOT NULL,
groupID INT NOT NULL,
permission INT NOT NULL,
PRIMARY KEY (forumID, groupID,permission)
);
CREATE INDEX jiveGroupPerm_groupID_idx ON jiveGroupPerm (groupID);
CREATE TABLE jiveGroupProp (
groupID INT NOT NULL,
name VARCHAR(100) NOT NULL,
propValue TEXT NOT NULL,
PRIMARY KEY (groupID, name)
);
CREATE TABLE jiveGroupUser (
groupID INT NOT NULL ,
userID INT NOT NULL ,
administrator INT NOT NULL,
PRIMARY KEY (groupID, userID)
);
CREATE INDEX jiveGroupUser_userID_idx ON jiveGroupUser (userID);
CREATE TABLE jiveID (
idType INT NOT NULL PRIMARY KEY,
id INT NOT NULL,
);
CREATE TABLE jiveModeration (
objectID INT NOT NULL,
objectType INT NOT NULL,
userID INT NULL,
modDate VARCHAR(15) NOT NULL,
modValue INT NOT NULL,
);
CREATE INDEX jiveModeration_objectID_idx ON jiveModeration (objectID);
CREATE INDEX jiveModeration_userID_idx ON JiveModeration (userID);
CREATE INDEX jiveModeration_objectType_idx ON JiveModeration (objectType);
CREATE TABLE jiveWatch (
userID INT NOT NULL ,
forumID INT NOT NULL ,
threadID INT NOT NULL ,
watchType INT NOT NULL ,
expirable INT NOT NULL,
PRIMARY KEY (userID, forumID,watchType)
);
CREATE INDEX jiveWatch_userID_idx ON jiveWatch (userID);
CREATE INDEX jiveWatch_forumID_idx ON jiveWatch (forumID);
CREATE INDEX jiveWatch_threadID_idx ON jiveWatch (threadID);
CREATE INDEX jiveWatch_type_idx ON jiveWatch (watchType);
CREATE TABLE jiveReward (
userID INT NOT NULL,
creationDate VARCHAR(15) NOT NULL,
rewardPoints INT NOT NULL,
messageID INT NULL,
threadID INT NULL,
PRIMARY KEY (userID, creationDate)
);
CREATE INDEX jiveReward_userID_idx ON jiveReward (userID);
CREATE INDEX jiveReward_creationDate_idx ON jiveReward (creationDate);
CREATE INDEX jiveReward_messageID_idx ON jiveReward (messageID);
CREATE INDEX jiveReward_threadID_idx ON jiveReward (threadID);
ALTER TABLE jiveForumProp ADD CONSTRAINT jiveForumProp_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveThread ADD CONSTRAINT jiveThread_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
/*
Note: need to figure out how to make constraints deferrable
under SQL Server. Until then, disable certain fk's.
*/
ALTER TABLE jiveThreadProp ADD CONSTRAINT jiveThreadProp_threadID_fk
FOREIGN KEY (threadID) REFERENCES jiveThread;
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_parentMsgID_fk
FOREIGN KEY (parentMessageID) REFERENCES jiveMessage(messageID);
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_threadID_fk
FOREIGN KEY (threadID) REFERENCES jiveThread;
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveMessage ADD CONSTRAINT jiveMessage_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
ALTER TABLE jiveMessageProp ADD CONSTRAINT jiveMessageProp_msgID_fk
FOREIGN KEY (messageID) REFERENCES jiveMessage;
ALTER TABLE jiveUserPerm ADD CONSTRAINT jiveUserPerm_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveUserPerm ADD CONSTRAINT jiveUserPerm_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
ALTER TABLE jiveUserProp ADD CONSTRAINT jiveUserProp_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
ALTER TABLE jiveGroupPerm ADD CONSTRAINT jiveGroupPerm_forumID_fk
FOREIGN KEY (forumID) REFERENCES jiveForum;
ALTER TABLE jiveGroupPerm ADD CONSTRAINT jiveGroupPerm_groupID_fk
FOREIGN KEY (groupID) REFERENCES jiveGroup;
ALTER TABLE jiveGroupProp ADD CONSTRAINT jiveGroupProp_groupID_fk
FOREIGN KEY (groupID) REFERENCES jiveGroup;
ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_groupID_fk
FOREIGN KEY (groupID) REFERENCES jiveGroup;
ALTER TABLE jiveGroupUser ADD CONSTRAINT jiveGroupUser_userID_fk
FOREIGN KEY (userID) REFERENCES jiveUser;
/* Unique ID entry for forum, thread, messages, user, group. */
/* The User ID entry starts at 2 (after admin user entry). */
INSERT INTO jiveID VALUES (0, 1);
INSERT INTO jiveID VALUES (1, 1);
INSERT INTO jiveID VALUES (2, 1);
INSERT INTO jiveID VALUES (3, 2);
INSERT INTO jiveID VALUES (4, 1);
/* Entry for admin user -- password is 'admin' */
INSERT INTO jiveUser (userID,username,passwordHash,name,nameVisible,email,emailVisible,rewardPoints,creationDate,modifiedDate)
VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3','Administrator',1,'admin@yoursite.com',1,0,'0','0');
INSERT INTO jiveUserPerm(forumID,userID,userType,permission)
VALUES (NULL,1,3,1);
相關文章
- jive資料庫配置資料庫
- jive的資料庫連線配置問題資料庫
- 請教Jive資料庫問題資料庫
- 關於jive資料庫連結的錯誤?資料庫
- 請教:關於jive的資料庫設計資料庫
- jive安裝連資料庫問題?資料庫
- JIVE用MYSQL資料庫的問題(菜鳥級)MySql資料庫
- 安裝jive中的一個資料庫問題?資料庫
- 請教,JIVE如何聯接SYBASE資料庫?資料庫
- 請問有在Jive中用oracle作資料庫的嗎?Oracle資料庫
- jive能使用SQLServer資料庫嗎,怎麼用?SQLServer資料庫
- jive3.1.4安裝資料庫出現問題!!!資料庫
- 在設定JIVE資料庫驅動時出錯資料庫
- 安裝jive時,“資料庫連線”項的driver該如何填?資料庫
- 關於JIVE安裝配置後資料庫Encoding的問題資料庫Encoding
- jive安裝時資料庫如何設定,我用的是MS SQLServer?資料庫SQLServer
- 請問:安裝jive時,“資料庫連線”項的driver該如何填?資料庫
- jive 問題 如何在jsp頁面實現資料庫資訊的更新??JS資料庫
- Jive 用 Oracle 資料庫可以嗎?配置Jive時有如下 錯誤資訊,請教?小女子年方22,未嫁Oracle資料庫
- Jive安裝不成功:跳過了資料庫設定頁面資料庫
- 請教問題:jive1.2.4資料庫連線問題,謝謝資料庫
- 請問:安裝jive時,“資料庫連線”項的driver該如何填?我用的是Microsoft Sql Server2000資料庫的資料庫ROSSQLServer
- 安裝Jive進行資料庫設定時報錯,請大家都我看看。資料庫
- Jive(J道)升級通知(又一資料庫批次查詢方法應用)資料庫
- 請教高手,jive在jbuilder6下如何配置?資料庫是sql server?UI資料庫SQLServer
- 【請教】JIVE論壇安裝時資料庫檔案應當如何設定資料庫
- 請問jive可以用odbc的資料來源嘛?
- 哪位兄臺幫我看看JIVE安裝問題, 資料庫連線出錯!加急!!!資料庫
- 資料庫 資料庫的完整性資料庫
- 生產資料庫、開發資料庫、測試資料庫中的資料的區分資料庫
- 包含DOMAIN的資料庫建立資料庫鏈到不包含DOMAIN的資料庫AI資料庫
- Oracle資料庫-----資料庫的基本概念Oracle資料庫
- 【資料庫設計】資料庫的設計資料庫
- 怎麼配置jive使用容器的資料來源和連線池?
- sqlite 資料庫的資料字典SQLite資料庫
- Jive筆記7 -- Jive的硬傷 (轉)筆記
- Jive論壇資料庫指令碼沒有安裝。請按照安裝文件修正此錯誤。資料庫指令碼
- 【資料庫資料恢復】如何恢復Oracle資料庫truncate表的資料資料庫資料恢復Oracle