UNPKG

@sync-in/server

Version:

The secure, open-source platform for file storage, sharing, collaboration, and sync

91 lines (90 loc) 3.27 kB
/* * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com> * This file is part of Sync-in | The open source file sync and share solution * See the LICENSE file for licensing details */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "shares", { enumerable: true, get: function() { return shares; } }); const _drizzleorm = require("drizzle-orm"); const _mysqlcore = require("drizzle-orm/mysql-core"); const _filesschema = require("../../files/schemas/files.schema"); const _spacesrootsschema = require("../../spaces/schemas/spaces-roots.schema"); const _spacesschema = require("../../spaces/schemas/spaces.schema"); const _usersschema = require("../../users/schemas/users.schema"); const shares = (0, _mysqlcore.mysqlTable)('shares', { id: (0, _mysqlcore.bigint)('id', { mode: 'number', unsigned: true }).autoincrement().primaryKey(), ownerId: (0, _mysqlcore.bigint)('ownerId', { mode: 'number', unsigned: true }).references(()=>_usersschema.users.id, { onDelete: 'cascade' }), parentId: (0, _mysqlcore.bigint)('parentId', { mode: 'number', unsigned: true }).references(()=>shares.id, { onDelete: 'cascade' }), spaceId: (0, _mysqlcore.bigint)('spaceId', { mode: 'number', unsigned: true }).references(()=>_spacesschema.spaces.id, { onDelete: 'cascade' }), spaceRootId: (0, _mysqlcore.bigint)('spaceRootId', { mode: 'number', unsigned: true }).references(()=>_spacesrootsschema.spacesRoots.id, { onDelete: 'cascade' }), fileId: (0, _mysqlcore.bigint)('fileId', { mode: 'number', unsigned: true }).references(()=>_filesschema.files.id, { onDelete: 'cascade' }), externalPath: (0, _mysqlcore.varchar)('externalPath', { length: 4096 }), type: (0, _mysqlcore.tinyint)('type', { unsigned: true }).default(0).notNull(), alias: (0, _mysqlcore.varchar)('alias', { length: 255 }).notNull(), name: (0, _mysqlcore.varchar)('name', { length: 255 }).notNull(), enabled: (0, _mysqlcore.boolean)('enabled').default(true).notNull(), description: (0, _mysqlcore.varchar)('description', { length: 255 }), createdAt: (0, _mysqlcore.datetime)('createdAt', { mode: 'date' }).default((0, _drizzleorm.sql)`CURRENT_TIMESTAMP`).notNull(), modifiedAt: (0, _mysqlcore.datetime)('modifiedAt', { mode: 'date' }).default((0, _drizzleorm.sql)`CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP`), disabledAt: (0, _mysqlcore.datetime)('disabledAt', { mode: 'date' }) }, (table)=>[ (0, _mysqlcore.uniqueIndex)('alias_idx').on(table.alias), (0, _mysqlcore.index)('parent_idx').on(table.parentId), (0, _mysqlcore.index)('owner_idx').on(table.ownerId), (0, _mysqlcore.index)('space_idx').on(table.spaceId), (0, _mysqlcore.index)('space_root_idx').on(table.spaceRootId), (0, _mysqlcore.index)('file_idx').on(table.fileId), (0, _mysqlcore.index)('type_idx').on(table.type) ]); //# sourceMappingURL=shares.schema.js.map