summary refs log tree commit diff
path: root/extra/admin-api/Spacebar.Db/Models/Relationship.cs
blob: 99a43ad78794d1561a1176f6b29b3653f88ed043 (plain) (blame)
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
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace Spacebar.Db.Models;

[Table("relationships")]
[Index("FromId", "ToId", Name = "IDX_a0b2ff0a598df0b0d055934a17", IsUnique = true)]
public partial class Relationship
{
    [Key]
    [Column("id", TypeName = "character varying")]
    public string Id { get; set; } = null!;

    [Column("from_id", TypeName = "character varying")]
    public string FromId { get; set; } = null!;

    [Column("to_id", TypeName = "character varying")]
    public string ToId { get; set; } = null!;

    [Column("nickname", TypeName = "character varying")]
    public string? Nickname { get; set; }

    [Column("type")]
    public int Type { get; set; }

    [ForeignKey("FromId")]
    [InverseProperty("RelationshipFroms")]
    public virtual User From { get; set; } = null!;

    [ForeignKey("ToId")]
    [InverseProperty("RelationshipTos")]
    public virtual User To { get; set; } = null!;
}