]>
Commit | Line | Data |
---|---|---|
b0f9f39e C |
1 | import * as Sequelize from 'sequelize' |
2 | import * as Promise from 'bluebird' | |
c1e791ba | 3 | import { Migration } from '../../models/migrations' |
b0f9f39e C |
4 | |
5 | function up (utils: { | |
a1587156 C |
6 | transaction: Sequelize.Transaction |
7 | queryInterface: Sequelize.QueryInterface | |
8 | sequelize: Sequelize.Sequelize | |
b0f9f39e C |
9 | db: any |
10 | }): Promise<void> { | |
11 | const q = utils.queryInterface | |
12 | ||
13 | const data = { | |
14 | type: Sequelize.BIGINT, | |
15 | allowNull: false, | |
16 | defaultValue: -1 | |
c1e791ba | 17 | } as Migration.BigInteger |
b0f9f39e C |
18 | |
19 | return q.addColumn('Users', 'videoQuota', data) | |
20 | .then(() => { | |
21 | data.defaultValue = null | |
22 | return q.changeColumn('Users', 'videoQuota', data) | |
23 | }) | |
24 | } | |
25 | ||
26 | function down (options) { | |
27 | throw new Error('Not implemented.') | |
28 | } | |
29 | ||
30 | export { | |
31 | up, | |
32 | down | |
33 | } |