0495-plugin-auth.ts 794 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import * as Sequelize from 'sequelize'
  2. async function up (utils: {
  3. transaction: Sequelize.Transaction
  4. queryInterface: Sequelize.QueryInterface
  5. sequelize: Sequelize.Sequelize
  6. }): Promise<void> {
  7. {
  8. const password = {
  9. type: Sequelize.STRING,
  10. allowNull: true
  11. }
  12. await utils.queryInterface.changeColumn('user', 'password', password)
  13. }
  14. {
  15. const pluginAuth = {
  16. type: Sequelize.STRING,
  17. allowNull: true
  18. }
  19. await utils.queryInterface.addColumn('user', 'pluginAuth', pluginAuth)
  20. }
  21. {
  22. const authName = {
  23. type: Sequelize.STRING,
  24. allowNull: true
  25. }
  26. await utils.queryInterface.addColumn('oAuthToken', 'authName', authName)
  27. }
  28. }
  29. function down (options) {
  30. throw new Error('Not implemented.')
  31. }
  32. export {
  33. up,
  34. down
  35. }