aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Entities
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-10 02:03:06 +0800
committercrupest <crupest@outlook.com>2021-02-10 02:03:06 +0800
commit4ea535d93753826ec900879560d876cec4d58c38 (patch)
treeb2d94c4347fddf8641fc41caa86826374c9cc241 /BackEnd/Timeline/Entities
parentbf8f849c36bfc42cfd0ef1a66f2adf01dc8e1be7 (diff)
downloadtimeline-4ea535d93753826ec900879560d876cec4d58c38.tar.gz
timeline-4ea535d93753826ec900879560d876cec4d58c38.tar.bz2
timeline-4ea535d93753826ec900879560d876cec4d58c38.zip
...
Diffstat (limited to 'BackEnd/Timeline/Entities')
-rw-r--r--BackEnd/Timeline/Entities/DatabaseContext.cs1
-rw-r--r--BackEnd/Timeline/Entities/TimelinePostDataEntity.cs31
-rw-r--r--BackEnd/Timeline/Entities/TimelinePostEntity.cs12
3 files changed, 36 insertions, 8 deletions
diff --git a/BackEnd/Timeline/Entities/DatabaseContext.cs b/BackEnd/Timeline/Entities/DatabaseContext.cs
index 513cdc95..a0b59d1f 100644
--- a/BackEnd/Timeline/Entities/DatabaseContext.cs
+++ b/BackEnd/Timeline/Entities/DatabaseContext.cs
@@ -28,6 +28,7 @@ namespace Timeline.Entities
public DbSet<UserPermissionEntity> UserPermission { get; set; } = default!;
public DbSet<TimelineEntity> Timelines { get; set; } = default!;
public DbSet<TimelinePostEntity> TimelinePosts { get; set; } = default!;
+ public DbSet<TimelinePostDataEntity> TimelinePostData { get; set; } = default!;
public DbSet<TimelineMemberEntity> TimelineMembers { get; set; } = default!;
public DbSet<HighlightTimelineEntity> HighlightTimelines { get; set; } = default!;
public DbSet<BookmarkTimelineEntity> BookmarkTimelines { get; set; } = default!;
diff --git a/BackEnd/Timeline/Entities/TimelinePostDataEntity.cs b/BackEnd/Timeline/Entities/TimelinePostDataEntity.cs
new file mode 100644
index 00000000..6ae8fd24
--- /dev/null
+++ b/BackEnd/Timeline/Entities/TimelinePostDataEntity.cs
@@ -0,0 +1,31 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ [Table("timeline_post_data")]
+ public class TimelinePostDataEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("post")]
+ public long PostId { get; set; }
+
+ [ForeignKey(nameof(PostId))]
+ public TimelinePostEntity Timeline { get; set; } = default!;
+
+ [Column("index")]
+ public long Index { get; set; }
+
+ [Column("kind")]
+ public string Kind { get; set; } = default!;
+
+ [Column("data_tag")]
+ public string DataTag { get; set; } = default!;
+
+ [Column("last_updated")]
+ public DateTime LastUpdated { get; set; }
+ }
+}
diff --git a/BackEnd/Timeline/Entities/TimelinePostEntity.cs b/BackEnd/Timeline/Entities/TimelinePostEntity.cs
index 39b11a5b..c65ef929 100644
--- a/BackEnd/Timeline/Entities/TimelinePostEntity.cs
+++ b/BackEnd/Timeline/Entities/TimelinePostEntity.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -25,14 +26,7 @@ namespace Timeline.Entities
[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; }
+ public bool Deleted { get; set; }
[Column("color")]
public string? Color { get; set; }
@@ -42,5 +36,7 @@ namespace Timeline.Entities
[Column("last_updated")]
public DateTime LastUpdated { get; set; }
+
+ public List<TimelinePostDataEntity> DataList { get; set; } = default!;
}
}