mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
Update config/migrate-terms-timestamp.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
24689b99a1
commit
4fe9e98442
1 changed files with 3 additions and 0 deletions
|
|
@ -62,6 +62,9 @@ const connect = require('./connect');
|
||||||
try {
|
try {
|
||||||
// Use createdAt as fallback for termsAcceptedAt
|
// Use createdAt as fallback for termsAcceptedAt
|
||||||
const termsAcceptedAt = user.createdAt || new Date();
|
const termsAcceptedAt = user.createdAt || new Date();
|
||||||
|
if (!user.createdAt) {
|
||||||
|
console.yellow(`Warning: User ${user._id} has no createdAt, using current date for termsAcceptedAt`);
|
||||||
|
}
|
||||||
await User.updateOne({ _id: user._id }, { $set: { termsAcceptedAt } });
|
await User.updateOne({ _id: user._id }, { $set: { termsAcceptedAt } });
|
||||||
migratedCount++;
|
migratedCount++;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue