ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 6 replies, has 2 voices, and was last updated by  archy_bold 1 year, 4 months ago.

  • Creator
    Topic
  • #17664

    archy_bold
    Participant

    Hi there.

    I’m trying to create a custom activity entity in code but I’m having some trouble. I’ve followed the instructions on this page and created my entity, which extends an ExtendEntity, which in turn implements the ActivityInterface. I’ve also set up a migration to create the table.

    I then run the following commands to run the migrations and update the schema/cache:

    But looking in the oro_entity_config table, I can’t see my new entity. I’ve added several custom entities and it has always worked doing things this way.

    I then tried to add the associations to my own custom entities with ActivityExtension migration tool regardless. Obviously it failed to run and had the following error:

    Which I guess is because the entity isn’t present in the database. Am I missing something here? I’m a little worried even if I get this working, that it might have trouble ensuring the migrations run at the correct time when deploying the bundle.

    Thanks for your help.

    Simon

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #17674

    Vova Soroka
    Oro Core

    Hi @archy_bold,

    please try to run

    this will run migrations and renew all caches.

    #17685

    archy_bold
    Participant

    Thanks, but I still get the same error. And the entity doesn’t show up in the database either.

    #17744

    archy_bold
    Participant

    Is the error because I’ve manually written my migrations? Should I be letting oro:platform:update handle the table creation?

    #17762

    archy_bold
    Participant

    Here’s the code, if that will help:

    Entity/UserActivity.php

    Model/ExtendUserActivity.php

    Migration 1

    Migration 2

    #17766

    archy_bold
    Participant

    I’ve run the following command to see if my new entity is being recognised and I don’t see it in the list at all. Despite it containing all my other custom entities. There must be something wrong with the entity itself.

    #17791

    archy_bold
    Participant

    Ok, I’m an idiot. My entity didn’t have the Entity annotation…

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.