removed link source from code and from database and search

This commit is contained in:
Martina 2021-11-11 13:11:13 -08:00
parent daf71069f1
commit a5e3670581
11 changed files with 8 additions and 39 deletions

View File

@ -43,9 +43,7 @@ export const convertToV1File = (file) => {
title: file.name, title: file.name,
ownerId: file.ownerId, ownerId: file.ownerId,
blurhash: file.blurhash, blurhash: file.blurhash,
source: file.source,
body: file.body, body: file.body,
author: file.author,
linkName: file.linkName, linkName: file.linkName,
linkBody: file.linkBody, linkBody: file.linkBody,
linkAuthor: file.linkAuthor, linkAuthor: file.linkAuthor,
@ -101,9 +99,7 @@ export const convertToV2File = (file) => {
blurhash: file.blurhash, blurhash: file.blurhash,
size: file.size, size: file.size,
type: file.type, type: file.type,
source: file.source,
body: file.body, body: file.body,
author: file.author,
linkName: file.linkName, linkName: file.linkName,
linkBody: file.linkBody, linkBody: file.linkBody,
linkAuthor: file.linkAuthor, linkAuthor: file.linkAuthor,
@ -155,9 +151,7 @@ export const convertToV3File = (file) => {
blurhash: file.blurhash, blurhash: file.blurhash,
size: file.size, size: file.size,
type: file.type, type: file.type,
source: file.source,
body: file.body, body: file.body,
author: file.author,
linkName: file.linkName, linkName: file.linkName,
linkBody: file.linkBody, linkBody: file.linkBody,
linkAuthor: file.linkAuthor, linkAuthor: file.linkAuthor,

View File

@ -193,12 +193,6 @@ export const createFileIndex = async () => {
body: { body: {
type: "text", type: "text",
}, },
author: {
type: "text",
},
source: {
type: "text",
},
type: { type: {
type: "keyword", type: "keyword",
index: false, index: false,

View File

@ -102,8 +102,6 @@ export const searchMultiple = async ({
"filename^2", "filename^2",
"name^2", "name^2",
"body", "body",
"author",
"source",
"linkName^2", "linkName^2",
"linkBody", "linkBody",
"linkAuthor", "linkAuthor",
@ -258,8 +256,6 @@ export const searchFile = async ({ query, ownerId, userId, globalSearch = false,
"filename^2", "filename^2",
"name^2", "name^2",
"body", "body",
"author",
"source",
"linkName^2", "linkName^2",
"linkBody", "linkBody",
"linkAuthor", "linkAuthor",
@ -332,8 +328,6 @@ export const searchFile = async ({ query, ownerId, userId, globalSearch = false,
// fields: [ // fields: [
// "name", // "name",
// "body", // "body",
// "author",
// "source",
// "linkName", // "linkName",
// "linkBody", // "linkBody",
// "linkAuthor", // "linkAuthor",

View File

@ -53,8 +53,6 @@ const cleanFile = ({
blurhash, blurhash,
coverImage, coverImage,
body, body,
author,
source,
type, type,
isPublic, isPublic,
downloadCount, downloadCount,
@ -83,8 +81,6 @@ const cleanFile = ({
blurhash, blurhash,
coverImage, coverImage,
body, body,
author,
source,
type, type,
isPublic, isPublic,
downloadCount, downloadCount,

View File

@ -80,8 +80,6 @@ export default async (req, res) => {
type: "link", type: "link",
name: data.title, name: data.title,
body: data.description, body: data.description,
source: data.publisher,
author: data.author,
linkName: data.title, linkName: data.title,
linkBody: data.description, linkBody: data.description,
linkSource: data.publisher, linkSource: data.publisher,

View File

@ -74,8 +74,6 @@ export default async (req, res) => {
type: "link", type: "link",
name: data.title, name: data.title,
body: data.description, body: data.description,
source: data.publisher,
author: data.author,
linkName: data.title, linkName: data.title,
linkBody: data.description, linkBody: data.description,
linkSource: data.publisher, linkSource: data.publisher,

View File

@ -19,8 +19,6 @@ export default async (req, res) => {
data: { data: {
name: req.body.data.data?.name, name: req.body.data.data?.name,
body: req.body.data.data?.body, body: req.body.data.data?.body,
source: req.body.data.data?.source,
author: req.body.data.data?.author,
}, },
}; };

View File

@ -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(`FINISHED: adjust.js`);
Logging.log(` CTRL +C to return to terminal.`); Logging.log(` CTRL +C to return to terminal.`);

View File

@ -152,9 +152,7 @@ const addFileColumns = async () => {
table.integer("size").notNullable().defaultTo(0); table.integer("size").notNullable().defaultTo(0);
table.string("type").notNullable().defaultTo("link"); table.string("type").notNullable().defaultTo("link");
table.string("blurhash").nullable(); table.string("blurhash").nullable();
table.string("source").nullable();
table.string("body", 2000).nullable(); table.string("body", 2000).nullable();
table.string("author").nullable();
table.jsonb("coverImage").nullable(); table.jsonb("coverImage").nullable();
table.jsonb("data").nullable(); //where you'll move unity stuff table.jsonb("data").nullable(); //where you'll move unity stuff
table.string("linkName").nullable(); table.string("linkName").nullable();
@ -255,8 +253,6 @@ const migrateFileTable = async () => {
size: data.size, size: data.size,
type: data.type, type: data.type,
blurhash: data.blurhash, blurhash: data.blurhash,
source: data.source,
author: data.author,
linkName: data.link?.name, linkName: data.link?.name,
linkBody: data.link?.body, linkBody: data.link?.body,
linkAuthor: data.link?.author, linkAuthor: data.link?.author,
@ -370,9 +366,7 @@ Files
'data.size', -> 'size' MIGRATED 'data.size', -> 'size' MIGRATED
'data.type', -> 'type' MIGRATED 'data.type', -> 'type' MIGRATED
'data.blurhash', -> 'blurhash' MIGRATED 'data.blurhash', -> 'blurhash' MIGRATED
'data.source', -> 'source' MIGRATED
'data.body', -> 'body' MIGRATED 'data.body', -> 'body' MIGRATED
'data.author', -> 'author' MIGRATED
'data.coverImage', -> 'coverImage' MIGRATED 'data.coverImage', -> 'coverImage' MIGRATED
'data.unity', -> 'data.unity' MIGRATED 'data.unity', -> 'data.unity' MIGRATED
'data.link.name', -> 'linkName' MIGRATED 'data.link.name', -> 'linkName' MIGRATED

View File

@ -185,8 +185,9 @@ async function resetIndex() {
await setUpIndex(); await setUpIndex();
} }
// setUpIndex(); // await setUpIndex();
Promise.all([manage(), update(), search()]); await resetIndex();
// await Promise.all([manage(), update(), search()]);
Logging.log(`FINISHED: search.js`); Logging.log(`FINISHED: search.js`);
Logging.log(` CTRL + C to return to terminal.`); Logging.log(` CTRL + C to return to terminal.`);

View File

@ -82,9 +82,7 @@ const createFilesTable = db.schema.createTable("files", function (table) {
table.integer("size").notNullable().defaultTo(0); table.integer("size").notNullable().defaultTo(0);
table.string("type").notNullable().defaultTo("link"); table.string("type").notNullable().defaultTo("link");
table.string("blurhash").nullable(); table.string("blurhash").nullable();
table.string("source").nullable();
table.string("body", 2000).nullable(); table.string("body", 2000).nullable();
table.string("author").nullable();
table.jsonb("coverImage").nullable(); table.jsonb("coverImage").nullable();
table.jsonb("data").nullable(); table.jsonb("data").nullable();
table.string("linkName").nullable(); table.string("linkName").nullable();