@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
45 lines (44 loc) • 1.62 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, "notifications", {
enumerable: true,
get: function() {
return notifications;
}
});
const _drizzleorm = require("drizzle-orm");
const _mysqlcore = require("drizzle-orm/mysql-core");
const _usersschema = require("../../users/schemas/users.schema");
const notifications = (0, _mysqlcore.mysqlTable)('notifications', {
id: (0, _mysqlcore.bigint)('id', {
mode: 'number',
unsigned: true
}).autoincrement().primaryKey(),
fromUserId: (0, _mysqlcore.bigint)('fromUserId', {
mode: 'number',
unsigned: true
}).references(()=>_usersschema.users.id, {
onDelete: 'cascade'
}),
toUserId: (0, _mysqlcore.bigint)('toUserId', {
mode: 'number',
unsigned: true
}).references(()=>_usersschema.users.id, {
onDelete: 'cascade'
}).notNull(),
content: (0, _mysqlcore.json)('content').$type(),
wasRead: (0, _mysqlcore.boolean)('wasRead').default(false).notNull(),
createdAt: (0, _mysqlcore.datetime)('createdAt', {
mode: 'date'
}).default((0, _drizzleorm.sql)`CURRENT_TIMESTAMP`).notNull()
}, (table)=>[
(0, _mysqlcore.index)('from_user_idx').on(table.fromUserId),
(0, _mysqlcore.index)('to_user_idx').on(table.toUserId)
]);
//# sourceMappingURL=notifications.schema.js.map