Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(backend:files): update files-content schema to use unsigned bigint for `id`, adjust constraints order

johavenbac52bc046de
diff --git a/backend/src/applications/files/schemas/files-content.schema.ts b/backend/src/applications/files/schemas/files-content.schema.ts
index ce2952f3..9a0f4ede 100644
--- a/backend/src/applications/files/schemas/files-content.schema.ts
+++ b/backend/src/applications/files/schemas/files-content.schema.ts
@@ -5,15 +5,15 @@ export function createTableFilesContent(tableName: string): string {
return `
CREATE TABLE IF NOT EXISTS ${tableName}
(
- id bigint NOT NULL,
+ id bigint unsigned NOT NULL,
path varchar(4096) NOT NULL,
name varchar(255) NOT NULL,
mime varchar(255),
size bigint unsigned NOT NULL,
mtime bigint unsigned NOT NULL,
content LONGTEXT,
- FULLTEXT (content),
- CONSTRAINT files_content_id PRIMARY KEY (id)
+ PRIMARY KEY (id),
+ FULLTEXT (content)
) CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci;`
}
diff --git a/backend/src/applications/files/services/files-content-indexer.service.ts b/backend/src/applications/files/services/files-content-indexer.service.ts
index 46aa319b..7abf5a44 100644
--- a/backend/src/applications/files/services/files-content-indexer.service.ts
+++ b/backend/src/applications/files/services/files-content-indexer.service.ts
@@ -26,10 +26,10 @@ import { configuration } from '../../../configuration/config.environment'
@Injectable()
export class FilesContentIndexer {
- public isEnabled = configuration.applications.files.contentIndexing.enabled
- private readonly maxDocumentSize = 150 * 1_000_000
private readonly logger = new Logger(FilesContentIndexer.name)
+ private readonly maxDocumentSize = 150 * 1_000_000
private ocrManager: OCRManager | null = null
+ public isEnabled = configuration.applications.files.contentIndexing.enabled
constructor(
private readonly cache: Cache,