Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/BaGetter.Database.MySql/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ This project contains BaGetter's MySQL database provider.

## Migrations

Check for pending changes with:
```
dotnet ef migrations has-pending-model-changes --context MySqlContext --startup-project ..\BaGetter\BaGetter.csproj
```

Add a migration with:

```
dotnet ef migrations add MigrationName --context MySqlContext --output-dir Migrations --startup-project ..\BaGet\BaGetter.csproj
dotnet ef migrations add MigrationName --context MySqlContext --output-dir Migrations --startup-project ..\BaGetter\BaGetter.csproj
```

Apply the migration to your database with:

```
dotnet ef database update --context MySqlContext
```

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BaGetter.Database.PostgreSql.Migrations
{
/// <inheritdoc />
public partial class ChangeDateTimeColumnForPackage : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "Published",
table: "Packages",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "Published",
table: "Packages",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
}
}
}
Loading
Loading