aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0125-table-lowercase.ts
blob: f75a5679198bba24ff94a4b6cfcfbbc497dc8787 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as Sequelize from 'sequelize'

async function up (utils: {
  transaction: Sequelize.Transaction
  queryInterface: Sequelize.QueryInterface
  sequelize: Sequelize.Sequelize
}): Promise<void> {
  await utils.queryInterface.renameTable('Applications', 'application')
  await utils.queryInterface.renameTable('AccountFollows', 'accountFollow')
  await utils.queryInterface.renameTable('AccountVideoRates', 'accountVideoRate')
  await utils.queryInterface.renameTable('Accounts', 'account')
  await utils.queryInterface.renameTable('Avatars', 'avatar')
  await utils.queryInterface.renameTable('BlacklistedVideos', 'videoBlacklist')
  await utils.queryInterface.renameTable('Jobs', 'job')
  await utils.queryInterface.renameTable('OAuthClients', 'oAuthClient')
  await utils.queryInterface.renameTable('OAuthTokens', 'oAuthToken')
  await utils.queryInterface.renameTable('Servers', 'server')
  await utils.queryInterface.renameTable('Tags', 'tag')
  await utils.queryInterface.renameTable('Users', 'user')
  await utils.queryInterface.renameTable('VideoAbuses', 'videoAbuse')
  await utils.queryInterface.renameTable('VideoChannels', 'videoChannel')
  await utils.queryInterface.renameTable('VideoChannelShares', 'videoChannelShare')
  await utils.queryInterface.renameTable('VideoFiles', 'videoFile')
  await utils.queryInterface.renameTable('VideoShares', 'videoShare')
  await utils.queryInterface.renameTable('VideoTags', 'videoTag')
  await utils.queryInterface.renameTable('Videos', 'video')
}

function down (options) {
  throw new Error('Not implemented.')
}

export {
  up,
  down
}