db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Stenerud <k...@webartjapan.com>
Subject Torque ignoring unique constraint?
Date Thu, 03 Apr 2003 02:48:14 GMT
Torque seems to be ignoring the <unique> elements in my schema.

I built the following table in the schema:

   <table name="adminUser" description="Administrators">
        <column
          name="id"
          required="true"
          primaryKey="true"
          type="INTEGER"
          description="Administrator Id"/>
        <column
          name="username"
          required="true"
          type="VARCHAR"
          size="16"
          description="Username"/>
        <column
          name="password"
          required="true"
          type="VARCHAR"
          size="8"
          description="Password"/>
        <unique>
            <unique-column name="id"/>
            <unique-column name="username"/>
        </unique>
    </table>



But when I check mysql to see what it produced, I get the following:

# mysqldump --no-data tokoname;
-- MySQL dump 8.22
--
-- Host: localhost    Database: testdbase
---------------------------------------------------------
-- Server version       3.23.52-log

--
-- Table structure for table 'ID_TABLE'
--

CREATE TABLE ID_TABLE (
  ID_TABLE_ID int(11) NOT NULL default '0',
  TABLE_NAME varchar(255) NOT NULL default '',
  NEXT_ID int(11) default NULL,
  QUANTITY int(11) default NULL,
  PRIMARY KEY  (ID_TABLE_ID),
  UNIQUE KEY TABLE_NAME (TABLE_NAME)
) TYPE=MyISAM;

--
-- Table structure for table 'adminUser'
--

CREATE TABLE adminUser (
  id int(11) NOT NULL default '0',
  username varchar(16) NOT NULL default '',
  password varchar(8) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;


I'm also able to add multiple users with the same username in my application.


Mime
View raw message