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,
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,

View File

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

View File

@ -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",

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,
},
};

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(` CTRL +C to return to terminal.`);

View File

@ -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

View File

@ -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.`);

View File

@ -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();