MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] MySQL UNIQUE index needs NOT NULL



On Thu, 2 Dec 1999, Shane Roberts wrote:
> I am trying to run MiniVend with MySQL.
> 
> I have created a test catalog based on the "simple" catalog
> template.
> 
> I have created a user "minivend" in MySQL, and this user has full
> permissions under MySQL.
> 
> I have placed the following lines in my catalog.cfg file to
> create the "products" catalog:
> 
> Database            products products.asc
> dbi:mysql:minivend:localhost:3333
> Database   products  DELIMITER     TAB
> Database   products  LongReadLen   128
> Database   products  COLUMN_DEF    price=float, code=char(20),
> discount=float
> Database   products  COLUMN_DEF    author=char(40),
> title=char(64)
> Database   products  COLUMN_DEF    nontaxable=char(3)
> Database   products  NUMERIC       price, discount
> 
> When I restart the MiniVend server it tries to configure the
> above products table but it gets the following error from MySQL:
> 
> ERROR 1121: Column 'code' is used with UNIQUE or INDEX but is not
> defined as NOT NULL
> 
> Has anyone run into this problem before. What do you have to tell
> MiniVend for it to properly create the index for the products
> table?

Yes.  Create the table yourself.

$ mysql minivend
mysql> create table products (code char(20) not null primary key, ...);

Dan
-- 
 Dan Busarow                                                  949 443 4172
 Dana Point Communications, Inc.                            dan@dpcsys.com
 Dana Point, California  83 09 EF 59 E0 11 89 B4   8D 09 DB FD E1 DD 0C 82



Search for: Match: Format: Sort by: