Commit 330399b9b5497e952cfd3920d2b831ec4efce5dd

Authored by omar
1 parent 31dcea39

*** 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 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 22 CREATE TABLE document_text (
4 23 id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
5 24 document_id integer,
... ... @@ -317,8 +336,6 @@ id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
317 336 name CHAR(50) NOT NULL
318 337 )TYPE = InnoDB;
319 338  
320   -
321   -
322 339 CREATE TABLE web_sites (
323 340 id INTEGER NOT NULL UNIQUE AUTO_INCREMENT,
324 341 web_site_name CHAR(100) NOT NULL,
... ... @@ -332,6 +349,16 @@ word CHAR(255) NOT NULL
332 349 )TYPE = InnoDB;
333 350  
334 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 362 ALTER TABLE active_sessions
336 363 ADD CONSTRAINT PK_active_sessions
337 364 PRIMARY KEY (id)
... ...