Monorepo containing core modules of Zeichen.
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.

100 lines
1.8 KiB

  1. import * as DataType from 'sequelize'
  2. export default {
  3. tableName: 'notes',
  4. modelName: 'Note',
  5. options: {
  6. timestamps: true,
  7. paranoid: true,
  8. createdAt: 'createdAt',
  9. updatedAt: 'updatedAt',
  10. deletedAt: 'deletedAt',
  11. },
  12. rawAttributes: {
  13. id: {
  14. allowNull: true,
  15. primaryKey: true,
  16. type: DataType.UUIDV4,
  17. },
  18. title: {
  19. allowNull: false,
  20. type: DataType.STRING,
  21. },
  22. content: {
  23. allowNull: true,
  24. type: DataType.TEXT({ length: 'long', }),
  25. },
  26. folderId: {
  27. allowNull: true,
  28. type: DataType.UUIDV4,
  29. },
  30. createdAt: {
  31. allowNull: false,
  32. type: DataType.DATE,
  33. },
  34. updatedAt: {
  35. allowNull: false,
  36. type: DataType.DATE,
  37. },
  38. deletedAt: {
  39. allowNull: true,
  40. type: DataType.DATE,
  41. },
  42. },
  43. }
  44. // import 'reflect-metadata'
  45. // import {
  46. // AllowNull,
  47. // BelongsTo,
  48. // Column,
  49. // CreatedAt,
  50. // DeletedAt,
  51. // ForeignKey,
  52. // Model,
  53. // PrimaryKey,
  54. // Table,
  55. // UpdatedAt,
  56. // DataType,
  57. // } from 'sequelize-typescript'
  58. // import Folder from './Folder'
  59. //
  60. // @Table({
  61. // timestamps: true,
  62. // paranoid: true,
  63. // })
  64. // export default class Model extends Model<Model> {
  65. // @AllowNull
  66. // @PrimaryKey
  67. // @Column(DataType.UUIDV4)
  68. // id?: string
  69. //
  70. // @Column
  71. // title: string
  72. //
  73. // @AllowNull
  74. // @Column(DataType.TEXT({ length: 'long' }))
  75. // content?: string
  76. //
  77. // @AllowNull
  78. // @ForeignKey(() => Folder)
  79. // @Column(DataType.UUIDV4)
  80. // folderId?: string
  81. //
  82. // @BelongsTo(() => Folder, 'folderId')
  83. // folder?: Folder
  84. //
  85. // @Column(DataType.DATE)
  86. // @CreatedAt
  87. // createdAt: Date
  88. //
  89. // @Column(DataType.DATE)
  90. // @UpdatedAt
  91. // updatedAt: Date
  92. //
  93. // @AllowNull
  94. // @Column(DataType.DATE)
  95. // @DeletedAt
  96. // deletedAt?: Date
  97. // }