]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/initializers/migrations/0115-account-avatar.ts
Try to fix video duplication
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0115-account-avatar.ts
CommitLineData
2295ce6c 1import * as Sequelize from 'sequelize'
2295ce6c
C
2
3async function up (utils: {
4 transaction: Sequelize.Transaction,
5 queryInterface: Sequelize.QueryInterface,
6 sequelize: Sequelize.Sequelize,
3fd3ab2d 7 db: any
2295ce6c 8}): Promise<void> {
be447678 9 await utils.db.Avatar.sync()
2295ce6c
C
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
23function down (options) {
24 throw new Error('Not implemented.')
25}
26
27export {
28 up,
29 down
30}