-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoupdate error: index or statistics already exists on table #180
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
I have the same problem. @Narrator Could you solve it? my model definition: {
"name": "OIDCModel",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"name": {
"type": "string",
"required": true
},
"key": {
"type": "string",
"required": true
},
"value": {
"type": "string",
"required": true,
"mssql": {
"dataType": "text"
}
},
"grantId": {
"type": "string"
},
"expiresAt": {
"type": "date",
"required": true
},
"consumed": {
"type": "boolean",
"default": false
}
},
"indexes": {
"name_key": {
"columns": "name,key"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
} |
I have the same issue? How you solved? |
This is due to a bug in migration.js where it uses async.each instead of async.eachSeries. async.each has no order, so the index create was happening before the drop. I've created this PR to fix the issue: |
I get the following message whenever I run autoupdate:
"error":{"message":"The operation failed because an index or statistics with name 'principalId_NONCLUSTERED_ASC_idx' already exists on table 'dbo.RoleMapping'.","stack":"RequestError: The operation failed because an index or statistics with name 'principalId_NONCLUSTERED_ASC_idx' already exists on table 'dbo.RoleMapping'
The table name doesn't matter, cause the error is thrown on different tables every time. The first run is fine, but whenever I kill the app and restart it, this error is thrown.
Here's the code I'm using in
boot/auto-update.js
The text was updated successfully, but these errors were encountered: