diff --git a/common/conversions.js b/common/conversions.js index baa7c560..7196544b 100644 --- a/common/conversions.js +++ b/common/conversions.js @@ -43,9 +43,7 @@ export const convertToV1File = (file) => { title: file.name, ownerId: file.ownerId, blurhash: file.blurhash, - source: file.source, body: file.body, - author: file.author, linkName: file.linkName, linkBody: file.linkBody, linkAuthor: file.linkAuthor, @@ -101,9 +99,7 @@ export const convertToV2File = (file) => { blurhash: file.blurhash, size: file.size, type: file.type, - source: file.source, body: file.body, - author: file.author, linkName: file.linkName, linkBody: file.linkBody, linkAuthor: file.linkAuthor, @@ -155,9 +151,7 @@ export const convertToV3File = (file) => { blurhash: file.blurhash, size: file.size, type: file.type, - source: file.source, body: file.body, - author: file.author, linkName: file.linkName, linkBody: file.linkBody, linkAuthor: file.linkAuthor, diff --git a/node_common/managers/search/manage.js b/node_common/managers/search/manage.js index ac90c25d..a4f5f8e2 100644 --- a/node_common/managers/search/manage.js +++ b/node_common/managers/search/manage.js @@ -193,12 +193,6 @@ export const createFileIndex = async () => { body: { type: "text", }, - author: { - type: "text", - }, - source: { - type: "text", - }, type: { type: "keyword", index: false, diff --git a/node_common/managers/search/search.js b/node_common/managers/search/search.js index 2746f3d1..32b7cd1c 100644 --- a/node_common/managers/search/search.js +++ b/node_common/managers/search/search.js @@ -102,8 +102,6 @@ export const searchMultiple = async ({ "filename^2", "name^2", "body", - "author", - "source", "linkName^2", "linkBody", "linkAuthor", @@ -258,8 +256,6 @@ export const searchFile = async ({ query, ownerId, userId, globalSearch = false, "filename^2", "name^2", "body", - "author", - "source", "linkName^2", "linkBody", "linkAuthor", @@ -332,8 +328,6 @@ export const searchFile = async ({ query, ownerId, userId, globalSearch = false, // fields: [ // "name", // "body", - // "author", - // "source", // "linkName", // "linkBody", // "linkAuthor", diff --git a/node_common/managers/search/update.js b/node_common/managers/search/update.js index 99f6486b..a8210bb2 100644 --- a/node_common/managers/search/update.js +++ b/node_common/managers/search/update.js @@ -53,8 +53,6 @@ const cleanFile = ({ blurhash, coverImage, body, - author, - source, type, isPublic, downloadCount, @@ -83,8 +81,6 @@ const cleanFile = ({ blurhash, coverImage, body, - author, - source, type, isPublic, downloadCount, diff --git a/pages/api/data/create-link.js b/pages/api/data/create-link.js index 46cdb086..d944caab 100644 --- a/pages/api/data/create-link.js +++ b/pages/api/data/create-link.js @@ -80,8 +80,6 @@ export default async (req, res) => { type: "link", name: data.title, body: data.description, - source: data.publisher, - author: data.author, linkName: data.title, linkBody: data.description, linkSource: data.publisher, diff --git a/pages/api/v2/create-link.js b/pages/api/v2/create-link.js index 9f8b13bf..0ccc5f26 100644 --- a/pages/api/v2/create-link.js +++ b/pages/api/v2/create-link.js @@ -74,8 +74,6 @@ export default async (req, res) => { type: "link", name: data.title, body: data.description, - source: data.publisher, - author: data.author, linkName: data.title, linkBody: data.description, linkSource: data.publisher, diff --git a/pages/api/v2/update-file.js b/pages/api/v2/update-file.js index fce96410..30e27f4c 100644 --- a/pages/api/v2/update-file.js +++ b/pages/api/v2/update-file.js @@ -19,8 +19,6 @@ export default async (req, res) => { data: { name: req.body.data.data?.name, body: req.body.data.data?.body, - source: req.body.data.data?.source, - author: req.body.data.data?.author, }, }; diff --git a/scripts/adjust.js b/scripts/adjust.js index b1613378..463feedd 100644 --- a/scripts/adjust.js +++ b/scripts/adjust.js @@ -33,7 +33,11 @@ const deleteStorageDealSettings = db.schema.table("users", function (table) { ); }); -Promise.all([deleteStorageDealSettings]); +const deleteSourceAndAuthor = db.schema.table("files", function (table) { + table.dropColumns("source", "author"); +}); + +Promise.all([deleteSourceAndAuthor]); Logging.log(`FINISHED: adjust.js`); Logging.log(` CTRL +C to return to terminal.`); diff --git a/scripts/flattening-migration.js b/scripts/flattening-migration.js index db7682e1..102a936d 100644 --- a/scripts/flattening-migration.js +++ b/scripts/flattening-migration.js @@ -152,9 +152,7 @@ const addFileColumns = async () => { table.integer("size").notNullable().defaultTo(0); table.string("type").notNullable().defaultTo("link"); table.string("blurhash").nullable(); - table.string("source").nullable(); table.string("body", 2000).nullable(); - table.string("author").nullable(); table.jsonb("coverImage").nullable(); table.jsonb("data").nullable(); //where you'll move unity stuff table.string("linkName").nullable(); @@ -255,8 +253,6 @@ const migrateFileTable = async () => { size: data.size, type: data.type, blurhash: data.blurhash, - source: data.source, - author: data.author, linkName: data.link?.name, linkBody: data.link?.body, linkAuthor: data.link?.author, @@ -370,9 +366,7 @@ Files 'data.size', -> 'size' MIGRATED 'data.type', -> 'type' MIGRATED 'data.blurhash', -> 'blurhash' MIGRATED - 'data.source', -> 'source' MIGRATED 'data.body', -> 'body' MIGRATED - 'data.author', -> 'author' MIGRATED 'data.coverImage', -> 'coverImage' MIGRATED 'data.unity', -> 'data.unity' MIGRATED 'data.link.name', -> 'linkName' MIGRATED diff --git a/scripts/search.js b/scripts/search.js index 8e48481d..eecbf88c 100644 --- a/scripts/search.js +++ b/scripts/search.js @@ -185,8 +185,9 @@ async function resetIndex() { await setUpIndex(); } -// setUpIndex(); -Promise.all([manage(), update(), search()]); +// await setUpIndex(); +await resetIndex(); +// await Promise.all([manage(), update(), search()]); Logging.log(`FINISHED: search.js`); Logging.log(` CTRL + C to return to terminal.`); diff --git a/scripts/seed-database.js b/scripts/seed-database.js index 5490c890..58d6b0cd 100644 --- a/scripts/seed-database.js +++ b/scripts/seed-database.js @@ -82,9 +82,7 @@ const createFilesTable = db.schema.createTable("files", function (table) { table.integer("size").notNullable().defaultTo(0); table.string("type").notNullable().defaultTo("link"); table.string("blurhash").nullable(); - table.string("source").nullable(); table.string("body", 2000).nullable(); - table.string("author").nullable(); table.jsonb("coverImage").nullable(); table.jsonb("data").nullable(); table.string("linkName").nullable();