Add New Column in a table

Sumit7 years ago

Hello there,

I want to add a new column in device table with type of CURRENT_TIMESTAMP. Will I have to add the column in some XML file or some else file if I do this?

Anton Tananaev7 years ago

You need:

  1. Add new liquibase changelog.
  2. Add field to Java data model.
  3. Add field to JavaScript data model.
Sumit7 years ago

Thanks.

Martha6 years ago

I'm adding an "emergency contacts" table and adding new column to the device table called "contactid" to reference to the new table, similar to the "positions" table

✓ 1. I've added a new changelog file with the new table and new column

✗ 2. I've installed Traccar on Windows, and I don't see these java files. I see them on (https://github.com/traccar/traccar/tree/master/src/org/traccar/model) What should I do???

✓ 3. I've added new JS files; "Contact.js" on (https://github.com/traccar/traccar-web/tree/master/web/app/model) and "Contacts.js" on (https://github.com/traccar/traccar-web/tree/master/web/app/store) and modified Device.js and Devices.js files with new fields.

Help please!!

rmoraes3 years ago

Hello, is the first step needed even if i'm using mysql?
Thanks

Anton Tananaev3 years ago

It's not needed if you want to add the field manually, obviously.

rmoraes3 years ago

Thanks Anton.