diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-11 09:35:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-11 09:35:50 +0100 |
commit | 60650c77c8a2a98e92d869b237ae4900f369a8fc (patch) | |
tree | 7304a7591b5b23b99d219c4d06c6bd5c4c58c1c2 /server/initializers/migrations | |
parent | 7ae71355c40e9065f83d3fc77b6750d1929ac201 (diff) | |
download | PeerTube-60650c77c8a2a98e92d869b237ae4900f369a8fc.tar.gz PeerTube-60650c77c8a2a98e92d869b237ae4900f369a8fc.tar.zst PeerTube-60650c77c8a2a98e92d869b237ae4900f369a8fc.zip |
Add scores to follows and remove bad ones
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r-- | server/initializers/migrations/0170-actor-follow-score.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/server/initializers/migrations/0170-actor-follow-score.ts b/server/initializers/migrations/0170-actor-follow-score.ts new file mode 100644 index 000000000..2deabaf98 --- /dev/null +++ b/server/initializers/migrations/0170-actor-follow-score.ts | |||
@@ -0,0 +1,28 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | import { ACTOR_FOLLOW_SCORE } from '../index' | ||
3 | |||
4 | async function up (utils: { | ||
5 | transaction: Sequelize.Transaction, | ||
6 | queryInterface: Sequelize.QueryInterface, | ||
7 | sequelize: Sequelize.Sequelize | ||
8 | }): Promise<void> { | ||
9 | await utils.queryInterface.removeColumn('server', 'score') | ||
10 | |||
11 | const data = { | ||
12 | type: Sequelize.INTEGER, | ||
13 | allowNull: false, | ||
14 | defaultValue: ACTOR_FOLLOW_SCORE.BASE | ||
15 | } | ||
16 | |||
17 | await utils.queryInterface.addColumn('actorFollow', 'score', data) | ||
18 | |||
19 | } | ||
20 | |||
21 | function down (options) { | ||
22 | throw new Error('Not implemented.') | ||
23 | } | ||
24 | |||
25 | export { | ||
26 | up, | ||
27 | down | ||
28 | } | ||