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