Comments (5)
The snapshot has the following differences
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace WebApi.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
- .HasAnnotation("ProductVersion", "7.0.18")
+ .HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
modelBuilder.Entity("Blog", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
+
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.HasKey("Id");
b.ToTable("Blogs");
});
#pragma warning restore 612, 618
}
}
}
from pomelo.entityframeworkcore.mysql.
I'm sorry. It was a duplicate, so I'll Close it.
Only snapshots are updated.
This is handled by deleting the contents of the migration script.
from pomelo.entityframeworkcore.mysql.
I am sorry but what exactly was the solution? What rows did you delete, the
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
?
And then the altercolumns ?
I am having the same issue and I have made 0 code change except migrating to new version of dotnet.
from pomelo.entityframeworkcore.mysql.
The following procedure was used to update the software.
This work assumes that there are no changes involving intentional migration to Entity before and after the Pomello version upgrade; do not include any work other than the Pomello version upgrade.
-
- upgrade to Pomello 8.0.2
-
- create a new empty migration (this will add unnecessary migration scripts for the Id column and update the current snapshot)
-
- delete all of Up and Down, since Entity does not contain any intentional migrations and the migration scripts added in 2 are not needed. Leave the Snapshot as it is important.
-
- update the database locally just to be sure and verify that no DDLs of any kind are issued.
from pomelo.entityframeworkcore.mysql.
The following procedure was used to update the software.
This work assumes that there are no changes involving intentional migration to Entity before and after the Pomello version upgrade; do not include any work other than the Pomello version upgrade.
- upgrade to Pomello 8.0.2
- create a new empty migration (this will add unnecessary migration scripts for the Id column and update the current snapshot)
- delete all of Up and Down, since Entity does not contain any intentional migrations and the migration scripts added in 2 are not needed. Leave the Snapshot as it is important.
- update the database locally just to be sure and verify that no DDLs of any kind are issued.
Thank you @karuakun ! Works great!
from pomelo.entityframeworkcore.mysql.
Related Issues (20)
- DbContext.Database.Migrate() change guid charset and Collation
- ExecuteDeleteAsync in combination with Take throws InvalidOperationException
- Custom value conversion fails for byte[] property to GEOMETRY SQL column. HOT 1
- Query for List<string> property could not be translated
- Insertion failed after upgrading .net 6 to .net8
- When use `Min Pool Size = 10` app hangs due to connection timeout HOT 1
- MySQL 8.4.0 error prompt Plugin' mysqlnotative_password 'is not loaded HOT 2
- Wrong output from ToQueryString
- scaffold MariaDB with MDEV-32500 HOT 1
- Schema Not Included in Generated SQL for ToTable Mapping
- when database service is busy, it is possible to appear "SSL Authentication ErrorAuthentication failed,",how to solve? HOT 1
- Using DateTimeOffset.Now in ExecuteUpdateAsync doesn't take column precision into account
- EF Core 8 scaffolds BIT(1) columns with default value as nullable bool
- Integer division (DIV) not supported
- "Contains()" not generating correct SQL
- Upgrade from .NET6 to .NET8 throws exception during migration
- Upgrade System.Text.Json to 8.0.4
- The message "An exception occurred while iterating over the results of a query for context type 'X'." can not be caught
- CompiledModels fail to compile with JSON columns in 8.0.2 w/ EF Core 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pomelo.entityframeworkcore.mysql.