feat: flag management
This commit is contained in:
		
							parent
							
								
									8bd4449804
								
							
						
					
					
						commit
						d9d48c3cbf
					
				
					 24 changed files with 615 additions and 235 deletions
				
			
		|  | @ -0,0 +1,41 @@ | |||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| 
 | ||||
| #nullable disable | ||||
| 
 | ||||
| namespace Foxnouns.Backend.Database.Migrations | ||||
| { | ||||
|     /// <inheritdoc /> | ||||
|     [DbContext(typeof(DatabaseContext))] | ||||
|     [Migration("20241209134148_NullableFlagHash")] | ||||
|     public partial class NullableFlagHash : Migration | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.AlterColumn<string>( | ||||
|                 name: "hash", | ||||
|                 table: "pride_flags", | ||||
|                 type: "text", | ||||
|                 nullable: true, | ||||
|                 oldClrType: typeof(string), | ||||
|                 oldType: "text" | ||||
|             ); | ||||
|         } | ||||
| 
 | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.AlterColumn<string>( | ||||
|                 name: "hash", | ||||
|                 table: "pride_flags", | ||||
|                 type: "text", | ||||
|                 nullable: false, | ||||
|                 defaultValue: "", | ||||
|                 oldClrType: typeof(string), | ||||
|                 oldType: "text", | ||||
|                 oldNullable: true | ||||
|             ); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | @ -282,7 +282,6 @@ namespace Foxnouns.Backend.Database.Migrations | |||
|                         .HasColumnName("description"); | ||||
| 
 | ||||
|                     b.Property<string>("Hash") | ||||
|                         .IsRequired() | ||||
|                         .HasColumnType("text") | ||||
|                         .HasColumnName("hash"); | ||||
| 
 | ||||
|  | @ -546,7 +545,7 @@ namespace Foxnouns.Backend.Database.Migrations | |||
|             modelBuilder.Entity("Foxnouns.Backend.Database.Models.DataExport", b => | ||||
|                 { | ||||
|                     b.HasOne("Foxnouns.Backend.Database.Models.User", "User") | ||||
|                         .WithMany() | ||||
|                         .WithMany("DataExports") | ||||
|                         .HasForeignKey("UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired() | ||||
|  | @ -645,6 +644,8 @@ namespace Foxnouns.Backend.Database.Migrations | |||
|                 { | ||||
|                     b.Navigation("AuthMethods"); | ||||
| 
 | ||||
|                     b.Navigation("DataExports"); | ||||
| 
 | ||||
|                     b.Navigation("Flags"); | ||||
| 
 | ||||
|                     b.Navigation("Members"); | ||||
|  |  | |||
|  | @ -3,7 +3,9 @@ namespace Foxnouns.Backend.Database.Models; | |||
| public class PrideFlag : BaseModel | ||||
| { | ||||
|     public required Snowflake UserId { get; init; } | ||||
|     public required string Hash { get; init; } | ||||
| 
 | ||||
|     // A null hash means the flag hasn't been processed yet. | ||||
|     public string? Hash { get; set; } | ||||
|     public required string Name { get; set; } | ||||
|     public string? Description { get; set; } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue