2026-08-13 23:10:22 +07:00
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
2026-08-19 23:25:08 +07:00
|
|
|
using mws.backend.dotnet.infrastructure.Persistence;
|
2026-08-13 23:10:22 +07:00
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
namespace mws.backend.dotnet.infrastructure.Migrations
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
[DbContext(typeof(AppDbContext))]
|
|
|
|
|
[Migration("20260809054503_InitialCreate")]
|
|
|
|
|
partial class InitialCreate
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.HasAnnotation("ProductVersion", "10.0.10")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
|
|
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Documents.Document", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Content")
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid?>("ParentId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("ProjectId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Title")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(300)
|
|
|
|
|
.HasColumnType("character varying(300)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Type")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(20)
|
|
|
|
|
.HasColumnType("character varying(20)");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid?>("UpdatedBy")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ParentId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProjectId", "ParentId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("documents", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Projects.Project", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Description")
|
|
|
|
|
.HasMaxLength(2000)
|
|
|
|
|
.HasColumnType("character varying(2000)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(200)
|
|
|
|
|
.HasColumnType("character varying(200)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Status")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(20)
|
|
|
|
|
.HasColumnType("character varying(20)");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("projects", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Projects.ProjectMember", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Property<Guid>("ProjectId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("UserId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Role")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(20)
|
|
|
|
|
.HasColumnType("character varying(20)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ProjectId", "UserId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("project_members", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Tasks.TaskItem", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid?>("AssigneeId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Description")
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime?>("DueDate")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Priority")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(20)
|
|
|
|
|
.HasColumnType("character varying(20)");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("ProjectId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Status")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(20)
|
|
|
|
|
.HasColumnType("character varying(20)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Title")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(300)
|
|
|
|
|
.HasColumnType("character varying(300)");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("AssigneeId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProjectId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("Status");
|
|
|
|
|
|
|
|
|
|
b.ToTable("tasks", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Users.User", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("DisplayName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(150)
|
|
|
|
|
.HasColumnType("character varying(150)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("PasswordHash")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(200)
|
|
|
|
|
.HasColumnType("character varying(200)");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Username")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(100)
|
|
|
|
|
.HasColumnType("character varying(100)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("Username")
|
|
|
|
|
.IsUnique();
|
|
|
|
|
|
|
|
|
|
b.ToTable("users", (string)null);
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Documents.Document", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
2026-08-19 23:25:08 +07:00
|
|
|
b.HasOne("mws.backend.dotnet.domain.Documents.Document", "Parent")
|
2026-08-13 23:10:22 +07:00
|
|
|
.WithMany("Children")
|
|
|
|
|
.HasForeignKey("ParentId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
|
|
|
|
|
|
b.Navigation("Parent");
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Projects.ProjectMember", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
2026-08-19 23:25:08 +07:00
|
|
|
b.HasOne("mws.backend.dotnet.domain.Projects.Project", "Project")
|
2026-08-13 23:10:22 +07:00
|
|
|
.WithMany("Members")
|
|
|
|
|
.HasForeignKey("ProjectId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
b.HasOne("mws.backend.dotnet.domain.Users.User", "User")
|
2026-08-13 23:10:22 +07:00
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("UserId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Project");
|
|
|
|
|
|
|
|
|
|
b.Navigation("User");
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Tasks.TaskItem", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
2026-08-19 23:25:08 +07:00
|
|
|
b.HasOne("mws.backend.dotnet.domain.Users.User", "Assignee")
|
2026-08-13 23:10:22 +07:00
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("AssigneeId")
|
|
|
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
|
|
|
|
|
|
b.Navigation("Assignee");
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Documents.Document", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Navigation("Children");
|
|
|
|
|
});
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
modelBuilder.Entity("mws.backend.dotnet.domain.Projects.Project", b =>
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
b.Navigation("Members");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|