Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. 'use strict';
  2. module.exports = {
  3. up: (queryInterface, Sequelize) => {
  4. return queryInterface.createTable('Orders', {
  5. id: {
  6. type: Sequelize.CHAR
  7. },
  8. storeId: {
  9. type: Sequelize.INTEGER,
  10. references: {
  11. model: 'Stores',
  12. key: 'id'
  13. }
  14. },
  15. createdAt: {
  16. allowNull: false,
  17. type: Sequelize.DATE
  18. },
  19. updatedAt: {
  20. allowNull: false,
  21. type: Sequelize.DATE
  22. }
  23. });
  24. },
  25. down: (queryInterface, Sequelize) => {
  26. return queryInterface.dropTable('Orders');
  27. }
  28. };
  29.  
  30. 'use strict';
  31. module.exports = {
  32. up: (queryInterface, Sequelize) => {
  33. return queryInterface.createTable('Stores', {
  34. id: {
  35. allowNull: false,
  36. autoIncrement: true,
  37. primaryKey: true,
  38. type: Sequelize.INTEGER
  39. },
  40. login: {
  41. type: Sequelize.CHAR
  42. },
  43. uuid: {
  44. type: Sequelize.CHAR
  45. },
  46. createdAt: {
  47. allowNull: false,
  48. type: Sequelize.DATE
  49. },
  50. updatedAt: {
  51. allowNull: false,
  52. type: Sequelize.DATE
  53. }
  54. });
  55. },
  56. down: (queryInterface, Sequelize) => {
  57. return queryInterface.dropTable('Stores');
  58. }
  59. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement