]>
Commit | Line | Data |
---|---|---|
2295ce6c | 1 | import * as Sequelize from 'sequelize' |
2295ce6c C |
2 | |
3 | async 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 | ||
23 | function down (options) { | |
24 | throw new Error('Not implemented.') | |
25 | } | |
26 | ||
27 | export { | |
28 | up, | |
29 | down | |
30 | } |