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
1.1 KiB

  1. 'use strict'
  2. /**
  3. * Document schema
  4. */
  5. module.exports = (sequelize, DataTypes) => {
  6. let documentSchema = sequelize.define('setting', {
  7. path: {
  8. type: DataTypes.STRING,
  9. allowNull: false
  10. },
  11. title: {
  12. type: DataTypes.STRING,
  13. allowNull: false,
  14. validate: {
  15. len: [2, 255]
  16. }
  17. },
  18. subtitle: {
  19. type: DataTypes.STRING,
  20. allowNull: true,
  21. defaultValue: ''
  22. },
  23. parentPath: {
  24. type: DataTypes.STRING,
  25. allowNull: true,
  26. defaultValue: ''
  27. },
  28. parentTitle: {
  29. type: DataTypes.STRING,
  30. allowNull: true,
  31. defaultValue: ''
  32. },
  33. isDirectory: {
  34. type: DataTypes.BOOLEAN,
  35. allowNull: false,
  36. defaultValue: false
  37. },
  38. isEntry: {
  39. type: DataTypes.BOOLEAN,
  40. allowNull: false,
  41. defaultValue: false
  42. },
  43. searchContent: {
  44. type: DataTypes.TEXT,
  45. allowNull: true,
  46. defaultValue: ''
  47. }
  48. }, {
  49. timestamps: true,
  50. version: true,
  51. indexes: [
  52. {
  53. unique: true,
  54. fields: ['path']
  55. }
  56. ]
  57. })
  58. return documentSchema
  59. }