Skip to content

Commit 02f4c56

Browse files
committed
DropSequence operation
1 parent 9bbf466 commit 02f4c56

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Provider/src/FirebirdSql.EntityFrameworkCore.Firebird.Tests/Migrations/MigrationsTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,18 @@ public void RestartSequence()
457457
Assert.AreEqual(NewLineEnd(@"ALTER SEQUENCE ""MySequence"" START WITH 23;"), batch[0].CommandText);
458458
}
459459

460+
[Test]
461+
public void DropSequence()
462+
{
463+
var operation = new DropSequenceOperation()
464+
{
465+
Name = "MySequence",
466+
};
467+
var batch = Generate(new[] { operation });
468+
Assert.AreEqual(1, batch.Count());
469+
Assert.AreEqual(NewLineEnd(@"DROP SEQUENCE ""MySequence"";"), batch[0].CommandText);
470+
}
471+
460472
[Test]
461473
public void AddPrimaryKey()
462474
{

Provider/src/FirebirdSql.EntityFrameworkCore.Firebird/Migrations/FbMigrationsSqlGenerator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ protected override void Generate(RestartSequenceOperation operation, IModel mode
225225
protected override void Generate(RenameSequenceOperation operation, IModel model, MigrationCommandListBuilder builder)
226226
=> throw new NotSupportedException("Renaming sequence is not supported by Firebird.");
227227

228+
protected override void Generate(DropSequenceOperation operation, IModel model, MigrationCommandListBuilder builder)
229+
=> base.Generate(operation, model, builder);
228230

229231
protected override void Generate(AddPrimaryKeyOperation operation, IModel model, MigrationCommandListBuilder builder)
230232
=> base.Generate(operation, model, builder);

0 commit comments

Comments
 (0)