Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. return queryInterface.createTable(
  2.  
  3. { schema: "student", tableName: "students" },
  4.  
  5. {
  6.  
  7. email: {
  8.  
  9. type: Sequelize.STRING,
  10.  
  11. primaryKey: true
  12.  
  13. },
  14.  
  15. password: {
  16.  
  17. type: Sequelize.STRING
  18.  
  19. },
  20.  
  21. fname: {
  22.  
  23. type: Sequelize.STRING
  24.  
  25. },
  26.  
  27. lname: {
  28.  
  29. type: Sequelize.STRING
  30.  
  31. },
  32.  
  33. createdAt: {
  34.  
  35. allowNull: false,
  36.  
  37. type: Sequelize.DATE
  38.  
  39. },
  40.  
  41. updatedAt: {
  42.  
  43. allowNull: false,
  44.  
  45. type: Sequelize.DATE
  46.  
  47. },
  48.  
  49. courseId: {
  50.  
  51. type: Sequelize.STRING,
  52.  
  53. references: {schema:"student", model: "courses", key:'cId'},
  54.  
  55. }
  56.  
  57. }
  58.  
  59. );
  60.  
  61. return queryInterface.dropTable("students");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement