-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
MySQL migration issue #4035
Comments
I agree with your suggestion. The history is too long now, some things changed twice. As far as I can see in liquibase documentation we can use preconditions in
|
That would be perfect. Can you try to implement it? |
Sure. It will take some time... |
36 tables... A lot of features were implemented for last three years... |
Nice. Let me know if there are any issues. |
Have you had any progress? I am thinking of releasing a new version soon with all my recent changes to the project. It would be ideal to include this as well. |
I'm really sorry it is not finished yet. Have no enough time to finish. I'll do my best to give at least a draft in a couple of days. |
That's fine. Take your time. Just wanted to know if there's any progress on it. |
Hi,
I am new in traccar. Can anyone tell me how can i learn about traccar.
|
@jishnsyed, please don't comment on unrelated threads. With behaviour like this you will quickly get ban and not help. There is plenty of information about Traccar available on the official website and forum. Read it before asking for anything. |
I'm experiencing the same problem with current code https://stackoverflow.com/questions/50021821/how-do-i-set-sql-mode-in-the-jdbc-connection-string-for-mysql-8 |
Haven't tried with MySQL yet. I'll check. For now you can downgrade driver version. |
Come up with some problems, |
I have created a bug report for MySQL issue: https://bugs.mysql.com/bug.php?id=92485 We might need to downgrade version if they don't fix it before release. |
Any updates? |
Sorry, I have a lot of work and managed spend only small pieces of time.
The one of way out that looks like preconditions do not change changelog checksum. May be we can add preconditions to all our changelogs. |
Can we put new 4.0-clean changelog first in line and run it only if database is empty? And then for all other changelogs have pre-condition that 4.0-clean hasn't run yet. |
I would not call it check for emptiness, but it is already has check for existence of I think we should add by two preconditions to all chagesets according to its content and 4.0-clean already run. Also I think we should use preconditions in future more frequent. For all changesets for example. |
I have implemented migration paths. Please check and see if you can find any issues. I have tested 2 scenarios on H2 database:
Seems to work as expected, unless I missed something. Can you please test some other databases. One question I have about clean changelog. Why are you using |
No we did not have it. It is related to #3223 I have found this solution in liquibase documentation. Otherwise we have to have separate changeset for postgresql. This solution looks cleaner and plane. |
Nice, we moved to Paris :) I've tested it on MSSQL, PostgreSQL and MySQL with some test objects and test data.
I've implemented the fix for #4097 but can not adjust correct precondition. <changeSet author="author" id="changelog-4.0-ms">
<preConditions onFail="MARK_RAN">
<dbms type="mssql" />
</preConditions>
<sql>
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'TR' AND name = 'tg_groups_delete')
BEGIN
DROP TRIGGER tg_groups_delete
END;
</sql>
<sql>
CREATE TRIGGER tg_groups_delete
ON tc_groups FOR DELETE
AS BEGIN
UPDATE tc_groups SET groupid = NULL WHERE groupid IN (SELECT deleted.id FROM deleted)
END
</sql>
<sql>
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'TR' AND name = 'tg_users_delete')
BEGIN
DROP TRIGGER tg_users_delete
END;
</sql>
<sql>
CREATE TRIGGER tg_users_delete
ON tc_users FOR DELETE
AS BEGIN
DELETE FROM tc_user_user WHERE manageduserid IN (SELECT deleted.id FROM deleted)
END
</sql>
</changeSet> Clean install will cause recreating triggers. |
You have moved to Paris? |
Unfortunately not, test-generator.py have moved :) |
Oh yeah. Forgot about that. The reason is actually that we have new free Ban reverse geocoder that works only in France, but useful for testing, so I moved location. |
I like it, why not to move every couple of releases :) |
About triggers. Do we actually need any pre-condition? |
I'm testing adjusted |
@Abyss777, we have renamed all tables, but the problem is that original names are still used in the old changelogs, so Traccar fails on new versions of MySQL:
https://www.traccar.org/forums/topic/traccar-40-mysql/
Any suggestions how to fix it? What do you think about collapsing all changelog into a single one for new version? Not sure if we can make condition like this, but ideally I want:
Eventually (after a year or two) we can drop old history completely and just rely on the new changelog history that starts with 4.0 schema.
The text was updated successfully, but these errors were encountered: