@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
57 lines (56 loc) • 1.92 kB
JavaScript
/*
* 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, "syncClients", {
enumerable: true,
get: function() {
return syncClients;
}
});
const _drizzleorm = require("drizzle-orm");
const _mysqlcore = require("drizzle-orm/mysql-core");
const _usersschema = require("../../users/schemas/users.schema");
const syncClients = (0, _mysqlcore.mysqlTable)('sync_clients', {
id: (0, _mysqlcore.char)('id', {
length: 36
}).primaryKey(),
ownerId: (0, _mysqlcore.bigint)('ownerId', {
mode: 'number',
unsigned: true
}).references(()=>_usersschema.users.id, {
onDelete: 'cascade'
}).notNull(),
token: (0, _mysqlcore.char)('token', {
length: 36
}).notNull(),
tokenExpiration: (0, _mysqlcore.bigint)('tokenExpiration', {
mode: 'number',
unsigned: true
}).notNull(),
info: (0, _mysqlcore.json)('info').$type().notNull(),
enabled: (0, _mysqlcore.boolean)('enabled').default(true).notNull(),
currentIp: (0, _mysqlcore.varchar)('currentIp', {
length: 45
}),
lastIp: (0, _mysqlcore.varchar)('lastIp', {
length: 45
}),
currentAccess: (0, _mysqlcore.datetime)('currentAccess', {
mode: 'date'
}),
lastAccess: (0, _mysqlcore.datetime)('lastAccess', {
mode: 'date'
}),
createdAt: (0, _mysqlcore.datetime)('createdAt', {
mode: 'date'
}).default((0, _drizzleorm.sql)`CURRENT_TIMESTAMP`).notNull()
}, (table)=>[
(0, _mysqlcore.index)('owner_idx').on(table.ownerId),
(0, _mysqlcore.index)('token_idx').on(table.token)
]);
//# sourceMappingURL=sync-clients.schema.js.map