Commit c4bc7cff20a2d81890bf5cffc7c7f8f69cff9c16

Authored by omar
1 parent b8715b74

*** empty log message ***


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1778 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 29 additions and 2 deletions
sql/tables.sql
1 -- table definitions 1 -- table definitions
2 2
  3 +CREATE TABLE discussion_threads (
  4 +id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
  5 +document_id INTEGER NOT NULL,
  6 +forst_comment_id INTEGER NOT NULL,
  7 +last_comment_id INTEGER NOT NULL,
  8 +views INTEGER NOT NULL,
  9 +replies INTEGER NOT NULL,
  10 +creator_id INTEGER NOT NULL
  11 +)TYPE = InnoDB;
  12 +
  13 +CREATE TABLE discussion_comments (
  14 +id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
  15 +thread_id INTEGER NOT NULL,
  16 +user_comment_id INTEGER NOT NULL,
  17 +subject_comment_id INTEGER NOT NULL,
  18 +body TEXT,
  19 +date date
  20 +)TYPE = InnoDB;
  21 +
3 CREATE TABLE document_text ( 22 CREATE TABLE document_text (
4 id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, 23 id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
5 document_id integer, 24 document_id integer,
@@ -317,8 +336,6 @@ id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, @@ -317,8 +336,6 @@ id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
317 name CHAR(50) NOT NULL 336 name CHAR(50) NOT NULL
318 )TYPE = InnoDB; 337 )TYPE = InnoDB;
319 338
320 -  
321 -  
322 CREATE TABLE web_sites ( 339 CREATE TABLE web_sites (
323 id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, 340 id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
324 web_site_name CHAR(100) NOT NULL, 341 web_site_name CHAR(100) NOT NULL,
@@ -332,6 +349,16 @@ word CHAR(255) NOT NULL @@ -332,6 +349,16 @@ word CHAR(255) NOT NULL
332 )TYPE = InnoDB; 349 )TYPE = InnoDB;
333 350
334 -- pk constraints 351 -- pk constraints
  352 +ALTER TABLE discussion_threads
  353 +ADD CONSTRAINT PK_discussion_threads
  354 +PRIMARY KEY (id)
  355 +;
  356 +
  357 +ALTER TABLE discussion_comments
  358 +ADD CONSTRAINT PK_discussion_comments
  359 +PRIMARY KEY (id)
  360 +;
  361 +
335 ALTER TABLE active_sessions 362 ALTER TABLE active_sessions
336 ADD CONSTRAINT PK_active_sessions 363 ADD CONSTRAINT PK_active_sessions
337 PRIMARY KEY (id) 364 PRIMARY KEY (id)