Original: https://www.mediawiki.org/wiki/Extension:Comments Das hier ist eine an https://znil.net angepasste Version.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

comments.oracle.sql 1.4KB

123456789101112131415161718192021222324252627282930313233
  1. -- Oracle variant of Comments' database schema
  2. -- This is probably crazy, but so is Oracle. I've never used Oracle so
  3. -- there's a fair chance that the code is full of bugs, stupid things or both.
  4. -- Please feel free to submit patches or just go ahead and fix it.
  5. --
  6. -- This DOES NOT build at SQLFiddle.com...
  7. --
  8. -- Author: Jack Phoenix
  9. -- Date: 24 July 2013
  10. -- No idea if this is needed, but /maintenance/oracle/tables.sql uses it, so I
  11. -- guess it serves some purpose here, too
  12. define mw_prefix='{$wgDBprefix}';
  13. CREATE SEQUENCE Comments_CommentID_seq;
  14. CREATE TABLE &mw_prefix.Comments (
  15. CommentID NUMBER NOT NULL,
  16. Comment_Page_ID NUMBER NOT NULL DEFAULT 0,
  17. Comment_user_id NUMBER NOT NULL DEFAULT 0,
  18. Comment_Username VARCHAR2(200) NOT NULL,
  19. -- CLOB (original MySQL one uses text), as per http://stackoverflow.com/questions/1180204/oracle-equivalent-of-mysqls-text-type
  20. Comment_Text CLOB NOT NULL,
  21. Comment_Date TIMESTAMP(6) WITH TIME ZONE NOT NULL,
  22. Comment_Parent_ID NUMBER NOT NULL DEFAULT 0,
  23. Comment_IP VARCHAR2(45) NOT NULL,
  24. );
  25. CREATE INDEX &mw_prefix.comment_page_id_index ON &mw_prefix.Comments (Comment_Page_ID);
  26. CREATE INDEX &mw_prefix.wiki_user_id ON &mw_prefix.Comments (Comment_user_id);
  27. CREATE INDEX &mw_prefix.wiki_user_name ON &mw_prefix.Comments (Comment_Username);
  28. ALTER TABLE &mw_prefix.Comments ADD CONSTRAINT &mw_prefix.Comments_pk PRIMARY KEY (CommentID);