]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/initializers/migrations/0115-account-avatar.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0115-account-avatar.ts
1 import * as Sequelize from 'sequelize'
2
3 async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
7 db: any
8 }): Promise<void> {
9 await utils.db.Avatar.sync()
10
11 const data = {
12 type: Sequelize.INTEGER,
13 allowNull: true,
14 references: {
15 model: 'Avatars',
16 key: 'id'
17 },
18 onDelete: 'CASCADE'
19 }
20 await utils.queryInterface.addColumn('Accounts', 'avatarId', data)
21 }
22
23 function down (options) {
24 throw new Error('Not implemented.')
25 }
26
27 export {
28 up,
29 down
30 }