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

namespace Spacebar.Db.Models;

[Table("streams")]
public partial class Stream
{
    [Key]
    [Column("id", TypeName = "character varying")]
    public string Id { get; set; } = null!;

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

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

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

    [ForeignKey("ChannelId")]
    [InverseProperty("Streams")]
    public virtual Channel Channel { get; set; } = null!;

    [ForeignKey("OwnerId")]
    [InverseProperty("Streams")]
    public virtual User Owner { get; set; } = null!;

    [InverseProperty("Stream")]
    public virtual ICollection<StreamSession> StreamSessions { get; set; } = new List<StreamSession>();
}