mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-30 23:15:52 +00:00
37 lines
946 B
C#
37 lines
946 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Spacebar.Models.Db.Models;
|
|
|
|
[Table("relationships")]
|
|
[Index("FromId", "ToId", Name = "IDX_a0b2ff0a598df0b0d055934a17", IsUnique = true)]
|
|
public partial class Relationship
|
|
{
|
|
[Key]
|
|
[Column("id")]
|
|
public long Id { get; set; }
|
|
|
|
[Column("from_id")]
|
|
public long FromId { get; set; }
|
|
|
|
[Column("to_id")]
|
|
public long ToId { get; set; }
|
|
|
|
[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!;
|
|
}
|