UNPKG

@sync-in/server

Version:

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

56 lines (55 loc) 1.95 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, "groups", { enumerable: true, get: function() { return groups; } }); const _drizzleorm = require("drizzle-orm"); const _mysqlcore = require("drizzle-orm/mysql-core"); const groups = (0, _mysqlcore.mysqlTable)('groups', { id: (0, _mysqlcore.bigint)('id', { mode: 'number', unsigned: true }).autoincrement().primaryKey(), name: (0, _mysqlcore.varchar)('name', { length: 255 }).notNull(), description: (0, _mysqlcore.varchar)('description', { length: 255 }), type: (0, _mysqlcore.tinyint)('type', { unsigned: true }).default(0).notNull(), visibility: (0, _mysqlcore.tinyint)('visibility', { unsigned: true }).default(0).notNull(), parentId: (0, _mysqlcore.bigint)('parentId', { mode: 'number', unsigned: true }).references(()=>groups.id, { onDelete: 'set null' }), permissions: (0, _mysqlcore.varchar)('permissions', { length: 255 }).default('').notNull(), 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`) }, (table)=>[ (0, _mysqlcore.uniqueIndex)('name_idx').on(table.name), (0, _mysqlcore.index)('parent_idx').on(table.parentId), (0, _mysqlcore.index)('type_idx').on(table.type), (0, _mysqlcore.index)('visibility_idx').on(table.visibility) ]); //# sourceMappingURL=groups.schema.js.map