I've run into an interesting problem and suspect that H2 is skipping some 
necessary things when scripting a database into an SQL file with "SCRIPT 
SIMPLE DROP TO".

I believe it's not generating DROP commands for SYSTEM_SEQUENCE sequences, 
which prevents running the generated script on an existing database to 
restore it - restore will crash upon encountering sequences with the same 
globally unique ID.

IMHO, this needlessly complicates backup and restore operations. Manually 
created sequences get DROP SEQUENCE generated for them nicely.

What do you think, should SCRIPT SIMPLE DROP generate DROP statements for 
things like this?

id INT PRIMARY KEY AUTO_INCREMENT
>

...because an ID field made like that becomes a system sequence (random 
example below)...

"ID" INT DEFAULT NEXT VALUE FOR 
> "PUBLIC"."SYSTEM_SEQUENCE_7569DD02_7110_4CEE_A8A0_AD6875A6AFFC" NOT NULL 
> NULL_TO_DEFAULT SEQUENCE 
> "PUBLIC"."SYSTEM_SEQUENCE_7569DD02_7110_4CEE_A8A0_AD6875A6AFFC"
>

 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c62cdec8-5ea3-4dcd-8ffe-5f36de55aaeb%40googlegroups.com.

Reply via email to