aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2018-08-28 02:01:35 -0500
committerChocobozzz <me@florianbigard.com>2018-08-28 09:01:35 +0200
commitbee0abffff73804d816b90c7fd599e0a51c09d61 (patch)
treefae6d58637f9c63a3800090277f8e130b43442dd /server/initializers/migrations
parentc907c2fa3fd7c0a741117a0204d0ebca675124bd (diff)
downloadPeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.gz
PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.zst
PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.zip
Implement daily upload limit (#956)
* Implement daily upload limit (ref #652) * remove duplicate code * review fixes * fix tests? * whitespace fixes, finish leftover todo * fix tests * added some new tests * use different config value for tests * remove todo
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0260-upload_quota_daily.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/initializers/migrations/0260-upload_quota_daily.ts b/server/initializers/migrations/0260-upload_quota_daily.ts
new file mode 100644
index 000000000..d25154ba6
--- /dev/null
+++ b/server/initializers/migrations/0260-upload_quota_daily.ts
@@ -0,0 +1,23 @@
1import * as Sequelize from 'sequelize'
2import { CONSTRAINTS_FIELDS } from '../constants'
3
4async function up (utils: {
5 transaction: Sequelize.Transaction
6 queryInterface: Sequelize.QueryInterface
7 sequelize: Sequelize.Sequelize
8}): Promise<any> {
9 {
10 const data = {
11 type: Sequelize.BIGINT,
12 allowNull: false,
13 defaultValue: -1
14 }
15 await utils.queryInterface.addColumn('user', 'videoQuotaDaily', data)
16 }
17}
18
19function down (options) {
20 throw new Error('Not implemented.')
21}
22
23export { up, down }