forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: steveski on January 25, 2005, 02:11:46 pm

Title: Updating database Date Fields of When Images are Added
Post by: steveski on January 25, 2005, 02:11:46 pm
I am migrating thousands of images to our CPG installation.  The timestamps on images and albums (when added) is, of course, the current date and time.  Since each album is actually photos from a specific event that took place in the past, I would like the date to reflect when the event occurred.  This will naturally happen for all future events, since the images will be added right after the event.  However, for the import of the past 7 years of images, the date is not as desired.

What table/fields should be changed to correct this, and can I do it via mySQL admin and not cause CPG to get damaged or behave badly?
Title: Re: Updating database Date Fields of When Images are Added
Post by: Nibbler on January 25, 2005, 07:54:04 pm
You would change the 'ctime' in the pictures table, you'll also need to be able to convert to a unix timestamp for that.
Title: Re: Updating database Date Fields of When Images are Added
Post by: Joachim Müller on January 26, 2005, 09:09:05 am
I rather recommend using a custom user field to hold the date and time though.

Joachim
Title: Re: Updating database Date Fields of When Images are Added
Post by: steveski on January 26, 2005, 03:30:19 pm
If using a custom field, wouldn't that have to be updated manually for each image when batch importing, and then also make mods to the scripts to show the date - where today the ctime is shown?
Title: Re: Updating database Date Fields of When Images are Added
Post by: Joachim Müller on January 26, 2005, 05:07:30 pm
Yes, when using a custom field the drawback is you manually have to fill it. The disadvantage of using a field that is meant to be used for coppermine's internal purposes is that you risk losing data when updating. The user field can be filled running a query (e.g. in phpMyAdmin) though - works great if all pics you have in a particular album are meant to have the same date (that's the way I use it).
Either way, your choice: both methods will work.

Joachim
Title: Re: Updating database Date Fields of When Images are Added
Post by: steveski on January 26, 2005, 10:04:26 pm
Thanks - I'll give it a try on one album and see what happens.  This is only for past events that I've imported, so once complete, I won't have to ever do it again.........