Hi,
I'm half way through writing my first grails app. It's going really well so far but I've only just realised that when I go live I won't be able to change the domain model around so much.
The application is backed by a MySql database, I currently only have one object of interest 'Person'. If after deployment I want to add a 'Group' domain, so that a Person has many Groups what will I have to do regarding the database? Will I loose any existing rows in the MySQL database?
How do people typically handle this situation? Is there a clever way to design my domains or a simple tool to manage the addition of columns in the MySql table?
V1
class Person {
String firstName;
String lastName;
String email;
String phoneNumber;
}
V2
class Person {
static hasMany = [groups:Group]
String firstName;
String lastName;
String email;
String phoneNumber;
}
Kind regards,
Gav