]>
Commit | Line | Data |
---|---|---|
6fcd19ba C |
1 | import * as Sequelize from 'sequelize' |
2 | import * as Promise from 'bluebird' | |
3 | ||
4 | function up (utils: { | |
5 | transaction: Sequelize.Transaction, | |
6 | queryInterface: Sequelize.QueryInterface, | |
7 | sequelize: Sequelize.Sequelize | |
8 | }): Promise<void> { | |
6f0c39e2 | 9 | const q = utils.queryInterface |
6f0c39e2 C |
10 | |
11 | const data = { | |
12 | type: Sequelize.INTEGER, | |
13 | allowNull: false, | |
14 | defaultValue: 0 | |
15 | } | |
16 | ||
6fcd19ba C |
17 | return q.addColumn('Videos', 'licence', data) |
18 | .then(() => { | |
6f0c39e2 | 19 | data.defaultValue = null |
6fcd19ba C |
20 | return q.changeColumn('Videos', 'licence', data) |
21 | }) | |
6f0c39e2 C |
22 | } |
23 | ||
0a6658fd | 24 | function down (options) { |
6f0c39e2 C |
25 | throw new Error('Not implemented.') |
26 | } | |
65fcc311 C |
27 | |
28 | export { | |
29 | up, | |
30 | down | |
31 | } |