Skip to content

Commit 7cf998c

Browse files
committed
Add some fixes for migration
1 parent e895778 commit 7cf998c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/EfCore.Ydb/src/Migrations/Internal/YdbHistoryRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private IReadOnlyList<MigrationCommand> SelectHistoryTableCommand() =>
180180
new SqlOperation
181181
{
182182
Sql = $"SELECT * FROM {SqlGenerationHelper.DelimitIdentifier(TableName, TableSchema)}" +
183-
$" WHERE MigrationId = '{LockKey}';"
183+
$" WHERE '{MigrationIdColumnName}' = '{LockKey}';"
184184
}
185185
});
186186

src/EfCore.Ydb/src/Migrations/YdbMigrationsSqlGenerator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@ protected override void Generate(
357357
// Ignore bc YDB doesn't have foreign keys
358358
}
359359

360+
protected override void Generate(EnsureSchemaOperation operation, IModel? model,
361+
MigrationCommandListBuilder builder)
362+
{
363+
// Ignore bc YDB doesn't support schema
364+
}
365+
360366
protected override void Generate(
361367
AddPrimaryKeyOperation operation,
362368
IModel? model,
@@ -400,4 +406,6 @@ private void EndStatementSuppressTransaction(MigrationCommandListBuilder builder
400406

401407
private string DelimitIdentifier(string name, string? schema = null)
402408
=> Dependencies.SqlGenerationHelper.DelimitIdentifier(name, schema);
409+
410+
403411
}

0 commit comments

Comments
 (0)