1
0

20240409014937_FixRoundStartDateNullability2.cs 828 B

12345678910111213141516171819202122232425
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Content.Server.Database.Migrations.Sqlite
  4. {
  5. /// <inheritdoc />
  6. public partial class FixRoundStartDateNullability2 : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. // This needs to be its own separate migration,
  12. // because EF Core re-arranges the order of the commands if it's a single migration...
  13. // (only relevant for SQLite since it needs cursed shit to do ALTER COLUMN)
  14. migrationBuilder.Sql("UPDATE round SET start_date = NULL WHERE start_date = '0001-01-01 00:00:00';");
  15. }
  16. /// <inheritdoc />
  17. protected override void Down(MigrationBuilder migrationBuilder)
  18. {
  19. }
  20. }
  21. }