From 00955e765a7c847e47658044d84e58309d373bf5 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 29 Feb 2020 00:14:05 +0800 Subject: Remove the length constraint in entity as entity framework core does not use them as well. --- Timeline/Migrations/20200105150407_Initialize.cs | 6 +++--- Timeline/Migrations/DatabaseContextModelSnapshot.cs | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'Timeline/Migrations') diff --git a/Timeline/Migrations/20200105150407_Initialize.cs b/Timeline/Migrations/20200105150407_Initialize.cs index 2881ee64..4e12ef83 100644 --- a/Timeline/Migrations/20200105150407_Initialize.cs +++ b/Timeline/Migrations/20200105150407_Initialize.cs @@ -13,7 +13,7 @@ namespace Timeline.Migrations { id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), - name = table.Column(maxLength: 26, nullable: false), + name = table.Column(nullable: false), password = table.Column(nullable: false), roles = table.Column(nullable: false), version = table.Column(nullable: false, defaultValue: 0L) @@ -55,7 +55,7 @@ namespace Timeline.Migrations .Annotation("Sqlite:Autoincrement", true), data = table.Column(nullable: true), type = table.Column(nullable: true), - etag = table.Column(maxLength: 30, nullable: true), + etag = table.Column(nullable: true), last_modified = table.Column(nullable: false), UserId = table.Column(nullable: false) }, @@ -76,7 +76,7 @@ namespace Timeline.Migrations { id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), - nickname = table.Column(maxLength: 26, nullable: true), + nickname = table.Column(nullable: true), UserId = table.Column(nullable: false) }, constraints: table => diff --git a/Timeline/Migrations/DatabaseContextModelSnapshot.cs b/Timeline/Migrations/DatabaseContextModelSnapshot.cs index d5f9c0e4..2c97ea79 100644 --- a/Timeline/Migrations/DatabaseContextModelSnapshot.cs +++ b/Timeline/Migrations/DatabaseContextModelSnapshot.cs @@ -140,8 +140,7 @@ namespace Timeline.Migrations b.Property("ETag") .HasColumnName("etag") - .HasColumnType("TEXT") - .HasMaxLength(30); + .HasColumnType("TEXT"); b.Property("LastModified") .HasColumnName("last_modified") @@ -172,8 +171,7 @@ namespace Timeline.Migrations b.Property("Nickname") .HasColumnName("nickname") - .HasColumnType("TEXT") - .HasMaxLength(100); + .HasColumnType("TEXT"); b.Property("Password") .IsRequired() @@ -188,8 +186,7 @@ namespace Timeline.Migrations b.Property("Username") .IsRequired() .HasColumnName("username") - .HasColumnType("TEXT") - .HasMaxLength(26); + .HasColumnType("TEXT"); b.Property("Version") .ValueGeneratedOnAdd() -- cgit v1.2.3 From 75c070eabc2c577facf5f17e59bd2ac3a80d2749 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 29 Feb 2020 00:21:08 +0800 Subject: One fogeted place is cleared. Also a note: Sqlite does not respect the length constraint on type. --- Timeline/Migrations/20200131100517_RefactorUser.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'Timeline/Migrations') diff --git a/Timeline/Migrations/20200131100517_RefactorUser.cs b/Timeline/Migrations/20200131100517_RefactorUser.cs index 533f4bc4..8597ed50 100644 --- a/Timeline/Migrations/20200131100517_RefactorUser.cs +++ b/Timeline/Migrations/20200131100517_RefactorUser.cs @@ -12,7 +12,6 @@ namespace Timeline.Migrations migrationBuilder.AddColumn( name: "nickname", table: "users", - maxLength: 100, nullable: true); migrationBuilder.Sql(@" -- cgit v1.2.3