20260228063131-photographers.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 'use strict';
  2. /** @type {import('sequelize-cli').Migration} */
  3. module.exports = {
  4. async up (queryInterface, Sequelize) {
  5. await queryInterface.createTable('photographers', {
  6. photographer_id: {
  7. allowNull: false,
  8. autoIncrement: true,
  9. primaryKey: true,
  10. type: Sequelize.DataTypes.INTEGER
  11. },
  12. full_name: {
  13. type: Sequelize.DataTypes.STRING(100),
  14. allowNull: false,
  15. comment: 'ФИО фотографа'
  16. },
  17. specialization: {
  18. type: Sequelize.DataTypes.STRING(50),
  19. allowNull: true,
  20. comment: 'Специализация'
  21. },
  22. phone_number: {
  23. type: Sequelize.DataTypes.STRING(20),
  24. allowNull: true,
  25. comment: 'Номер телефона'
  26. },
  27. rating: {
  28. type: Sequelize.DataTypes.DECIMAL(3, 2),
  29. allowNull: true,
  30. defaultValue: 0.00,
  31. comment: 'Рейтинг'
  32. },
  33. is_available: {
  34. type: Sequelize.DataTypes.BOOLEAN,
  35. allowNull: true,
  36. defaultValue: true,
  37. comment: 'Доступен ли фотограф'
  38. }
  39. })
  40. },
  41. async down (queryInterface, Sequelize) {
  42. await queryInterface.dropTable('photographers')
  43. }
  44. }