Giter VIP home page Giter VIP logo

Comments (9)

gvkries avatar gvkries commented on July 17, 2024 1

All public types were previously added to the main feature as well, even if they were not in DI or had no attribute. So to keep it compatible, this feature assignment was kept. But I haven't thought enough about the migrations.

from orchardcore.

hyzx86 avatar hyzx86 commented on July 17, 2024

It looks like we should keep the FeatureAttribute on the migration type of the submodule

image

from orchardcore.

Piedone avatar Piedone commented on July 17, 2024

How is this different to #16223?

from orchardcore.

gvkries avatar gvkries commented on July 17, 2024

Do you have an easy way to reproduce the issue?

from orchardcore.

gvkries avatar gvkries commented on July 17, 2024

The problem is that the migration manager is not allowing a migration to have more than one feature. But after removing the FeatureAttribute from migrations, they will always be assigned to the main feature of their parent module and afterwards to the more specific feature via DI. So they will have two features if more than one migration is contained in a assembly.

There are two solutions possible:

  1. The data migration manager can always just use the last feature for a migration. This will always be the right feature as long as migrations are added to a single startup only. But this will not be obvious for anyone looking at the migration manager and may break if we change something in future.
  2. We can introduce a way to force types to be assigned to a single feature only.

I tend to suggest the second option.

from orchardcore.

hyzx86 avatar hyzx86 commented on July 17, 2024

Just like this ?

public class MyMigration :DataMigration<MyFeatureStartup>

It has the advantage of introducing strong type-checking and not needing to log those strings anymore~

from orchardcore.

gvkries avatar gvkries commented on July 17, 2024

That would be the same as applying the FeatureAttribute like before. We wanted to avoid having to do that manually each time. I think we can add something to the base interface IDataMigration.

from orchardcore.

github-actions avatar github-actions commented on July 17, 2024

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

from orchardcore.

Piedone avatar Piedone commented on July 17, 2024

But after removing the FeatureAttribute from migrations, they will always be assigned to the main feature of their parent module and afterwards to the more specific feature via DI.

Why is that the case? Shouldn't just the second happen?

from orchardcore.

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.