]>
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> { | |
31b59b47 | 10 | const q = utils.queryInterface |
31b59b47 C |
11 | |
12 | const data = { | |
13 | type: Sequelize.BOOLEAN, | |
14 | allowNull: false, | |
15 | defaultValue: false | |
c1e791ba | 16 | } as Migration.Boolean |
31b59b47 | 17 | |
6fcd19ba C |
18 | return q.addColumn('Videos', 'nsfw', data) |
19 | .then(() => { | |
31b59b47 C |
20 | data.defaultValue = null |
21 | ||
6fcd19ba C |
22 | return q.changeColumn('Videos', 'nsfw', data) |
23 | }) | |
31b59b47 C |
24 | } |
25 | ||
0a6658fd | 26 | function down (options) { |
31b59b47 C |
27 | throw new Error('Not implemented.') |
28 | } | |
65fcc311 C |
29 | |
30 | export { | |
31 | up, | |
32 | down | |
33 | } |