mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
sync: migrate sync devices from fs to mongodb
This commit is contained in:
16
Notesnook.API/Models/DeviceIdsChunk.cs
Normal file
16
Notesnook.API/Models/DeviceIdsChunk.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Notesnook.API.Models
|
||||
{
|
||||
public class DeviceIdsChunk
|
||||
{
|
||||
[BsonId]
|
||||
public ObjectId Id { get; set; }
|
||||
public required string UserId { get; set; }
|
||||
public required string DeviceId { get; set; }
|
||||
public required string Key { get; set; }
|
||||
public required string[] Ids { get; set; } = [];
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,10 @@ You should have received a copy of the Affero GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Notesnook.API.Models
|
||||
{
|
||||
@@ -48,8 +48,5 @@ namespace Notesnook.API.Models
|
||||
|
||||
[JsonPropertyName("deleted")]
|
||||
public bool Deleted { get; set; }
|
||||
|
||||
[JsonPropertyName("viewCount")]
|
||||
public int ViewCount { get; set; }
|
||||
}
|
||||
}
|
||||
19
Notesnook.API/Models/SyncDevice.cs
Normal file
19
Notesnook.API/Models/SyncDevice.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Notesnook.API.Models
|
||||
{
|
||||
public class SyncDevice
|
||||
{
|
||||
[BsonId]
|
||||
public ObjectId Id { get; set; }
|
||||
|
||||
public required string UserId { get; set; }
|
||||
public required string DeviceId { get; set; }
|
||||
public required long LastAccessTime { get; set; }
|
||||
public required bool IsSyncReset { get; set; }
|
||||
public string? AppVersion { get; set; }
|
||||
public string? DatabaseVersion { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user