Skip to content

Commit

Permalink
Added Members Only EF Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Dec 3, 2024
1 parent 4c56ab5 commit cec9611
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace LinkDotNet.Blog.Infrastructure.Migrations

Check failure on line 5 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

Convert to file-scoped namespace (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0161)

Check failure on line 5 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

Convert to file-scoped namespace (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0161)
{
/// <inheritdoc />
public partial class BlogPost_MembersOnly : Migration

Check failure on line 8 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

Remove the underscores from type name LinkDotNet.Blog.Infrastructure.Migrations.BlogPost_MembersOnly (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)

Check failure on line 8 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

Remove the underscores from type name LinkDotNet.Blog.Infrastructure.Migrations.BlogPost_MembersOnly (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(

Check failure on line 13 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

In externally visible method 'void BlogPost_MembersOnly.Up(MigrationBuilder migrationBuilder)', validate parameter 'migrationBuilder' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check failure on line 13 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

In externally visible method 'void BlogPost_MembersOnly.Up(MigrationBuilder migrationBuilder)', validate parameter 'migrationBuilder' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)
name: "IsMembersOnly",
table: "BlogPosts",
type: "INTEGER",
nullable: false,
defaultValue: false);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(

Check failure on line 24 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

In externally visible method 'void BlogPost_MembersOnly.Down(MigrationBuilder migrationBuilder)', validate parameter 'migrationBuilder' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)

Check failure on line 24 in src/LinkDotNet.Blog.Infrastructure/Migrations/20241203173853_BlogPost_MembersOnly.cs

View workflow job for this annotation

GitHub Actions / build

In externally visible method 'void BlogPost_MembersOnly.Down(MigrationBuilder migrationBuilder)', validate parameter 'migrationBuilder' is non-null before using it. If appropriate, throw an 'ArgumentNullException' when the argument is 'null'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062)
name: "IsMembersOnly",
table: "BlogPosts");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.IsRequired()
.HasColumnType("TEXT");

b.Property<bool>("IsMembersOnly")
.HasColumnType("INTEGER");

b.Property<bool>("IsPublished")
.HasColumnType("INTEGER");

Expand Down

0 comments on commit cec9611

Please sign in to comment.