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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.