rename col names

This commit is contained in:
counterweight 2025-02-09 18:59:11 +01:00
parent e7342828c8
commit 9e0324b143
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 5 additions and 5 deletions

View file

@ -2,13 +2,13 @@ const { DataTypes } = require('sequelize');
const sequelize = require('../database');
const SessionNpubbed = sequelize.define('SessionNpubbed', {
sessionNpubbedUuid: {
session_npubbed_uuid: {
type: DataTypes.UUID,
allowNull: false,
unique: true,
primaryKey: true
},
sessionUuid: {
session_uuid: {
type: DataTypes.UUID,
allowNull: false,
},

View file

@ -15,7 +15,7 @@ router.post('/session-npubbed', async (req, res) => {
try {
const existingRecord = await SessionNpubbed.findOne({
where: { sessionUuid, npub }
where: { 'session_uuid': sessionUuid, npub }
});
if (existingRecord) {
@ -27,8 +27,8 @@ router.post('/session-npubbed', async (req, res) => {
console.log("No matching record found. Creating a new one...");
await SessionNpubbed.create({
sessionNpubbedUuid: uuid.v7(),
sessionUuid,
session_npubbed_uuid: uuid.v7(),
session_uuid: sessionUuid,
npub,
created_at: new Date().toISOString()
});