4.15 Sql change log

Karl.3 years ago

I'm not sure what happened when I tried to update but I was getting an error to do with creating the foreign key for the tc_user_orders table.

Can you provide a sql script for me to run to add in the new tables and foreign keys?

Modern Interface is looking great!

Thanks

Karl

Anton Tananaev3 years ago

What's the error?

We don't really have SQL scripts.

Karl.3 years ago
2022-01-20 07:26:47  INFO: HikariPool-1 - Start completed.
2022-01-20 07:26:48  INFO: Clearing database change log checksums
2022-01-20 07:26:48  INFO: Successfully acquired change log lock
2022-01-20 07:26:48  INFO: Successfully released change log lock
2022-01-20 07:26:48  INFO: Successfully acquired change log lock
2022-01-20 07:26:48  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.json.JsonChangeLogParser Unable to get public no-arg constructor
2022-01-20 07:26:48  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.yaml.YamlChangeLogParser Unable to get public no-arg constructor
2022-01-20 07:26:49  INFO: Reading from gps.DATABASECHANGELOG
2022-01-20 07:26:49  INFO: Reading from gps.DATABASECHANGELOG
2022-01-20 07:26:50  INFO: Cannot load service: liquibase.hub.HubService: Provider liquibase.hub.core.StandardHubService could not be instantiated
2022-01-20 07:26:50  INFO: Table tc_orders created
2022-01-20 07:26:50  INFO: Table tc_user_order created
2022-01-20 07:26:50  INFO: Successfully released change log lock
2022-01-20 07:26:50 ERROR: Main method error - Cannot add foreign key constraint - SQLException (... < DataManager:298 < *:91 < Context:298 < Main:120 < ...)
2022-01-20 07:27:01  INFO: HikariPool-1 - Starting...
2022-01-20 07:27:01  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
Anton Tananaev3 years ago

Are you using innodb or myisam?

Karl.3 years ago

Using MySql

Anton Tananaev3 years ago

I can see that, but I'm asking about the storage engine for your MySQL database.

Karl.3 years ago

Sorry, thats not something I was fimiliar with but I have just had a look.

I manually created the tc_user_order, tc_orders, tc_group_order,tc_device_order tables just to get my server running as a quick fix this morning and they have created as InnoDB

the tc_attributes and databasechangeloglock tables as also InnoDB.

All the other tables are MyISAM

Anton Tananaev3 years ago

MyISAM does not support foreign keys, so it won't work correctly with Traccar. You should migrate everything to InnoDB.

Karl.3 years ago

Thanks for that. I have updated all the tables except the positions table. Its throwing the following error

Invalid default value for 'devicetime'

Having a look at the column and its set to not null and the defaul is 0000-00-00 00:00:00

Anton Tananaev3 years ago

You need to set correct SQL mode.