The column 'account_id' on table 'account_account' already exists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nsns
    Junior Member
    • Jun 2019
    • 25

    The column 'account_id' on table 'account_account' already exists

    When i try to rebuild i get the error

    Error 500: Error while rebuilding database. See log file for details.

    In logs i see
    [2025-02-20 10:41:28] Espo.ERROR: Fault to rebuild database schema. Details: The column 'account_id' on table 'account_account' already exists. [] []
    [2025-02-20 10:41:28] Espo.ERROR: API [POST]:/Admin/rebuild, Params:Array ( ) , InputData: - Error while rebuilding database. See log file for details. [] []
    [2025-02-20 10:41:28] Espo.ERROR: Display Error: Error while rebuilding database. See log file for details., Code: 500 URL: /cal/api/v1/Admin/rebuild [] []​

    How can i resolve this?
  • victor
    Active Community Member
    • Aug 2022
    • 847

    #2
    Try make a Hard Rebuild: https://docs.espocrm.com/administrat.../#hard-rebuild.

    Comment

    • nsns
      Junior Member
      • Jun 2019
      • 25

      #3
      I can't make a hard rebuild. I am in a previous version.

      Comment

      • victor
        Active Community Member
        • Aug 2022
        • 847

        #4
        A similar topic was discussed here: https://forum.espocrm.com/forum/bug-...already-exists.

        In your case, it seems that you mistakenly created a Many-to-Many relationship between Account and Account. Then you deleted this Relationship, but the account_account table was not deleted from the database and you still have some data in it.

        You can wait for a response from someone more experienced, or try to make a backup: https://docs.espocrm.com/administrat...p-and-restore/, and then manually delete the account_account table via phpMyAdmin or its analogue from your database.
        If that doesn't help, you can always restore the data.

        Comment

        • nsns
          Junior Member
          • Jun 2019
          • 25

          #5
          Thanks for your response.
          There is no table account_account as you can see in the attachment.
          Attached Files

          Comment

          • victor
            Active Community Member
            • Aug 2022
            • 847

            #6
            In this case, try to find the extra field and link in custom/Espo/Custom/Resources/metadata/entityDefs/Account.json yourself. Or you can archive this file and add it as an attachment in the next post.

            Comment

            Working...