Skip to content
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

Pyodbc-azure unique key error #140

Closed
PS-CR7 opened this issue Feb 12, 2020 · 13 comments
Closed

Pyodbc-azure unique key error #140

PS-CR7 opened this issue Feb 12, 2020 · 13 comments

Comments

@PS-CR7
Copy link

PS-CR7 commented Feb 12, 2020

Hi, I am facing the same issue as #45. Whenever i am trying to add new ticket, I am getting error ,Violation of UNIQUE KEY constraint 'UQ__river_tr_6fe987667dhdjsj008'. Cannot insert duplicate key in object 'dbo.river.transitionapproval'. The duplicate key value is (). I am using River 3.0.0,Pyodbc-azure 2.1.0.0.
Whats the solution for this??

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 12, 2020

For transactioner_id, it is taking value as None instead of auth_user.id
Also, for transaction_date , it is taking None. I feel that is the cause of error. Can you also, point out ,location of code where when I add data in my model, transitionapproval table population triggers.

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 12, 2020

So, i edited the columns it was giving error on from table. Now , i am getting new error, Incorrect syntax near 'cte'. Incorrect syntax near ','. What is the meaning of this? And how to resolve this?

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 13, 2020

Where can I find the code description for get_available_approvals method? It seems it is not able to get object from transitionapproval table for the user.

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 14, 2020

One more error i got with cte was, SQL Server Error, “Invalid usage of the option FIRST in the FETCH statement.Incorrect syntax near 'cte'. Incorrect syntax near ','. "

@javrasya
Copy link
Owner

Hi,
@PS-CR7 , simple answer to all of those is that, I am afraid, django-river doesn't support Microsoft SQL Server. I am looking into this to customize the SQL queries when the driver is for Microsoft SQL Server but it doesn't seem to be able to go out soon.

@javrasya
Copy link
Owner

I am not promising anything but at least we have a ticket ( #141 ) for this which you can follow;

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 18, 2020

Yeah, appreciate you updating about it. I was thinking the same that it doesn't support, because of errors. Thank you .

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 19, 2020

Hi, I just want your thoughts on this. My requirement is to use river for api only. So, If I can host my project data on sql server and Workflow data on sqlite db. Do you think, it will work?

@PS-CR7
Copy link
Author

PS-CR7 commented Feb 19, 2020

Also, how much is river customizable. I am not using Django user instead my own user table. Also, transition and transition approval table will be populated using code in views.py in my case,since I will be reading data from react ui and then populate it. Will that work?

@javrasya
Copy link
Owner

The only dependency of djangor-river with your data model is that your model contains a state field that is a foreign key to django-river's State model. So I don't think it is possible to separate these two to separate databases since you can't have foreign keys cross databases ( cross-database-relations ). But it sounds like an interesting idea. I will think about this

@javrasya
Copy link
Owner

Also, how much is river customizable. I am not using Django user instead my own user table. Also, transition and transition approval table will be populated using code in views.py in my case,since I will be reading data from react ui and then populate it. Will that work?

django-river uses the given user model that is specified with settings.AUTH_USER_MODEL. As long as you have that variable set to be a different user model, django-river should work just fine. But feel free to report a bug if it doesn't work. Because it is meant to be working.

@javrasya
Copy link
Owner

javrasya commented Mar 16, 2020

Hi again @PS-CR7 ,

I think django-river can now support Microsoft SQL Servers after I put some love into it 😄 🎉 🎉 🎉

But it is not merged yet and it is definitely up for testing. It is on a branch named issue-141-support-microsoft-sql . Can you give it a try to see if you observe any problem so that we can improve it even more? You can install it from this branch of the repo instead of pypi.

@javrasya
Copy link
Owner

This problem should go away after version 3.2.0 which has already been published. Try it out and report if you observe any new problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants