🐛 Refactor to fix GeoIP
This commit is contained in:
2027
DysonNetwork.Pass/Migrations/20250907065433_RefactorGeoIpPoint.Designer.cs
generated
Normal file
2027
DysonNetwork.Pass/Migrations/20250907065433_RefactorGeoIpPoint.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
using DysonNetwork.Shared.GeoIp;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using NetTopologySuite.Geometries;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DysonNetwork.Pass.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RefactorGeoIpPoint : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("UPDATE auth_challenges SET location = NULL;");
|
||||
migrationBuilder.Sql("UPDATE action_logs SET location = NULL;");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "location",
|
||||
table: "auth_challenges");
|
||||
|
||||
migrationBuilder.AddColumn<GeoPoint>(
|
||||
name: "location",
|
||||
table: "auth_challenges",
|
||||
type: "jsonb",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "location",
|
||||
table: "action_logs");
|
||||
|
||||
migrationBuilder.AddColumn<GeoPoint>(
|
||||
name: "location",
|
||||
table: "action_logs",
|
||||
type: "jsonb",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "location",
|
||||
table: "auth_challenges");
|
||||
|
||||
migrationBuilder.AddColumn<Point>(
|
||||
name: "location",
|
||||
table: "auth_challenges",
|
||||
type: "geometry",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "location",
|
||||
table: "action_logs");
|
||||
|
||||
migrationBuilder.AddColumn<Point>(
|
||||
name: "location",
|
||||
table: "action_logs",
|
||||
type: "geometry",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ using DysonNetwork.Pass;
|
||||
using DysonNetwork.Pass.Account;
|
||||
using DysonNetwork.Pass.Wallet;
|
||||
using DysonNetwork.Shared.Data;
|
||||
using DysonNetwork.Shared.GeoIp;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using NetTopologySuite.Geometries;
|
||||
using NodaTime;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
@@ -525,8 +525,8 @@ namespace DysonNetwork.Pass.Migrations
|
||||
.HasColumnType("character varying(128)")
|
||||
.HasColumnName("ip_address");
|
||||
|
||||
b.Property<Point>("Location")
|
||||
.HasColumnType("geometry")
|
||||
b.Property<GeoPoint>("Location")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("location");
|
||||
|
||||
b.Property<Dictionary<string, object>>("Meta")
|
||||
@@ -901,8 +901,8 @@ namespace DysonNetwork.Pass.Migrations
|
||||
.HasColumnType("character varying(128)")
|
||||
.HasColumnName("ip_address");
|
||||
|
||||
b.Property<Point>("Location")
|
||||
.HasColumnType("geometry")
|
||||
b.Property<GeoPoint>("Location")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("location");
|
||||
|
||||
b.Property<string>("Nonce")
|
||||
|
||||
Reference in New Issue
Block a user