Skip to content

Commit

Permalink
Fix migration in Oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanceylan committed Oct 17, 2024
1 parent 23b5b23 commit 9150d2a
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ public override void Up()
.Alter.Table("Order Details")
.AddColumn("DetailID").AsInt32().Identity().NotNullable();

IfDatabase("oracle")
.Alter.Table("\"ORDER DETAILS\"")
.AddColumn("DetailID").AsInt32().Nullable();
IfDatabase("Oracle")
.Execute.Sql("ALTER TABLE \"ORDER DETAILS\" ADD DetailID NUMBER(10, 0) NULL");

MigrationUtils.AddOracleIdentity(this, "\"ORDER DETAILS\"", "DetailID");

IfDatabase("Oracle")
.Execute.Sql("UPDATE \"ORDER DETAILS\" SET DetailID = Order_Details_SEQ.nextval");

IfDatabase("Oracle")
.Alter.Column("DetailID").OnTable("\"ORDER DETAILS\"")
.AsInt32().NotNullable();
.Execute.Sql("ALTER TABLE \"ORDER DETAILS\" MODIFY DetailID NUMBER(10, 0) NOT NULL");
}
}

0 comments on commit 9150d2a

Please sign in to comment.