|
1 | 1 | using System.ComponentModel.DataAnnotations; |
| 2 | +using System.ComponentModel.DataAnnotations.Schema; |
| 3 | +using Microsoft.EntityFrameworkCore; |
2 | 4 |
|
3 | 5 | namespace PlotSystem_API.Models; |
4 | 6 |
|
| 7 | +[Table("plot")] |
| 8 | +[Index("CityProjectId", Name = "city_project_id")] |
| 9 | +[Index("DifficultyId", Name = "difficulty_id")] |
| 10 | +[Index("OwnerUuid", Name = "owner_uuid")] |
5 | 11 | public partial class Plot |
6 | 12 | { |
| 13 | + [Key] |
| 14 | + [Column("plot_id", TypeName = "int(11)")] |
7 | 15 | public int PlotId { get; set; } |
8 | 16 |
|
9 | | - [MaxLength(255)] |
| 17 | + [Column("city_project_id")] |
10 | 18 | public string CityProjectId { get; set; } = null!; |
11 | 19 |
|
12 | | - [MaxLength(255)] |
| 20 | + [Column("difficulty_id")] |
13 | 21 | public string DifficultyId { get; set; } = null!; |
14 | 22 |
|
| 23 | + [Column("owner_uuid")] |
| 24 | + [StringLength(36)] |
15 | 25 | public string? OwnerUuid { get; set; } |
16 | 26 |
|
17 | | - [MaxLength(255)] |
| 27 | + [Column("status", TypeName = "enum('unclaimed','unfinished','unreviewed','completed')")] |
18 | 28 | public string Status { get; set; } = null!; |
19 | 29 |
|
20 | | - public int? Score { get; set; } |
21 | | - |
| 30 | + [Column("outline_bounds", TypeName = "text")] |
22 | 31 | public string OutlineBounds { get; set; } = null!; |
23 | 32 |
|
| 33 | + [Column("initial_schematic", TypeName = "mediumblob")] |
24 | 34 | public byte[] InitialSchematic { get; set; } = null!; |
25 | 35 |
|
| 36 | + [Column("complete_schematic", TypeName = "mediumblob")] |
26 | 37 | public byte[]? CompleteSchematic { get; set; } |
27 | 38 |
|
| 39 | + [Column("last_activity_date", TypeName = "datetime")] |
28 | 40 | public DateTime? LastActivityDate { get; set; } |
29 | 41 |
|
| 42 | + [Column("is_pasted")] |
30 | 43 | public bool IsPasted { get; set; } |
31 | 44 |
|
| 45 | + [Column("mc_version")] |
| 46 | + [StringLength(8)] |
32 | 47 | public string? McVersion { get; set; } |
33 | 48 |
|
| 49 | + [Column("plot_version")] |
34 | 50 | public double PlotVersion { get; set; } |
35 | 51 |
|
| 52 | + [Column("plot_type", TypeName = "int(11)")] |
36 | 53 | public int PlotType { get; set; } |
37 | 54 |
|
| 55 | + [Column("created_by")] |
| 56 | + [StringLength(36)] |
38 | 57 | public string CreatedBy { get; set; } = null!; |
39 | 58 |
|
| 59 | + [Column("create_date", TypeName = "datetime")] |
40 | 60 | public DateTime CreateDate { get; set; } |
41 | 61 |
|
| 62 | + [ForeignKey("CityProjectId")] |
| 63 | + [InverseProperty("Plots")] |
42 | 64 | public virtual CityProject CityProject { get; set; } = null!; |
43 | 65 |
|
| 66 | + [ForeignKey("DifficultyId")] |
| 67 | + [InverseProperty("Plots")] |
44 | 68 | public virtual PlotDifficulty Difficulty { get; set; } = null!; |
45 | 69 |
|
| 70 | + [ForeignKey("OwnerUuid")] |
| 71 | + [InverseProperty("PlotsNavigation")] |
46 | 72 | public virtual Builder? OwnerUu { get; set; } |
47 | 73 |
|
| 74 | + [InverseProperty("Plot")] |
48 | 75 | public virtual ICollection<PlotReview> PlotReviews { get; set; } = new List<PlotReview>(); |
49 | 76 |
|
| 77 | + [ForeignKey("PlotId")] |
| 78 | + [InverseProperty("Plots")] |
50 | 79 | public virtual ICollection<Builder> Uus { get; set; } = new List<Builder>(); |
51 | 80 | } |
0 commit comments