Skip to content
Open
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
28 changes: 11 additions & 17 deletions src/VirtoCommerce.CartModule.Data.MySql/Readme.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
# Generate Migrations

## Package manager
Add-Migration Initial -Context VirtoCommerce.CartModule.Data.Repositories.CartDbContext -Verbose -OutputDir Migrations -Project VirtoCommerce.CartModule.Data.MySql -StartupProject VirtoCommerce.CartModule.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.11
```

**Generate Migrations**
or update

```cmd
dotnet tool update --global dotnet-ef --version 8.0.11
```
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>
28 changes: 11 additions & 17 deletions src/VirtoCommerce.CartModule.Data.PostgreSql/Readme.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
# Generate Migrations

## Package manager
Add-Migration Initial -Context VirtoCommerce.CartModule.Data.Repositories.CartDbContext -Verbose -OutputDir Migrations -Project VirtoCommerce.CartModule.Data.PostgreSql -StartupProject VirtoCommerce.CartModule.Data.PostgreSql -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.11
```

**Generate Migrations**
or update

```cmd
dotnet tool update --global dotnet-ef --version 8.0.11
```
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>
29 changes: 11 additions & 18 deletions src/VirtoCommerce.CartModule.Data.SqlServer/Readme.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
# Generate Migrations

## Package manager
Add-Migration Initial -Context VirtoCommerce.CartModule.Data.Repositories.CartDbContext -Verbose -OutputDir Migrations -Project VirtoCommerce.CartModule.Data.SqlServer -StartupProject VirtoCommerce.CartModule.Data.SqlServer -Debug



### Entity Framework Core Commands
## Install CLI tools for Entity Framework Core
```cmd
dotnet tool install --global dotnet-ef --version 8.0.11
```

dotnet tool install --global dotnet-ef --version 6.*
```
or update

**Generate Migrations**

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

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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using VirtoCommerce.CartModule.Data.Model;

namespace VirtoCommerce.CartModule.Data.SqlServer;

public class ShoppingCartEntityConfiguration : IEntityTypeConfiguration<ShoppingCartEntity>
{
public void Configure(EntityTypeBuilder<ShoppingCartEntity> builder)
{
builder.ToTable(tb => tb.UseSqlOutputClause(false));
}
}

public class LineItemEntityConfiguration : IEntityTypeConfiguration<LineItemEntity>
{
public void Configure(EntityTypeBuilder<LineItemEntity> builder)
{
builder.ToTable(tb => tb.UseSqlOutputClause(false));
}
}
Loading