i had this problem already with a few of our db's. recreating (drop/create)
the indices fixed that problem.
and another strange thing related to this table happend:
CREATE CACHED TABLE ALARM_HISTORY(
ACCOUNT INTEGER NOT NULL,
UNIT TINYINT NOT NULL,
UNITSTRING VARCHAR(1024) NOT NULL,
ADDR INTEGER NOT NULL,
ADDRSTRING VARCHAR(1024) NOT NULL,
ALARMDATE TIMESTAMP NOT NULL,
ALARMTYPE INTEGER NOT NULL,
SEVERITY TINYINT NOT NULL,
ALARMTEXT VARCHAR(1024) NOT NULL
);
ALTER TABLE ALARM_HISTORY ADD CONSTRAINT FK_ALARM_HISTORY_USERS FOREIGN KEY
(ACCOUNT) REFERENCES USERS (USERID) ON DELETE CASCADE ON UPDATE CASCADE;
CREATE INDEX IF NOT EXISTS IDX_ALARM_HISTORY_ALARMDATE ON
ALARM_HISTORY(ALARMDATE);
CREATE INDEX IF NOT EXISTS IDX_ALARM_HISTORY_ACCOUNTALARMDATE ON
ALARM_HISTORY(ACCOUNT,ALARMDATE);
I got two databases with this problem. with db1 i had just to recreate the
indices but with the second i got this problem:
DROP INDEX PUBLIC.IDX_ALARM_HISTORY_ACCOUNTALARMDATE;
Index "IDX_ALARM_HISTORY_ACCOUNTALARMDATE" belongs to constraint
"FK_ALARM_HISTORY_USERS"; SQL statement:
DROP INDEX PUBLIC.IDX_ALARM_HISTORY_ACCOUNTALARMDATE [90085-192]
90085/90085 (Hilfe)
org.h2.jdbc.JdbcSQLException: Index "IDX_ALARM_HISTORY_ACCOUNTALARMDATE"
belongs to constraint "FK_ALARM_HISTORY_USERS"; SQL statement:
DROP INDEX PUBLIC.IDX_ALARM_HISTORY_ACCOUNTALARMDATE [90085-192]
So i had to drop the fk as well and recreated the foreign key.
maybe it has sth to do that one of the index uses a fk column?
but as i said recreating the indices/keys fixed that problem and all other
tables seem to be fine and im not sure how to reproduce it.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.