project.model.js 1.1 KB

1234567891011121314151617181920212223
  1. /**
  2. * @file Provides the model for projects.
  3. * @author Inigo Valentin
  4. * @since 4.0.0
  5. */
  6. module.exports = (sequelize, Sequelize) => {
  7. Project = sequelize.define("project", {
  8. id: {allowNull: false, autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER},
  9. permalink: {allowNull: false, type: Sequelize.STRING(64)},
  10. user: {allowNull: false, type: Sequelize.INTEGER, references: {model: "users", key: "id"}},
  11. idx: {allowNull: false, type: Sequelize.SMALLINT},
  12. projectTypeId: {allowNull: false, type: Sequelize.INTEGER, references: {model: "project-types", key: "id"}},
  13. title: {allowNull: false, type: Sequelize.STRING(64)},
  14. logo: {type: Sequelize.STRING(64)},
  15. header: {allowNull: false, type: Sequelize.STRING(64)},//, references: {model: "texts", key: "id"}},
  16. text: {type: Sequelize.STRING(64)},//, references: {model: "texts", key: "id"}},
  17. comment: {type: Sequelize.STRING(64)},//, references: {model: "texts", key: "id"}},
  18. licenseId: {allowNull: false, type: Sequelize.INTEGER, references: {model: "licenses", key: "id"}},
  19. visible: {allowNull: false, type: Sequelize.BOOLEAN},
  20. });
  21. return Project;
  22. }