Open Closed

Unable to change data type after code generation run in ABP Studio #9862


User avatar
0
jgray@cpxzgroup.com created
  • Am trying to change the data type on column for table that was create using ABP Studio when I try to change the table the old column name keeps coming back in VS code after the code generate and error in the complier. Is there way to purge it so we can add the new data type? Am changing from Date Time to Enum

1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • When you change a property type (e.g., from DateTime to Enum) in an entity generated by ABP Suite, the old property may persist or reappear after code regeneration if you do not fully remove or update all related code and migration files.

    • To resolve this and ensure the new data type is applied:

      1. Delete the old property from the entity in ABP Suite before adding the new enum property.
      2. Remove any existing migration files related to the entity (in the Migrations folder).
      3. Clean and rebuild your solution in Visual Studio/VS Code.
      4. Re-add the property with the new type (enum) in ABP Suite.
      5. Regenerate the code using ABP Suite.
      6. Add a new migration and update the database:
    dotnet ef migrations add UpdatedProcessStatusType
         dotnet ef database update
    
    1. Ensure that the database schema is updated and the old column type is replaced.
    • If you skip removing old migrations or do not clean the solution, the old property/type may persist and cause compiler or runtime errors.

    Sources:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 08, 2025, 09:55