This commit is contained in:
6d486f49
2026-08-17 01:13:48 -04:00
parent 1d6207fbfe
commit ffaab59585
26 changed files with 3133 additions and 105 deletions
@@ -0,0 +1,133 @@
// <auto-generated />
using System;
using Cloud;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Cloud.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20260817053000_AddUsersAndSyncCardNotes")]
partial class AddUsersAndSyncCardNotes
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("DatabaseTest.Models.PasskeyCredential", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("AaGuid")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<byte[]>("CredentialId")
.IsRequired()
.HasColumnType("bytea");
b.Property<byte[]>("PublicKey")
.IsRequired()
.HasColumnType("bytea");
b.Property<long>("SignCount")
.HasColumnType("bigint");
b.Property<byte[]>("UserHandle")
.IsRequired()
.HasColumnType("bytea");
b.HasKey("Id");
b.ToTable("PasskeyCredentials");
});
modelBuilder.Entity("Model.CardNote", b =>
{
b.Property<string>("Username")
.HasColumnType("text");
b.Property<string>("CardName")
.HasColumnType("text");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Username", "CardName");
b.ToTable("CardNotes");
});
modelBuilder.Entity("Model.User", b =>
{
b.Property<string>("Username")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Username");
b.ToTable("Users");
});
modelBuilder.Entity("Model.UserDeck", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.PrimitiveCollection<string>("Cards")
.IsRequired()
.HasColumnType("jsonb");
b.PrimitiveCollection<string>("Divers")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<string>("Season")
.HasColumnType("text");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("UserDecks");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,75 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cloud.Migrations
{
/// <inheritdoc />
public partial class AddUsersAndSyncCardNotes : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_CardNotes",
table: "CardNotes");
migrationBuilder.AddColumn<string>(
name: "Username",
table: "CardNotes",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<DateTime>(
name: "UpdatedAt",
table: "CardNotes",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddPrimaryKey(
name: "PK_CardNotes",
table: "CardNotes",
columns: new[] { "Username", "CardName" });
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Username = table.Column<string>(type: "text", nullable: false),
Password = table.Column<string>(type: "text", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Username);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
migrationBuilder.DropPrimaryKey(
name: "PK_CardNotes",
table: "CardNotes");
migrationBuilder.DropColumn(
name: "Username",
table: "CardNotes");
migrationBuilder.DropColumn(
name: "UpdatedAt",
table: "CardNotes");
migrationBuilder.AddPrimaryKey(
name: "PK_CardNotes",
table: "CardNotes",
column: "CardName");
}
}
}
@@ -21,8 +21,11 @@ namespace Cloud.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Chrono.Model.CardNote", b =>
modelBuilder.Entity("Model.CardNote", b =>
{
b.Property<string>("Username")
.HasColumnType("text");
b.Property<string>("CardName")
.HasColumnType("text");
@@ -30,12 +33,32 @@ namespace Cloud.Migrations
.IsRequired()
.HasColumnType("text");
b.HasKey("CardName");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Username", "CardName");
b.ToTable("CardNotes");
});
modelBuilder.Entity("Cloud.Models.PasskeyCredential", b =>
modelBuilder.Entity("Model.User", b =>
{
b.Property<string>("Username")
.HasColumnType("text");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Username");
b.ToTable("Users");
});
modelBuilder.Entity("DatabaseTest.Models.PasskeyCredential", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -69,7 +92,7 @@ namespace Cloud.Migrations
b.ToTable("PasskeyCredentials");
});
modelBuilder.Entity("Cloud.Models.UserDeck", b =>
modelBuilder.Entity("Model.UserDeck", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()