I'm using Play! framework 2.0 and I'm stuck on an annoying issue involving the database.
Suppose I have a User
(extends Model
) class which has few attributes (first_name
, last_name
, email
, password
etc).
At some point I want to add a new attribute, lets say last_ip
(it doesn't really matter what it is). So, I add the attribute to the User
class, compile and run.
The thing is: I get this red alert about database changes (obviously) which asks me to press "APPLY CHANGES" (if I remember correctly). That's fine BUT! all the database records are erased!
In conclusion: I want to a new field but I don't want to lose all the records I already added to the database. Is this possible?