[development] DB Column Format

Nancy Wichmann nan_wich at bellsouth.net
Thu May 14 16:46:05 UTC 2009


Okay, I found:
  $schema = drupal_get_schema('mytable');
  if ($schema['fields']['last_checked']['type'] != 'datetime') {


  }

Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. - Martin L. King, Jr.

-----Original Message-----
From: development-bounces at drupal.org
[mailto:development-bounces at drupal.org]On Behalf Of Nancy Wichmann
Sent: Thursday, May 14, 2009 12:11 PM
To: Development at Drupal. Org
Subject: [development] DB Column Format

I have a module for which users seem to run the updates more than once, so I
try to make the update code sensitive to this.
In my latest change, I am converting from unix time to DATETIME. I don’t see
a function in the APIs that allows me to check what type the column is. I
can easily use “SHOW COLUMNS,” but I suspect that MySql and PgSql return
different results. Any ideas on how to make this database independent?

Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. - Martin L. King, Jr.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/development/attachments/20090514/fc9e804e/attachment-0001.htm>
-------------- next part --------------

No virus found in this outgoing message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.12.29/2114 - Release Date: 5/14/2009 6:28 AM


More information about the development mailing list