aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Entities/TimelinePostEntity.cs
blob: 8cdecef518e5147509290ff4e9e1ffda5c7239db (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
43
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace TimelineApp.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!;

        [Column("content_type"), Required]
        public string ContentType { get; set; } = default!;

        [Column("content")]
        public string? Content { get; set; }

        [Column("extra_content")]
        public string? ExtraContent { get; set; }

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

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