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.

69 lines
3.5 KiB

  1. MySQL database "literature", table "user_options"
  2. =================================================
  3. field names
  4. -----------
  5. fields available in table "user_options" description
  6. ---------------------------------------- -----------
  7. option_id the unique ID number of this user option entry
  8. user_id the user's unique ID number (which corresponds to the user_id number of the user's record entry within the 'users' table)
  9. export_cite_keys controls whether to include cite keys on export or not
  10. autogenerate_cite_keys controls whether cite keys will be auto-generated on export
  11. prefer_autogenerated_cite_keys controls whether auto-generated cite keys will overwrite record-specific contents from the user-specific 'cite_key' field on export
  12. use_custom_cite_key_format controls whether the user's custom cite key format shall be used (instead of the default cite key format provided by the admin)
  13. cite_key_format the user's custom cite key format
  14. uniquify_duplicate_cite_keys controls whether to add incrementing numbers to any duplicate cite keys
  15. nonascii_chars_in_cite_keys controls how non-ASCII characters will be treated in cite keys (keep empty in order to use site default)
  16. use_custom_text_citation_format controls whether the user's custom text citation format shall be used (instead of the default text citation format provided by the admin)
  17. text_citation_format the user's custom text citation format
  18. column types
  19. ------------
  20. option_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  21. user_id MEDIUMINT UNSIGNED NOT NULL
  22. export_cite_keys ENUM('yes','no') NOT NULL
  23. autogenerate_cite_keys ENUM('yes','no') NOT NULL
  24. prefer_autogenerated_cite_keys ENUM('no','yes') NOT NULL
  25. use_custom_cite_key_format ENUM('no','yes') NOT NULL
  26. cite_key_format VARCHAR(255)
  27. uniquify_duplicate_cite_keys ENUM('yes','no') NOT NULL
  28. nonascii_chars_in_cite_keys ENUM('transliterate','strip','keep')
  29. use_custom_text_citation_format ENUM('no','yes') NOT NULL
  30. text_citation_format VARCHAR(255)
  31. INDEX (user_id)
  32. table creation code
  33. -------------------
  34. CREATE TABLE user_options (option_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id MEDIUMINT UNSIGNED NOT NULL, export_cite_keys ENUM('yes','no') NOT NULL, autogenerate_cite_keys ENUM('yes','no') NOT NULL, prefer_autogenerated_cite_keys ENUM('no','yes') NOT NULL, use_custom_cite_key_format ENUM('no','yes') NOT NULL, cite_key_format VARCHAR(255), uniquify_duplicate_cite_keys ENUM('yes','no') NOT NULL, nonascii_chars_in_cite_keys ENUM('transliterate','strip','keep'), use_custom_text_citation_format ENUM('no','yes') NOT NULL, text_citation_format VARCHAR(255), INDEX (user_id));
  35. rules for data import
  36. ---------------------
  37. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  38. - order of fields must resemble the above field order!
  39. - DATE format must be YYYY-MM-DD
  40. - TIME format must be HH:MM:SS
  41. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  42. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  43. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  44. - file encoding must be UNIX
  45. load data code
  46. --------------
  47. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/user_options.txt" INTO TABLE user_options;
  48. or, alternatively, use something like the following from your shell:
  49. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/user_options.txt"