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