diff options
author | crupest <crupest@outlook.com> | 2020-02-29 00:14:05 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-02-29 00:14:05 +0800 |
commit | 00955e765a7c847e47658044d84e58309d373bf5 (patch) | |
tree | 8e0c2f151948951c9aac633a9a6eefe2a236953e /Timeline | |
parent | 6bf12fb184ee87ba28293ecc576915cbbeab0cf0 (diff) | |
download | timeline-00955e765a7c847e47658044d84e58309d373bf5.tar.gz timeline-00955e765a7c847e47658044d84e58309d373bf5.tar.bz2 timeline-00955e765a7c847e47658044d84e58309d373bf5.zip |
Remove the length constraint in entity as entity framework core does not use them as well.
Diffstat (limited to 'Timeline')
-rw-r--r-- | Timeline/Entities/UserAvatarEntity.cs | 2 | ||||
-rw-r--r-- | Timeline/Entities/UserEntity.cs | 4 | ||||
-rw-r--r-- | Timeline/Migrations/20200105150407_Initialize.cs | 6 | ||||
-rw-r--r-- | Timeline/Migrations/DatabaseContextModelSnapshot.cs | 9 |
4 files changed, 9 insertions, 12 deletions
diff --git a/Timeline/Entities/UserAvatarEntity.cs b/Timeline/Entities/UserAvatarEntity.cs index 6cecce1a..be094a77 100644 --- a/Timeline/Entities/UserAvatarEntity.cs +++ b/Timeline/Entities/UserAvatarEntity.cs @@ -17,7 +17,7 @@ namespace Timeline.Entities [Column("type")]
public string? Type { get; set; }
- [Column("etag"), MaxLength(30)]
+ [Column("etag")]
public string? ETag { get; set; }
[Column("last_modified"), Required]
diff --git a/Timeline/Entities/UserEntity.cs b/Timeline/Entities/UserEntity.cs index 946c3fa2..1ef3f98c 100644 --- a/Timeline/Entities/UserEntity.cs +++ b/Timeline/Entities/UserEntity.cs @@ -17,7 +17,7 @@ namespace Timeline.Entities [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
- [Column("username"), MaxLength(26), Required]
+ [Column("username"), Required]
public string Username { get; set; } = default!;
[Column("password"), Required]
@@ -29,7 +29,7 @@ namespace Timeline.Entities [Column("version"), Required]
public long Version { get; set; }
- [Column("nickname"), MaxLength(100)]
+ [Column("nickname")]
public string? Nickname { get; set; }
public UserAvatarEntity? Avatar { get; set; }
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<long>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
- name = table.Column<string>(maxLength: 26, nullable: false),
+ name = table.Column<string>(nullable: false),
password = table.Column<string>(nullable: false),
roles = table.Column<string>(nullable: false),
version = table.Column<long>(nullable: false, defaultValue: 0L)
@@ -55,7 +55,7 @@ namespace Timeline.Migrations .Annotation("Sqlite:Autoincrement", true),
data = table.Column<byte[]>(nullable: true),
type = table.Column<string>(nullable: true),
- etag = table.Column<string>(maxLength: 30, nullable: true),
+ etag = table.Column<string>(nullable: true),
last_modified = table.Column<DateTime>(nullable: false),
UserId = table.Column<long>(nullable: false)
},
@@ -76,7 +76,7 @@ namespace Timeline.Migrations {
id = table.Column<long>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
- nickname = table.Column<string>(maxLength: 26, nullable: true),
+ nickname = table.Column<string>(nullable: true),
UserId = table.Column<long>(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<string>("ETag")
.HasColumnName("etag")
- .HasColumnType("TEXT")
- .HasMaxLength(30);
+ .HasColumnType("TEXT");
b.Property<DateTime>("LastModified")
.HasColumnName("last_modified")
@@ -172,8 +171,7 @@ namespace Timeline.Migrations b.Property<string>("Nickname")
.HasColumnName("nickname")
- .HasColumnType("TEXT")
- .HasMaxLength(100);
+ .HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
@@ -188,8 +186,7 @@ namespace Timeline.Migrations b.Property<string>("Username")
.IsRequired()
.HasColumnName("username")
- .HasColumnType("TEXT")
- .HasMaxLength(26);
+ .HasColumnType("TEXT");
b.Property<long>("Version")
.ValueGeneratedOnAdd()
|