Re: Keeping Mears in Database
Brought to you by:
iridium
From: Klaus D. <kla...@gm...> - 2003-04-07 19:07:25
|
On Sun, 6 Apr 2003 23:23:09 +0200 (CEST) Ondrej Jombik <ne...@po...> wrote: > On Sun, 6 Apr 2003, Martin Geisler wrote: > > > So this won't be possible to implementent without database schema > change. We can remove primary key completely, or extend it with > "timestamp" field. In the second case new primary key will contain > "icao" and "timestamp" columns. > > [1] Database schema of "metars" table > > mysql/phpweather> \d metars > +--------+-----------+-----------+-----+--------------------------------------+ > | table | name | type | len | flags | > +--------+-----------+-----------+-----+--------------------------------------+ > | metars | icao | string | 4 | not_null primary_key unique_key | > | metars | metar | string | 255 | not_null | > | metars | timestamp | timestamp | 14 | not_null unsigned zerofill timestamp | > +--------+-----------+-----------+-----+--------------------------------------+ > mysql/phpweather> > > -- Ondrej, I tried in the first place to extend the key and change 'update-metar' to 'insert_metar', but as the timestamp is the time of the metar, the system get still confused and reports 'duplicate entry'. On the weekend, I will check something if I add an auto-increment column to the table (either metars or using an additional history table). Cheers, Klaus Cheers, |