aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Entities/TimelinePostEntity.cs
blob: c65ef929e089f98ec744d69899a0b0c77a032c38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Timeline.Entities
{
    [Table("timeline_posts")]
    public class TimelinePostEntity
    {
        [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long Id { get; set; }

        [Column("local_id")]
        public long LocalId { get; set; }

        [Column("timeline")]
        public long TimelineId { get; set; }

        [ForeignKey(nameof(TimelineId))]
        public TimelineEntity Timeline { get; set; } = default!;

        [Column("author")]
        public long? AuthorId { get; set; }

        [ForeignKey(nameof(AuthorId))]
        public UserEntity? Author { get; set; } = default!;

        public bool Deleted { get; set; }

        [Column("color")]
        public string? Color { get; set; }

        [Column("time")]
        public DateTime Time { get; set; }

        [Column("last_updated")]
        public DateTime LastUpdated { get; set; }

        public List<TimelinePostDataEntity> DataList { get; set; } = default!;
    }
}