0125-table-lowercase.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  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. await utils.queryInterface.renameTable('Applications', 'application')
  8. await utils.queryInterface.renameTable('AccountFollows', 'accountFollow')
  9. await utils.queryInterface.renameTable('AccountVideoRates', 'accountVideoRate')
  10. await utils.queryInterface.renameTable('Accounts', 'account')
  11. await utils.queryInterface.renameTable('Avatars', 'avatar')
  12. await utils.queryInterface.renameTable('BlacklistedVideos', 'videoBlacklist')
  13. await utils.queryInterface.renameTable('Jobs', 'job')
  14. await utils.queryInterface.renameTable('OAuthClients', 'oAuthClient')
  15. await utils.queryInterface.renameTable('OAuthTokens', 'oAuthToken')
  16. await utils.queryInterface.renameTable('Servers', 'server')
  17. await utils.queryInterface.renameTable('Tags', 'tag')
  18. await utils.queryInterface.renameTable('Users', 'user')
  19. await utils.queryInterface.renameTable('VideoAbuses', 'videoAbuse')
  20. await utils.queryInterface.renameTable('VideoChannels', 'videoChannel')
  21. await utils.queryInterface.renameTable('VideoChannelShares', 'videoChannelShare')
  22. await utils.queryInterface.renameTable('VideoFiles', 'videoFile')
  23. await utils.queryInterface.renameTable('VideoShares', 'videoShare')
  24. await utils.queryInterface.renameTable('VideoTags', 'videoTag')
  25. await utils.queryInterface.renameTable('Videos', 'video')
  26. }
  27. function down (options) {
  28. throw new Error('Not implemented.')
  29. }
  30. export {
  31. up,
  32. down
  33. }