13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.AddColumn<DateTimeOffset>(
19 table:
"RevisionInformations",
21 defaultValue:
new DateTimeOffset(
new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
new TimeSpan(0, 0, 0, 0, 0)));
25 protected override void Down(MigrationBuilder migrationBuilder)
27 ArgumentNullException.ThrowIfNull(migrationBuilder);
29 migrationBuilder.RenameTable(
30 name:
"RevisionInformations",
31 newName:
"RevisionInformations_down");
33 migrationBuilder.CreateTable(
34 name:
"RevisionInformations",
37 Id = table.Column<
long>(nullable:
false)
38 .Annotation(
"Sqlite:Autoincrement",
true),
39 CommitSha = table.Column<
string>(maxLength: 40, nullable:
false),
40 OriginCommitSha = table.Column<
string>(maxLength: 40, nullable:
false),
41 InstanceId = table.Column<
long>(nullable:
false),
45 table.PrimaryKey(
"PK_RevisionInformations", x => x.Id);
47 name:
"FK_RevisionInformations_Instances_InstanceId",
48 column: x => x.InstanceId,
49 principalTable:
"Instances",
50 principalColumn:
"Id",
51 onDelete: ReferentialAction.Cascade);
54 migrationBuilder.Sql(
"INSERT INTO RevisionInformations (Id, CommitSha, OriginCommitSha, InstanceId) SELECT Id, CommitSha, OriginCommitSha, InstanceId FROM RevisionInformations_down");
56 migrationBuilder.DropTable(
57 name:
"RevisionInformations_down");
59 migrationBuilder.RenameTable(
60 name:
"RevisionInformations",
61 newName:
"RevisionInformations_down");
63 migrationBuilder.RenameTable(
64 name:
"RevisionInformations_down",
65 newName:
"RevisionInformations");