Error while rebuilding database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manuel-kraus
    Junior Member
    • Nov 2016
    • 9

    Error while rebuilding database

    Hi,
    i have added some Entities, but now i get the following error while rebuilding.

    Code:
     
     [2017-01-31 10:31:25] Espo.ERROR: Fault to rebuild database schema. Details: Incomplete definition. 'columns' required. [] [] [2017-01-31 10:31:25] Espo.ERROR: API [POST]:/Admin/rebuild, Params:Array ( ) , InputData:  - Error while rebuilding database. See log file for details. [] [] [2017-01-31 10:31:25] Espo.ERROR: Display Error: Error while rebuilding database. See log file for details., Code: 500 URL: /api/v1/Admin/rebuild [] []
    Where in my entityDefs should i add 'columns' and what should it contain?

    I hope anyone can help me with this. Thanks
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello
    Could you attach your entityDefs?

    Comment

    • manuel-kraus
      Junior Member
      • Nov 2016
      • 9

      #3
      /application/Espo/Modules/Jobs/Resources/metadata/entityDefs/Jobs.json:
      Code:
      {
      
          "collection": {
      
            "sortBy": "createdAt",
      
            "asc": false
      
         },
      
        "fields": {
      
          "id":{
      
            "type":"varchar",
      
            "readOnly":true
      
          },
      
          "copies":{
      
            "type":"int",
      
            "readOnly":true
      
          },
      
          "description":{
      
            "type":"text"
      
          },
      
          "status":{
      
            "type":"varchar",
      
            "readOnly":true
      
          },
      
          "text":{
      
            "type":"varchar",
      
            "readOnly":true
      
          },
      
          "createdAt":{
      
            "type":"datetime",
      
            "readOnly":true
      
          },
      
          "modifiedAt":{
      
            "type":"datetime",
      
            "readOnly":true
      
          },
      
          "createdBy":{
      
            "type":"link",
      
            "readOnly":true
      
          },
      
          "modifiedBy":{
      
            "type":"link",
      
            "readOnly":true
      
          },
      
          "espressoLink": {
      
            "type":"url",
      
            "readOnly": true
      
          }
      
        },
      
        "links": {
      
          "cases": {
      
            "type": "hasMany",
      
            "relationName": "caseJobs",
      
            "foreign": "jobs",
      
            "entity": "Jobs",
      
            "isCustom": true
      
          },
      
          "createdBy":{
      
            "type":"belongsTo",
      
            "entity":"User"
      
          },
      
          "modifiedBy":{
      
            "type":"belongsTo",
      
            "entity":"User"
      
          }
      
        }
      
      }
      /custom/Espo/Resources/metadata/entityDefs/Case.json:

      Code:
      {
      
          "links": {
      
             "jobs": {
      
                  "type": "hasMany",
      
                  "relationName": "caseJobs",
      
                  "foreign": "cases",
      
                  "entity": "Jobs",
      
                  "isCustom": true
      
              }
      
          }
      
      }

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Change id definition.

        "id":{
        "readOnly":true,
        "dbType" : "varchar",
        "len": "24",
        "type": "id"

        },

        Comment

        • manuel-kraus
          Junior Member
          • Nov 2016
          • 9

          #5
          Still get the same error

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            Did you create only entity Jobs?

            Comment

            • manuel-kraus
              Junior Member
              • Nov 2016
              • 9

              #7
              Oh... I had a second custom Entity, sorry...
              I changed the ID definition of the second one, now everything works.

              Thank you very much

              Comment

              Working...