update mysql migration to add explicit length for searchable ip
This commit is contained in:
parent
e8bdde70fb
commit
6c9ac1f7bb
@ -131,6 +131,7 @@ namespace Data.Context
|
|||||||
ent.HasIndex(_alias => _alias.SearchableName);
|
ent.HasIndex(_alias => _alias.SearchableName);
|
||||||
ent.HasIndex(_alias => new {_alias.Name, _alias.IPAddress});
|
ent.HasIndex(_alias => new {_alias.Name, _alias.IPAddress});
|
||||||
ent.Property(alias => alias.SearchableIPAddress)
|
ent.Property(alias => alias.SearchableIPAddress)
|
||||||
|
.HasMaxLength(255)
|
||||||
.HasComputedColumnSql(@"((IPAddress & 255) || '.' || ((IPAddress >> 8) & 255)) || '.' || ((IPAddress >> 16) & 255) || '.' || ((IPAddress >> 24) & 255)", stored: true);
|
.HasComputedColumnSql(@"((IPAddress & 255) || '.' || ((IPAddress >> 8) & 255)) || '.' || ((IPAddress >> 16) & 255) || '.' || ((IPAddress >> 24) & 255)", stored: true);
|
||||||
ent.HasIndex(alias => alias.SearchableIPAddress);
|
ent.HasIndex(alias => alias.SearchableIPAddress);
|
||||||
});
|
});
|
||||||
|
@ -808,7 +808,8 @@ namespace Data.Migrations.MySql
|
|||||||
|
|
||||||
b.Property<string>("SearchableIPAddress")
|
b.Property<string>("SearchableIPAddress")
|
||||||
.ValueGeneratedOnAddOrUpdate()
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
.HasColumnType("longtext")
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("varchar(255)")
|
||||||
.HasComputedColumnSql("((IPAddress & 255) || '.' || ((IPAddress >> 8) & 255)) || '.' || ((IPAddress >> 16) & 255) || '.' || ((IPAddress >> 24) & 255)", true);
|
.HasComputedColumnSql("((IPAddress & 255) || '.' || ((IPAddress >> 8) & 255)) || '.' || ((IPAddress >> 16) & 255) || '.' || ((IPAddress >> 24) & 255)", true);
|
||||||
|
|
||||||
b.Property<string>("SearchableName")
|
b.Property<string>("SearchableName")
|
||||||
|
@ -11,7 +11,8 @@ namespace Data.Migrations.MySql
|
|||||||
migrationBuilder.AddColumn<string>(
|
migrationBuilder.AddColumn<string>(
|
||||||
name: "SearchableIPAddress",
|
name: "SearchableIPAddress",
|
||||||
table: "EFAlias",
|
table: "EFAlias",
|
||||||
type: "longtext",
|
type: "varchar(255)",
|
||||||
|
maxLength: 255,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
computedColumnSql: "CONCAT((IPAddress & 255), \".\", ((IPAddress >> 8) & 255), \".\", ((IPAddress >> 16) & 255), \".\", ((IPAddress >> 24) & 255))",
|
computedColumnSql: "CONCAT((IPAddress & 255), \".\", ((IPAddress >> 8) & 255), \".\", ((IPAddress >> 16) & 255), \".\", ((IPAddress >> 24) & 255))",
|
||||||
stored: true)
|
stored: true)
|
||||||
|
@ -808,6 +808,7 @@ namespace Data.Migrations.MySql
|
|||||||
|
|
||||||
b.Property<string>("SearchableIPAddress")
|
b.Property<string>("SearchableIPAddress")
|
||||||
.ValueGeneratedOnAddOrUpdate()
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasMaxLength(255)
|
||||||
.HasColumnType("varchar(255)")
|
.HasColumnType("varchar(255)")
|
||||||
.HasComputedColumnSql("((IPAddress & 255) || '.' || ((IPAddress >> 8) & 255)) || '.' || ((IPAddress >> 16) & 255) || '.' || ((IPAddress >> 24) & 255)", true);
|
.HasComputedColumnSql("((IPAddress & 255) || '.' || ((IPAddress >> 8) & 255)) || '.' || ((IPAddress >> 16) & 255) || '.' || ((IPAddress >> 24) & 255)", true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user