From adcee56ce828dd941ef694ed8d1f623dfdc277c6 Mon Sep 17 00:00:00 2001 From: alireza Date: Tue, 9 Jun 2026 02:45:46 +0330 Subject: [PATCH] fix: update migration timestamp and correct city IDs in data seeder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update EF Core migration history timestamp from 20260608225159 to 20260608225845 - Fix CityId values in Complex seed data to use new composite format (provinceId*100+cityId) - Tehran: 1 → 801 (provinceId=8, cityId=1) - Isfahan: 3 → 401 (provinceId=4, cityId=1) --- Complex.EndPoint/Program.cs | 4 ++-- Complex.Infrastructure/DataSeeder.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Complex.EndPoint/Program.cs b/Complex.EndPoint/Program.cs index 43d430b..b0abe5a 100644 --- a/Complex.EndPoint/Program.cs +++ b/Complex.EndPoint/Program.cs @@ -200,8 +200,8 @@ using (var scope = app.Services.CreateScope()) "BEGIN " + "CREATE TABLE [__EFMigrationsHistory] ([MigrationId] nvarchar(150) NOT NULL, [ProductVersion] nvarchar(32) NOT NULL, PRIMARY KEY ([MigrationId])); " + "END " + - "IF NOT EXISTS (SELECT * FROM __EFMigrationsHistory WHERE MigrationId = '20260608225159_InitialCreate') " + - "INSERT INTO __EFMigrationsHistory (MigrationId, ProductVersion) VALUES ('20260608225159_InitialCreate', '6.0.3')"); + "IF NOT EXISTS (SELECT * FROM __EFMigrationsHistory WHERE MigrationId = '20260608225845_InitialCreate') " + + "INSERT INTO __EFMigrationsHistory (MigrationId, ProductVersion) VALUES ('20260608225845_InitialCreate', '6.0.3')"); } } catch diff --git a/Complex.Infrastructure/DataSeeder.cs b/Complex.Infrastructure/DataSeeder.cs index 51c0c56..feb96fe 100644 --- a/Complex.Infrastructure/DataSeeder.cs +++ b/Complex.Infrastructure/DataSeeder.cs @@ -98,7 +98,7 @@ namespace Complex.Infrastructure Id = complexId1, Title = "مجتمع بهاران", Address = "تهران، خیابان ولیعصر، نبش کوچه بهار", - CityId = 1, // Tehran + CityId = 801, // Tehran (provinceId=8, cityId=8*100+1) AreaMeter = 2000, YardMeter = 500, ElevatorCount = 2, @@ -111,7 +111,7 @@ namespace Complex.Infrastructure Id = complexId2, Title = "مجتمع ساحل", Address = "اصفهان، خیابان چهارباغ، روبروی پارک ساحل", - CityId = 3, // Isfahan + CityId = 401, // Isfahan (provinceId=4, cityId=4*100+1) AreaMeter = 1500, YardMeter = 300, ElevatorCount = 1,