chore: initial commit of TaskTracker project
Existing ASP.NET API with vanilla JS SPA, WindowWatcher, Chrome extension, and MCP server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
242
TaskTracker.Infrastructure/Migrations/20260226032729_InitialCreate.Designer.cs
generated
Normal file
242
TaskTracker.Infrastructure/Migrations/20260226032729_InitialCreate.Designer.cs
generated
Normal file
@@ -0,0 +1,242 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TaskTracker.Infrastructure.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TaskTracker.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(TaskTrackerDbContext))]
|
||||
[Migration("20260226032729_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.AppMapping", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Category")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FriendlyName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("MatchType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Pattern")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AppMappings");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Category = "Engineering",
|
||||
FriendlyName = "SolidWorks",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "SLDWORKS"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Category = "Email",
|
||||
FriendlyName = "Outlook",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "OUTLOOK"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Category = "General",
|
||||
FriendlyName = "Notepad",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "notepad"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Category = "LaserCutting",
|
||||
FriendlyName = "PEP System",
|
||||
MatchType = "UrlContains",
|
||||
Pattern = "pep"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Category = "Engineering",
|
||||
FriendlyName = "SolidWorks",
|
||||
MatchType = "TitleContains",
|
||||
Pattern = "solidworks"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.ContextEvent", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("AppName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime>("Timestamp")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Url")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<string>("WindowTitle")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("nvarchar(1000)");
|
||||
|
||||
b.Property<int?>("WorkTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Timestamp");
|
||||
|
||||
b.HasIndex("WorkTaskId");
|
||||
|
||||
b.ToTable("ContextEvents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.TaskNote", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("WorkTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("WorkTaskId");
|
||||
|
||||
b.ToTable("Notes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Category")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.ContextEvent", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "WorkTask")
|
||||
.WithMany("ContextEvents")
|
||||
.HasForeignKey("WorkTaskId");
|
||||
|
||||
b.Navigation("WorkTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.TaskNote", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "WorkTask")
|
||||
.WithMany("Notes")
|
||||
.HasForeignKey("WorkTaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("WorkTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.Navigation("ContextEvents");
|
||||
|
||||
b.Navigation("Notes");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace TaskTracker.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AppMappings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Pattern = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
||||
MatchType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
Category = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
FriendlyName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AppMappings", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tasks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Title = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Status = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
Category = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
StartedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CompletedAt = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tasks", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ContextEvents",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WorkTaskId = table.Column<int>(type: "int", nullable: true),
|
||||
Source = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
AppName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
WindowTitle = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
||||
Url = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
||||
Timestamp = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ContextEvents", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ContextEvents_Tasks_WorkTaskId",
|
||||
column: x => x.WorkTaskId,
|
||||
principalTable: "Tasks",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Notes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WorkTaskId = table.Column<int>(type: "int", nullable: false),
|
||||
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Notes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Notes_Tasks_WorkTaskId",
|
||||
column: x => x.WorkTaskId,
|
||||
principalTable: "Tasks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AppMappings",
|
||||
columns: new[] { "Id", "Category", "FriendlyName", "MatchType", "Pattern" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Engineering", "SolidWorks", "ProcessName", "SLDWORKS" },
|
||||
{ 2, "Email", "Outlook", "ProcessName", "OUTLOOK" },
|
||||
{ 3, "General", "Notepad", "ProcessName", "notepad" },
|
||||
{ 4, "LaserCutting", "PEP System", "UrlContains", "pep" },
|
||||
{ 5, "Engineering", "SolidWorks", "TitleContains", "solidworks" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ContextEvents_Timestamp",
|
||||
table: "ContextEvents",
|
||||
column: "Timestamp");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ContextEvents_WorkTaskId",
|
||||
table: "ContextEvents",
|
||||
column: "WorkTaskId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Notes_WorkTaskId",
|
||||
table: "Notes",
|
||||
column: "WorkTaskId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AppMappings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ContextEvents");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Notes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tasks");
|
||||
}
|
||||
}
|
||||
}
|
||||
259
TaskTracker.Infrastructure/Migrations/20260227013459_AddSubTasks.Designer.cs
generated
Normal file
259
TaskTracker.Infrastructure/Migrations/20260227013459_AddSubTasks.Designer.cs
generated
Normal file
@@ -0,0 +1,259 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TaskTracker.Infrastructure.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TaskTracker.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(TaskTrackerDbContext))]
|
||||
[Migration("20260227013459_AddSubTasks")]
|
||||
partial class AddSubTasks
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.AppMapping", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Category")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FriendlyName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("MatchType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Pattern")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AppMappings");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Category = "Engineering",
|
||||
FriendlyName = "SolidWorks",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "SLDWORKS"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Category = "Email",
|
||||
FriendlyName = "Outlook",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "OUTLOOK"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Category = "General",
|
||||
FriendlyName = "Notepad",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "notepad"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Category = "LaserCutting",
|
||||
FriendlyName = "PEP System",
|
||||
MatchType = "UrlContains",
|
||||
Pattern = "pep"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Category = "Engineering",
|
||||
FriendlyName = "SolidWorks",
|
||||
MatchType = "TitleContains",
|
||||
Pattern = "solidworks"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.ContextEvent", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("AppName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime>("Timestamp")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Url")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<string>("WindowTitle")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("nvarchar(1000)");
|
||||
|
||||
b.Property<int?>("WorkTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Timestamp");
|
||||
|
||||
b.HasIndex("WorkTaskId");
|
||||
|
||||
b.ToTable("ContextEvents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.TaskNote", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("WorkTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("WorkTaskId");
|
||||
|
||||
b.ToTable("Notes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Category")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("ParentTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ParentTaskId");
|
||||
|
||||
b.ToTable("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.ContextEvent", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "WorkTask")
|
||||
.WithMany("ContextEvents")
|
||||
.HasForeignKey("WorkTaskId");
|
||||
|
||||
b.Navigation("WorkTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.TaskNote", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "WorkTask")
|
||||
.WithMany("Notes")
|
||||
.HasForeignKey("WorkTaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("WorkTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "ParentTask")
|
||||
.WithMany("SubTasks")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("ParentTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.Navigation("ContextEvents");
|
||||
|
||||
b.Navigation("Notes");
|
||||
|
||||
b.Navigation("SubTasks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TaskTracker.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSubTasks : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ParentTaskId",
|
||||
table: "Tasks",
|
||||
type: "int",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tasks_ParentTaskId",
|
||||
table: "Tasks",
|
||||
column: "ParentTaskId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Tasks_Tasks_ParentTaskId",
|
||||
table: "Tasks",
|
||||
column: "ParentTaskId",
|
||||
principalTable: "Tasks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Tasks_Tasks_ParentTaskId",
|
||||
table: "Tasks");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Tasks_ParentTaskId",
|
||||
table: "Tasks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ParentTaskId",
|
||||
table: "Tasks");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TaskTracker.Infrastructure.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TaskTracker.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(TaskTrackerDbContext))]
|
||||
partial class TaskTrackerDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.3")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.AppMapping", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Category")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FriendlyName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("MatchType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Pattern")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("AppMappings");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Category = "Engineering",
|
||||
FriendlyName = "SolidWorks",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "SLDWORKS"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Category = "Email",
|
||||
FriendlyName = "Outlook",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "OUTLOOK"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Category = "General",
|
||||
FriendlyName = "Notepad",
|
||||
MatchType = "ProcessName",
|
||||
Pattern = "notepad"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Category = "LaserCutting",
|
||||
FriendlyName = "PEP System",
|
||||
MatchType = "UrlContains",
|
||||
Pattern = "pep"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Category = "Engineering",
|
||||
FriendlyName = "SolidWorks",
|
||||
MatchType = "TitleContains",
|
||||
Pattern = "solidworks"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.ContextEvent", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("AppName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime>("Timestamp")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Url")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<string>("WindowTitle")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("nvarchar(1000)");
|
||||
|
||||
b.Property<int?>("WorkTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Timestamp");
|
||||
|
||||
b.HasIndex("WorkTaskId");
|
||||
|
||||
b.ToTable("ContextEvents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.TaskNote", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("WorkTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("WorkTaskId");
|
||||
|
||||
b.ToTable("Notes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Category")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("ParentTaskId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ParentTaskId");
|
||||
|
||||
b.ToTable("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.ContextEvent", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "WorkTask")
|
||||
.WithMany("ContextEvents")
|
||||
.HasForeignKey("WorkTaskId");
|
||||
|
||||
b.Navigation("WorkTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.TaskNote", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "WorkTask")
|
||||
.WithMany("Notes")
|
||||
.HasForeignKey("WorkTaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("WorkTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.HasOne("TaskTracker.Core.Entities.WorkTask", "ParentTask")
|
||||
.WithMany("SubTasks")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("ParentTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TaskTracker.Core.Entities.WorkTask", b =>
|
||||
{
|
||||
b.Navigation("ContextEvents");
|
||||
|
||||
b.Navigation("Notes");
|
||||
|
||||
b.Navigation("SubTasks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user