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.

61 lines
2.5 KiB

  1. MySQL database "literature", table "formats"
  2. ============================================
  3. field names
  4. -----------
  5. fields available in table "formats" description
  6. ----------------------------------- -----------
  7. format_id the unique ID number of this format entry
  8. format_name the display name of this format as it occurs within the formats popup
  9. format_type the type of this format, either 'import' or 'export'
  10. format_enabled specifies globally whether the referenced format can be displayed within the formats popup ('true') [if a user chooses so] or not ('false')
  11. format_spec the unique name of the file holding the function that will output this format (format files must be located either within the 'export' or the 'import' directory)
  12. order_by a string that specifies the primary sort order for this entry (secondary sort order is by format name)
  13. depends_id the unique ID number of the referenced external utility that's required for this format (the ID corresponds to the depends_id number of the utility's entry within the "depends" table)
  14. column types
  15. ------------
  16. format_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  17. format_name VARCHAR(100)
  18. format_type ENUM("export","import") NOT NULL
  19. format_enabled ENUM("true","false") NOT NULL
  20. format_spec VARCHAR(255)
  21. order_by VARCHAR(25)
  22. depends_id MEDIUMINT UNSIGNED NOT NULL
  23. INDEX (format_name)
  24. table creation code
  25. -------------------
  26. CREATE TABLE formats (format_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, format_name VARCHAR(100), format_type ENUM("export","import") NOT NULL, format_enabled ENUM("true","false") NOT NULL, format_spec VARCHAR(255), order_by VARCHAR(25), depends_id MEDIUMINT UNSIGNED NOT NULL, INDEX (format_name));
  27. rules for data import
  28. ---------------------
  29. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  30. - order of fields must resemble the above field order!
  31. - DATE format must be YYYY-MM-DD
  32. - TIME format must be HH:MM:SS
  33. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  34. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  35. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  36. - file encoding must be UNIX
  37. load data code
  38. --------------
  39. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/formats.txt" INTO TABLE formats;
  40. or, alternatively, use something like the following from your shell:
  41. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/formats.txt"