Skip to content

Commit

Permalink
feat: add 100 char-long identityAddresses on SqlServer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dannyps committed Mar 21, 2024
1 parent 29a5f2b commit 7a5ff21
Show file tree
Hide file tree
Showing 21 changed files with 2,197 additions and 51 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,48 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Backbone.Modules.Challenges.Infrastructure.Database.SqlServer.Migrations
{
/// <inheritdoc />
public partial class IdentityAddress100 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
table: "Challenges",
type: "char(100)",
unicode: false,
fixedLength: true,
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "char(36)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 36,
oldNullable: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
table: "Challenges",
type: "char(36)",
unicode: false,
fixedLength: true,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "char(100)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 100,
oldNullable: true);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using Backbone.Modules.Challenges.Infrastructure.Persistence.Database;
using Microsoft.EntityFrameworkCore;
Expand All @@ -17,12 +17,12 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.9")
.HasAnnotation("ProductVersion", "8.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

modelBuilder.Entity("Challenges.Domain.Entities.Challenge", b =>
modelBuilder.Entity("Backbone.Modules.Challenges.Domain.Entities.Challenge", b =>
{
b.Property<string>("Id")
.HasMaxLength(20)
Expand All @@ -31,9 +31,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.IsFixedLength();

b.Property<string>("CreatedBy")
.HasMaxLength(36)
.HasMaxLength(100)
.IsUnicode(false)
.HasColumnType("char(36)")
.HasColumnType("char(100)")
.IsFixedLength();

b.Property<string>("CreatedByDevice")
Expand Down

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,132 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Backbone.Modules.Files.Infrastructure.Database.SqlServer.Migrations
{
/// <inheritdoc />
public partial class IdentityAddress100 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Owner",
table: "FileMetadata",
type: "char(100)",
unicode: false,
fixedLength: true,
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "char(36)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 36);

migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
table: "FileMetadata",
type: "char(100)",
unicode: false,
fixedLength: true,
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "char(36)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 36);

migrationBuilder.AlterColumn<string>(
name: "DeletedBy",
table: "FileMetadata",
type: "char(100)",
unicode: false,
fixedLength: true,
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "char(36)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 36,
oldNullable: true);

migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
table: "FileMetadata",
type: "char(100)",
unicode: false,
fixedLength: true,
maxLength: 100,
nullable: false,
oldClrType: typeof(string),
oldType: "char(36)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 36);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Owner",
table: "FileMetadata",
type: "char(36)",
unicode: false,
fixedLength: true,
maxLength: 36,
nullable: false,
oldClrType: typeof(string),
oldType: "char(100)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 100);

migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
table: "FileMetadata",
type: "char(36)",
unicode: false,
fixedLength: true,
maxLength: 36,
nullable: false,
oldClrType: typeof(string),
oldType: "char(100)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 100);

migrationBuilder.AlterColumn<string>(
name: "DeletedBy",
table: "FileMetadata",
type: "char(36)",
unicode: false,
fixedLength: true,
maxLength: 36,
nullable: true,
oldClrType: typeof(string),
oldType: "char(100)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 100,
oldNullable: true);

migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
table: "FileMetadata",
type: "char(36)",
unicode: false,
fixedLength: true,
maxLength: 36,
nullable: false,
oldClrType: typeof(string),
oldType: "char(100)",
oldUnicode: false,
oldFixedLength: true,
oldMaxLength: 100);
}
}
}
Loading

0 comments on commit 7a5ff21

Please sign in to comment.