llx_ecm_files.sql 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. -- ===================================================================
  2. -- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
  3. --
  4. -- This program is free software; you can redistribute it and/or modify
  5. -- it under the terms of the GNU General Public License as published by
  6. -- the Free Software Foundation; either version 3 of the License, or
  7. -- (at your option) any later version.
  8. --
  9. -- This program is distributed in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. -- GNU General Public License for more details.
  13. --
  14. -- You should have received a copy of the GNU General Public License
  15. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. --
  17. -- ===================================================================
  18. CREATE TABLE llx_ecm_files
  19. (
  20. rowid integer AUTO_INCREMENT PRIMARY KEY,
  21. ref varchar(128), -- contains hash from filename+filepath
  22. label varchar(128) NOT NULL, -- contains hash of file content
  23. share varchar(128) NULL, -- contains hash for file sharing
  24. entity integer DEFAULT 1 NOT NULL, -- multi company id
  25. filepath varchar(255) NOT NULL, -- relative to dolibarr document dir. Example module/def
  26. filename varchar(255) NOT NULL, -- file name only without any directory
  27. src_object_type varchar(64), -- Source object type ('proposal', 'invoice', ...)
  28. src_object_id integer, -- Source object id
  29. fullpath_orig varchar(750), -- full path of original filename, when file is uploaded from a local computer
  30. description text,
  31. keywords varchar(750), -- list of keywords, separated with comma. Must be limited to most important keywords.
  32. cover text, -- is this file a file to use for a cover
  33. position integer, -- position of file among others
  34. gen_or_uploaded varchar(12), -- 'generated' or 'uploaded'
  35. extraparams varchar(255), -- for stocking other parameters with json format
  36. date_c datetime,
  37. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  38. fk_user_c integer,
  39. fk_user_m integer,
  40. note_private text,
  41. note_public text,
  42. acl text -- for future permission 'per file'
  43. ) ENGINE=innodb;