aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-17 15:52:38 +0100
committerChocobozzz <me@florianbigard.com>2018-12-18 11:35:50 +0100
commit8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4 (patch)
tree5e3392af5592d1401ada86d21f93bb7ad9da8ab1 /server/initializers
parent583cd0d2129dc855e599f981d70e537feade1632 (diff)
downloadPeerTube-8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4.tar.gz
PeerTube-8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4.tar.zst
PeerTube-8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4.zip
Add history on server side
Add ability to disable, clear and list user videos history
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/initializers/migrations/0300-user-videos-history-enabled.ts27
2 files changed, 28 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 6971ab775..6e463a1d6 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -16,7 +16,7 @@ let config: IConfig = require('config')
16 16
17// --------------------------------------------------------------------------- 17// ---------------------------------------------------------------------------
18 18
19const LAST_MIGRATION_VERSION = 295 19const LAST_MIGRATION_VERSION = 300
20 20
21// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
22 22
diff --git a/server/initializers/migrations/0300-user-videos-history-enabled.ts b/server/initializers/migrations/0300-user-videos-history-enabled.ts
new file mode 100644
index 000000000..aa5fc21fb
--- /dev/null
+++ b/server/initializers/migrations/0300-user-videos-history-enabled.ts
@@ -0,0 +1,27 @@
1import * as Sequelize from 'sequelize'
2
3async 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.BOOLEAN,
12 allowNull: false,
13 defaultValue: true
14 }
15
16 await utils.queryInterface.addColumn('user', 'videosHistoryEnabled', data)
17 }
18}
19
20function down (options) {
21 throw new Error('Not implemented.')
22}
23
24export {
25 up,
26 down
27}