Files
tile-server/src/TileServer.Infrastructure/Data/Migrations/AppDbContextModelSnapshot.cs
T
2026-09-21 03:53:15 +03:00

210 lines
7.1 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TileServer.Infrastructure.Data;
#nullable disable
namespace TileServer.Infrastructure.Data.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TileServer.Domain.Accounts.ApiToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Hash")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("Prefix")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("character varying(16)");
b.Property<DateTimeOffset?>("RevokedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("UserId");
b.ToTable("ApiTokens", (string)null);
});
modelBuilder.Entity("TileServer.Domain.Accounts.UsageDaily", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<long>("Bytes")
.HasColumnType("bigint");
b.Property<DateOnly>("Date")
.HasColumnType("date");
b.Property<long>("StyleRequests")
.HasColumnType("bigint");
b.Property<long>("TileRequests")
.HasColumnType("bigint");
b.Property<Guid>("TokenId")
.HasColumnType("uuid");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "Date");
b.HasIndex("UserId", "TokenId", "Date")
.IsUnique();
b.ToTable("UsageDaily", (string)null);
});
modelBuilder.Entity("TileServer.Domain.Accounts.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<DateTimeOffset>("LastLoginAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Login")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("YandexId")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.HasKey("Id");
b.HasIndex("Slug")
.IsUnique();
b.HasIndex("YandexId")
.IsUnique();
b.ToTable("Users", (string)null);
});
modelBuilder.Entity("TileServer.Domain.Accounts.UserStyle", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CreatedFrom")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("Json")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId", "Name")
.IsUnique();
b.ToTable("UserStyles", (string)null);
});
modelBuilder.Entity("TileServer.Domain.Accounts.ApiToken", b =>
{
b.HasOne("TileServer.Domain.Accounts.User", "User")
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("TileServer.Domain.Accounts.UserStyle", b =>
{
b.HasOne("TileServer.Domain.Accounts.User", "User")
.WithMany("Styles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("TileServer.Domain.Accounts.User", b =>
{
b.Navigation("Styles");
b.Navigation("Tokens");
});
#pragma warning restore 612, 618
}
}
}