summary refs log tree commit diff
path: root/extra/admin-api/Spacebar.Db/Models/Template.cs
blob: 0eb0675f813a632752735e8ff500c36ec665bc04 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace Spacebar.Db.Models;

[Table("templates")]
[Index("Code", Name = "UQ_be38737bf339baf63b1daeffb55", IsUnique = true)]
public partial class Template
{
    [Key]
    [Column("id", TypeName = "character varying")]
    public string Id { get; set; } = null!;

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

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

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

    [Column("usage_count")]
    public int? UsageCount { get; set; }

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

    [Column("created_at", TypeName = "timestamp without time zone")]
    public DateTime CreatedAt { get; set; }

    [Column("updated_at", TypeName = "timestamp without time zone")]
    public DateTime UpdatedAt { get; set; }

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

    [Column("serialized_source_guild")]
    public string SerializedSourceGuild { get; set; } = null!;

    [ForeignKey("CreatorId")]
    [InverseProperty("Templates")]
    public virtual User? Creator { get; set; }

    [InverseProperty("Template")]
    public virtual ICollection<Guild> Guilds { get; set; } = new List<Guild>();

    [ForeignKey("SourceGuildId")]
    [InverseProperty("Templates")]
    public virtual Guild? SourceGuild { get; set; }
}