diff options
author | BRAINS YUM <43896676+McFlat@users.noreply.github.com> | 2018-10-19 01:54:01 -0500 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-19 08:54:01 +0200 |
commit | d23e6a1c97a6ae3ca8d340a8c9adad268a5be57e (patch) | |
tree | e5a11500d446b585716d451dd274e8567d36cd2a /server/initializers/migrations/0285-description-support.ts | |
parent | e0628695c3425bf69b5d7a46b24dcdf31892d9b6 (diff) | |
download | PeerTube-d23e6a1c97a6ae3ca8d340a8c9adad268a5be57e.tar.gz PeerTube-d23e6a1c97a6ae3ca8d340a8c9adad268a5be57e.tar.zst PeerTube-d23e6a1c97a6ae3ca8d340a8c9adad268a5be57e.zip |
Feature/description support fields length 1000 (#1267)
* fix migrations to not use config constant values as it can introduce bugs later when they change; (fixes #1259)
remove constant fields imports from migrations
* add migrations to update description and support fields to 1000 (fixes #1258)
* fix client/server account and video_channel description/support fields to be max len 1000 (fixes #1258);
fix test Should fail with a too long description;
fix test Should fail with a long description;
fix test Should fail with a long description;
Remove USER.SUPPORT from constants since that field no longer exists;
null not false, in migrations/0280-description-support.ts;
video support field 1000, oops;
* rename migration 0280-description-support.ts -> 0285-description-support.ts;
update video support maxlength text
Diffstat (limited to 'server/initializers/migrations/0285-description-support.ts')
-rw-r--r-- | server/initializers/migrations/0285-description-support.ts | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/server/initializers/migrations/0285-description-support.ts b/server/initializers/migrations/0285-description-support.ts new file mode 100644 index 000000000..85ef4ef39 --- /dev/null +++ b/server/initializers/migrations/0285-description-support.ts | |||
@@ -0,0 +1,53 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | async function up (utils: { | ||
4 | transaction: Sequelize.Transaction, | ||
5 | queryInterface: Sequelize.QueryInterface, | ||
6 | sequelize: Sequelize.Sequelize, | ||
7 | db: any | ||
8 | }): Promise<void> { | ||
9 | { | ||
10 | const data = { | ||
11 | type: Sequelize.STRING(1000), | ||
12 | allowNull: true, | ||
13 | defaultValue: null | ||
14 | } | ||
15 | await utils.queryInterface.changeColumn('video', 'support', data) | ||
16 | } | ||
17 | |||
18 | { | ||
19 | const data = { | ||
20 | type: Sequelize.STRING(1000), | ||
21 | allowNull: true, | ||
22 | defaultValue: null | ||
23 | } | ||
24 | await utils.queryInterface.changeColumn('videoChannel', 'support', data) | ||
25 | } | ||
26 | |||
27 | { | ||
28 | const data = { | ||
29 | type: Sequelize.STRING(1000), | ||
30 | allowNull: true, | ||
31 | defaultValue: null | ||
32 | } | ||
33 | await utils.queryInterface.changeColumn('videoChannel', 'description', data) | ||
34 | } | ||
35 | |||
36 | { | ||
37 | const data = { | ||
38 | type: Sequelize.STRING(1000), | ||
39 | allowNull: true, | ||
40 | defaultValue: null | ||
41 | } | ||
42 | await utils.queryInterface.changeColumn('account', 'description', data) | ||
43 | } | ||
44 | } | ||
45 | |||
46 | function down (options) { | ||
47 | throw new Error('Not implemented.') | ||
48 | } | ||
49 | |||
50 | export { | ||
51 | up, | ||
52 | down | ||
53 | } | ||