1

I want to add a new column anotherValue to my table AnotherTable.

I have read this related question and the SugarORM documentation, but when I save new data, and want to get anotherValue later, it just returns 0.

sql screenshot

Jake Lee
  • 7,549
  • 8
  • 45
  • 86
elham shahidi
  • 771
  • 6
  • 11

1 Answers1

0

The datatype needs to be INT, not integer, and you need the COLUMN keyword:

ALTER TABLE another_table ADD COLUMN another_value INT;

I actually wrote the (accepted) answer you linked to, I suggest you follow it more closely!

If you're still having trouble, please turn on SugarORM logging and post what is output when you save & load data. Additionally, try using a table & column name without underscore, to rule out SugarORM's name conversion causing issues.

Jake Lee
  • 7,549
  • 8
  • 45
  • 86