Re: Re: cvs: php4 /pear/Cache/Container db.php
| From: | Ulf Wendel | Date: | Fri, 02 Mar 2001 15:49:58 +0000 |
| Subject: | Re: Re: cvs: php4 /pear/Cache/Container db.php | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1556@lists.php.net to get a copy of this message | ||
Chuck Hagenbuch schrieb:
>
> Quoting Ulf Wendel <ulf.wendel@phpdoc.de>:
>
> > - the fieldname "data" is a reserved word in old MySQL versions,
> > changed to "content"
>
> To avoid future problems with reserved words, portability, etc., how about
> standardizing on this db schema:
>
> CREATE TABLE Cache (
> cache_ID varchar(32) NOT NULL DEFAULT '',
> cache_Content mediumtext NOT NULL DEFAULT '',
> cache_Expires int(9) NOT NULL DEFAULT 0,
> cache_Changed int,
> INDEX(cache_Expires),
> PRIMARY KEY(cache_ID)
> )
No, we should not make things more complicated as they are. There're
already enough rules in PEAR. And please no mixed case for DB
fieldnames.
> I realize there will be code changes necessary to deal with changing the
> timestamp field to an int (in which we'd just store a unix timestamp), but I
When I wrote this I tought of an automatically updated timestamp field
(mysql feature) which every (mysql) database table should have as it
makes debugging much easier. There's no need for this field for the
cache logic. If you don't like it, remove it.
More important but the discussion on yet another (I'm sick of them)
coding rule is in my eyes the question where to place SQL snippets. SQL
snippet should not be hidden in the (doc) comments. I suggest having
cache_mysql.sql, cache_xy.sql files in Cache/.
Ulf
--
Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel
Tel: +49 431 386 436 00, Fax: +49 431 386 435 99