Zen Cart Logo
Forums / General Questions / Adding field to customers table

Adding field to customers table

Locked

Views: 666

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
26 Oct 2010, 10:49 PM
#1
eflat avatar

eflat

New Zenner

Join Date:
Aug 2008
Posts:
33
Plugin Contributions:
0

Adding field to customers table

I'd like to add a simple timestamp column to the end of the customers table. I know how to do it, but just thought I'd check and see if anyone know a reason not to do it. I don't want to break anything that would depend on there being a certain number of columns or something silly like that.

26 Oct 2010, 10:53 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding field to customers table

Why?

What's this "timestamp" for?

There's already a last_modified column which is a timestamp indicating the last change.

26 Oct 2010, 11:04 PM
#3
eflat avatar

eflat

New Zenner

Join Date:
Aug 2008
Posts:
33
Plugin Contributions:
0

Re: Adding field to customers table

The field would be for when the record was created (aka when the account was created). In one case, I wanted to use an external newsletter mailing and wanted to pull customers who created accounts and opted-in since the previous mailing. In another case, I just wondered how many accounts were created this month or that month.

So would that break anything?

26 Oct 2010, 11:19 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding field to customers table

It's a waste of your time. Why make the database schema more complicated and more to maintain needlessly?

There's already a date-created and last-modified date stored for each customer record: just do a join on customers and customers_info and you'll have all that information.

26 Oct 2010, 11:58 PM
#5
eflat avatar

eflat

New Zenner

Join Date:
Aug 2008
Posts:
33
Plugin Contributions:
0

Re: Adding field to customers table

DrByte:

It's a waste of your time. Why make the database schema more complicated and more to maintain needlessly?

There's already a date-created and last-modified date stored for each customer record: just do a join on customers and customers_info and you'll have all that information.

"That data is already being captured in customers_info" is what I needed to hear. thanx.