Skip to content

Commit

Permalink
VCST-1090: The description field is reset in Addresses blade (#422)
Browse files Browse the repository at this point in the history
fix: The description field is reset in Addresses blade
  • Loading branch information
OlegoO authored Jun 10, 2024
1 parent ed226ac commit a1085f6
Show file tree
Hide file tree
Showing 14 changed files with 6,247 additions and 45 deletions.

Large diffs are not rendered by default.

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

#nullable disable

namespace VirtoCommerce.OrdersModule.Data.MySql.Migrations
{
/// <inheritdoc />
public partial class AddressDescription : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Description",
table: "OrderAddress",
type: "varchar(128)",
maxLength: 128,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Description",
table: "OrderAddress");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("CustomerOrderId")
.HasColumnType("varchar(128)");

b.Property<string>("Description")
.HasMaxLength(128)
.HasColumnType("varchar(128)");

b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
Expand Down
29 changes: 12 additions & 17 deletions src/VirtoCommerce.OrdersModule.Data.MySql/Readme.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# Generate Migrations

## Package manager
Add-Migration Initial -Context VirtoCommerce.OrdersModule.Data.Repositories.OrderDbContext -Verbose -OutputDir Migrations -Project VirtoCommerce.OrdersModule.Data.MySql -StartupProject VirtoCommerce.OrdersModule.Data.MySql -Debug



### Entity Framework Core Commands
```
dotnet tool install --global dotnet-ef --version 6.*
## Install CLI tools for Entity Framework Core
```cmd
dotnet tool install --global dotnet-ef --version 8.0.0
```

**Generate Migrations**
or update

```cmd
dotnet tool update --global dotnet-ef --version 8.0.0
```
dotnet ef migrations add Initial
dotnet ef migrations add Update1
dotnet ef migrations add Update2
```

etc..

**Apply Migrations**
## Add Migration
Select Data.<Provider> folder and run following command for each provider:

`dotnet ef database update`
```cmd
dotnet ef migrations add <migration-name>
```
Loading

0 comments on commit a1085f6

Please sign in to comment.