Announcement

Collapse
No announcement yet.

Error while rebuilding database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Hello
    Could you attach your entityDefs?

    Comment


    • #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


      • #4
        Change id definition.

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

        },

        Comment


        • #5
          Still get the same error

          Comment


          • #6
            Did you create only entity Jobs?

            Comment


            • #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...
              X