That doesn’t work because the schema is updated by the
time the update runs. The only thing I can think of now is to rename the old
column and use “db_column_exists.”
Next question: Is there are Drupal or
database-independent date formatting function that produces a DATETIME value. I
know I can use date() with something appropriate, but I don’t know how
efficient that is.
Would there be any interest in my submitting a patch for
“format_date($time, ‘datetime’)?”
Nancy E. Wichmann, PMP
Injustice
anywhere is a threat to justice everywhere. - Martin L. King, Jr.
-----Original
Message-----
From:
development-bounces@drupal.org [mailto:development-bounces@drupal.org]On Behalf Of Nancy Wichmann
Sent: Thursday, May 14, 2009 12:46
PM
To: development@drupal.org
Subject: Re: [development] DB
Column Format
Okay, I found:
$schema = drupal_get_schema('mytable');
if ($schema['fields']['last_checked']['type'] != 'datetime')
{
…
}