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.

55 lines
2.1 KiB

  1. MySQL database "literature", table "user_formats"
  2. =================================================
  3. field names
  4. -----------
  5. fields available in table "user_formats" description
  6. ---------------------------------------- -----------
  7. user_format_id the unique ID number of this user format entry
  8. format_id the unique ID number of the referenced export format (which corresponds to the format_id number of the format's entry within the "export_formats" table)
  9. 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)
  10. show_format specifies whether the referenced export format will be displayed within the formats popup ('true') or not ('false')
  11. column types
  12. ------------
  13. user_format_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  14. format_id MEDIUMINT UNSIGNED NOT NULL
  15. user_id MEDIUMINT UNSIGNED NOT NULL
  16. show_format ENUM("true","false") NOT NULL
  17. INDEX (format_id,user_id)
  18. table creation code
  19. -------------------
  20. CREATE TABLE user_formats (user_format_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, format_id MEDIUMINT UNSIGNED NOT NULL, user_id MEDIUMINT UNSIGNED NOT NULL, show_format ENUM("true","false") NOT NULL, INDEX (format_id,user_id));
  21. rules for data import
  22. ---------------------
  23. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  24. - order of fields must resemble the above field order!
  25. - DATE format must be YYYY-MM-DD
  26. - TIME format must be HH:MM:SS
  27. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  28. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  29. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  30. - file encoding must be UNIX
  31. load data code
  32. --------------
  33. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/user_formats.txt" INTO TABLE user_formats;
  34. or, alternatively, use something like the following from your shell:
  35. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/user_formats.txt"