Compare commits
2
Commits
45acc9bf3c
...
c7dc893d43
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7dc893d43 | ||
|
|
fe74e83282 |
@@ -1,4 +1,14 @@
|
||||
exports.up = async function(knex) {
|
||||
await knex.schema.alterTable('notifications', (table) => {
|
||||
table.datetime('seen_at');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('alerts', (table) => {
|
||||
table.boolean('is_expired')
|
||||
.notNullable()
|
||||
.defaultTo(false);
|
||||
});
|
||||
|
||||
await knex.schema.createMaterializedView('alerts_users_scenes', (view) => {
|
||||
view.columns('user_id', 'scene_id', 'alert_ids');
|
||||
|
||||
@@ -19,11 +29,20 @@ exports.up = async function(knex) {
|
||||
.on('related_scenes.alert_id', 'alerts_scenes.alert_id')
|
||||
.on('related_scenes.scene_id', '!=', 'alerts_scenes.scene_id');
|
||||
})
|
||||
.where('alerts.is_expired', false)
|
||||
.groupBy(['user_id', 'alerts_scenes.scene_id', 'is_only']),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex) {
|
||||
await knex.schema.dropView('alerts_users_scenes');
|
||||
await knex.schema.dropMaterializedView('alerts_users_scenes');
|
||||
|
||||
await knex.schema.alterTable('alerts', (table) => {
|
||||
table.dropColumn('is_expired');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('notifications', (table) => {
|
||||
table.dropColumn('seen_at');
|
||||
});
|
||||
};
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.254.16",
|
||||
"version": "1.254.17",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "traxxx",
|
||||
"version": "1.254.16",
|
||||
"version": "1.254.17",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.458.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.254.16",
|
||||
"version": "1.254.17",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user