]>
Commit | Line | Data |
---|---|---|
6fcd19ba | 1 | import * as Sequelize from 'sequelize' |
c1e791ba | 2 | import { Migration } from '../../models/migrations' |
6fcd19ba C |
3 | |
4 | function up (utils: { | |
a1587156 C |
5 | transaction: Sequelize.Transaction |
6 | queryInterface: Sequelize.QueryInterface | |
6fcd19ba C |
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 | |
c1e791ba | 15 | } as Migration.Integer |
6f0c39e2 | 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 | } |