r/DatabaseHelp • • Jan 28 '16

Building a scalable form-field database, am I making life more difficult than it needs to be?

I am building a contact list manager for our marketing department. The end goal is simple, allow contacts to provide contact information relative to their region. The groups of information that we'd be collecting are Customer Info (Name, business, phone, etc..), Address Information (street, country, etc...) and opt-to-receive info (merchandise kit, posters, etc...). This information may only change based on country.

What I want to accomplish: I want to keep my form fields as scalable as possible so that in a single signup form I can say, for France, only show address fields aX, aY, and aZ, contact fields cA and cD, and opt-to-receive fields oJ, oK and oL while requiring only fields required for France.**

Below is how I think this might be laid out in the database, is this ideal or is there another model (many to many?) that I should be adhering to? The contact fields and opt-to-receive fields would follow the same layout.

Address Type

idcountrylabel
1USUnited States
2CACanada
3FrFrance

Address Fields

idfieldfield_label
1street_1Street
2street_2Street Cont.
3apt_numApartment Number
4zip_codeZip Code
5regionRegion

Address Field Association

idaddress_typeaddress_fieldis_required
1111
2120
3211
4130
5231
6151
7251

Bonus question, if this is an acceptable model, I would love some hand-holding on how best to store the data once it is captured. That seems like an even greater feat. than establishing the DB model.

1 Upvotes

0 comments sorted by