Git Product home page Git Product logo

Comments (5)

karuakun avatar karuakun commented on September 24, 2024

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.

karuakun avatar karuakun commented on September 24, 2024

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.

#1895

from pomelo.entityframeworkcore.mysql.

Todilo avatar Todilo commented on September 24, 2024

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.

karuakun avatar karuakun commented on September 24, 2024

@Todilo

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.

    1. upgrade to Pomello 8.0.2
    1. create a new empty migration (this will add unnecessary migration scripts for the Id column and update the current snapshot)
    1. 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.
    1. update the database locally just to be sure and verify that no DDLs of any kind are issued.

from pomelo.entityframeworkcore.mysql.

Todilo avatar Todilo commented on September 24, 2024

@Todilo

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.

    1. upgrade to Pomello 8.0.2
    1. create a new empty migration (this will add unnecessary migration scripts for the Id column and update the current snapshot)
    1. 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.
    1. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.