-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bypass the requirement to have transactionId
database column
#1
Comments
Have added this to |
So, Have another solution? |
I have a solution but that requires some time for me to implement. I have already implemented a pet while adding support for .count. I will see if I can take this up early next month. |
I have a big project, I'm using your framework and I cant use on development mode. :( |
Hmm. Can you tell me more accurately when is this happening for you? I mean is there a specific pattern when the transaction is failing? |
Transactions isnt working. I use transaction.rollback(); but not work. Just it. :/ |
the field "transactionId" is not being created in the tables. |
Hmm. That is too generic for me to determine the cause of the problem. So, I'm asking a few basic questions:
|
Do you have autoTK enabled on the models? It is enabled by default? Observation: I switched to windows when I was in Linux, it worked smoothly. |
:-o that is a serious problem. Without that field transactions will not work at all. Can you check whether you are on the latest version of the adapter. I guess it would be 0.8.0? This adapter automatically adds the field to the model unless autoTK is set to false. One more thing - are you testing this in production or development mode? |
My configs. database: { |
My models dont have anything about autoTk, probably this is automatic, right? |
I'm not sure how the OS would influence transactions. You say that the transactionId column itself is not created in table (hope you've directly checked the MySQL database). If that's the case, you should once try running this in "drop" migrate mode (existing data is deleted in this mode.) and see if the columns get created. |
Yes, in development mode I'm using "drop" migrate mode but the column is never created. :'( |
Yes. autoTK is automatic. But sails will not edit your database in production or non-drop migration mode. |
I have no clue what could cause this issue. You mentioned that you got it to work on Windows. So, what are the differences between these two projects? As of now, I have no clue why the columns are not getting created. |
In production mode is working smoothly. But now, I need to create some tests using transactions. |
Let me check the code and see if I've done anything special for non production mode. As far as I can remember there's no code difference. Unless this is a SailsJS bug or issue with default model migration config. |
I tried to put the "autoTK: true" in my models and still nothing works. |
I dont have sails-mysql installed. |
I don't think I can debug the problem with the information I have. I've tried to reproduce the problem but couldn't. Last option is if you can share a scaled down version of your project which is exhibiting the bug. |
What is the minimum version of "sails" for this to work? |
It works with 0.11.1+. We recommend 0.11.5 |
Have any problem if the scripts/postinstall.sh is not executed? In windows I just can install using "npm install sails-mysql-transaction --force" |
hmm. It could be a problem. You must have sails installed first and then install this adapter. So, try installing sails and then install this adapter. |
Sails is already installed. |
{ |
Any problem? |
Yes. The post install script overrides the special waterline injected into sails by sails MySQL transactions. |
I do it manually using... npm remove waterline Based on: pushd "${MOD_DIR}/sails" > /dev/null; Still not working :( |
Hmm. Try putting a console log in the sails MySQL transactions waterline scripts. I have a hunch that some other waterline is being used - either installed in root or installed inside sails. |
FIXED!!! You are right!!! Oh god!!! The problem is, if someone have different version of waterline inside sails, so, cause this error. So, you can fix it puting this script in postinstall.sh: npm remove waterline; |
Something like this!!! 🎯 |
Is there any way to avoid inserting a 'transactionId' column in the database? I don't really want to add that column to all of my models in the database, thought I have autoTK: false in the models it still fails because:
EDIT: After putting the transactionId column when required and executing on postinstall (inside "scripts" in the package.json) the following command I was able to solve my issue:
|
No description provided.
The text was updated successfully, but these errors were encountered: