-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
MSSQL Issue #82
Comments
Can u share the migrations file? |
Sorry for the late response. I just set up a fresh adonis project and used the The |
Running following sql query manually works fine by the way:
Is knex generating a wrong query? |
I did some digging and it looks like this "behavior is by design" in MSSQL (Source). The error is caused by the Using an alias for the If you change the query in Migrate._getMigratedFiles = function () {
return this.database.select('name as name_column').from(this.migrationsTable).orderBy('name_column').pluck('name')
} The I've tried this with mysql & sqlite and it seems to work fine there as well. I'm note sure if this has any other implications, but this might be the simple fix. |
Thanks for finding that out. I will add |
it doesn't work for now |
Are you trying it from Github? A release is yet to go on npm |
yes, I have tried from github. I have fixing code by
It's working |
i can confirm that the problem is that your [ as name ] fix in commit: fix(migrations): select column as {name} is not working. The as name has to be something diffrent than name ;-) otherwise it is the same problem as before. BR, |
MSSQL throws exception when unambiguous is paased to order by clause ref https://connect.microsoft.com/SQLServer/feedback/details/644134/order-by-clause-incorrectly-produces-ambiguous-column-name Closes #82
The change actually broke the regression for Oracle { method: 'pluck', options: {}, timeout: false, cancelOnTimeout: false, bindings: [], __knexQueryUid: '54b49e9c-7924-44ca-9dd8-1a614b2e709d', sql: 'select "name" "name", "name" from "adonis_schema" order by "name" asc', pluck: 'name' } Error: select "name" "name", "name" from "adonis_schema" order by "name" asc - ORA-00960: ambiguous column naming in select list use as aname and order aname does fix it |
I'm trying to run migrations on an Azure SQL database using the "mssql" client.
I've managed to correctly set up config to connect to the database but am getting following error when running
./ace migration:run
RequestError: select [name], [name] from [adonis_schema] order by [name] asc - Ambiguous column name 'name'.
The text was updated successfully, but these errors were encountered: