Hi, I was just playing with the SchemaExport class to export the DDL creation script and I was wondering if the following formatting is intentional or should be improved:
create sequence DATASET_SEQUENCE start with 1 increment by 50;
create sequence MODEL_SEQUENCE start with 1 increment by 50;
create sequence USER_SEQUENCE start with 1 increment by 50;
create table Dataset (
...
);
create table Model (
...
);
create table Model_User (
model_id bigint not null,
user_id bigint not null,
primary key (model_id, user_id)
);
create table User (
...
);
create unique index INDEX_ID on User (dataset_id, external_id, revision);
alter table Model
add constraint FKj2cyptlmwgilu172586ym0vwk
foreign key (dataset_id)
references Dataset;
...
I've replaced any irrelevant part with "...", but to summarize:
- create sequence statements are not separated by new lines like the other statements;
- create table statements are 4-spaces indented by default;
- alter table statements are 4-spaces indented by default;
- in the create table statement, the row of the first column is 7-spaces indented while the other columns are 8-spaces indented (e.g. model_id and user_id of Model_User table);
- between the last create table statement and the first create unique index statement there is no new line separation.
Unless there is a reason for this specific formatting, I would be happy to contribute a fix (the code of org.hibernate.engine.jdbc.internal.DDLFormatterImpl.java seems quite easy). |