ORA-02261 when updating Membership tables to database

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
extrakun
Posts: 22
Joined: Wed 20 Apr 2011 06:02

ORA-02261 when updating Membership tables to database

Post by extrakun » Thu 21 Apr 2011 05:01

I have added the database objects required for the Oracle Membership Provider to my model. When I attempt to update them to database, the following SQL is generated:

Code: Select all


-- 
-- Altering a table MYDB.ASPNET_PROFILES 
-- 
ALTER TABLE MYDB.ASPNET_PROFILES
   ADD (
      CONSTRAINT PK_ASPNET_PROFILES PRIMARY KEY (USERID)
   );

-- 
-- Altering a table MYDB.ASPNET_PERSONALIZATION 
-- 
ALTER TABLE MYDB.ASPNET_PERSONALIZATION
   MODIFY (
      USERID VARCHAR2(50),
      PATH VARCHAR2(255),
      APPLICATIONNAME VARCHAR2(255)
   );

-- 
-- Altering a table MYDB.ASPNET_PERSONALIZATION 
-- 
ALTER TABLE MYDB.ASPNET_PERSONALIZATION
   ADD (
      CONSTRAINT PK_ASPNET_PERSONALIZATION PRIMARY KEY (USERID, PATH, APPLICATIONNAME)
   );

-- 
-- Altering a table MYDB.ASPNET_USERSINROLES 
-- 
ALTER TABLE MYDB.ASPNET_USERSINROLES
   MODIFY (
      ROLEID RAW(16)
   );

-- 
-- Altering a table MYDB.ASPNET_USERSINROLES 
-- 
ALTER TABLE MYDB.ASPNET_USERSINROLES
   ADD (
      CONSTRAINT PK_ASPNET_USERSINROLES PRIMARY KEY (USERID, ROLEID)
   );



The MODIFY statements work for each case, but not the adding of the new PK. For all cases of adding the PK to a table, the error returned is ORA-02261 : Such an unique or primary key has already been defined.

The strange thing is that the next time I update the database from model, the MODIFY statements are generated again. For example, the ROLEID field of ASPNET_ROLES is already RAW(16), but the SQL statements to modify it are still generated

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 21 Apr 2011 11:36

I have tried to reproduce the error but failed (I have tried to add and modify both tables and primary keys).
Could you please send us the initial model and describe the changes that cause the error?

Post Reply