[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ShopSuite-dev] shop and drop
From: |
Davi Leal |
Subject: |
Re: [ShopSuite-dev] shop and drop |
Date: |
Thu, 23 Aug 2001 02:13:55 +0100 |
Tomasz Wegrzanowski wrote:
> On Wed, Aug 22, 2001 at 03:32:24PM +0100, Davi Leal wrote:
> > > Here are two scripts: shop.psql and drop.psql
> > >
> > > drop.psql drops all shopDB tables from db, so newer version can be
> > > added (that's mostly for debug)
> >
> > We have scripts/clean.psql (DELETE). Must the drop.psql (DROP) be added to
> > the
> > scripts/ directory?. I do not think so. At least not now. What do you
> > think?.
>
> clean.psql doesn't remove tables, drop.sql does.
>
> Compare:
> $ psql shopdb <drop.sql
> $ psql shopdb <shop.sql # new version
>
> With:
> $ dropdb shopdb
> $ createdb shopdb
> $ su
> # su postgres
> $ psql shopdb <rational.sql
> $ ^D
> # ^D
> $ psql shopdb shop.sql # new version
Yes, you are right. So, must drop.psql be added to scripts/ ? What do you
think?. I
think so now, as the script is a development tool.
> > Agreed. And ... What about using 'UNIQUE' too into the products.shortdsc
> > field?.
> > See the diff of attached shop.psql.
>
> It is already UNIQUE due to CREATE UNIQUE INDEX on it.
Yes, it is. However, I thought removing the "CREATE UNIQUE INDEX ...
(shortdsc);"
line and instead using "CREATE TABLE products ( shortdsc char(11) UNIQUE NOT
NULL,
...". So the UNIQUE implicitly creates a key and therefore a index. This is more
compact. Am I right?.