Skip to content

Commit 211b427

Browse files
committed
pom.xml: don't generate database scheme each time automatically.
So now after each changes in entities you should not forget to re-generate database scheme by command `mvn -P hiberante3:hbm2ddl` After this changes integration tests passes about 8 sec faster at my homes laptop. No functional changes.
1 parent 51ca6be commit 211b427

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

pom.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@
636636
<component>
637637
<name>hbm2ddl</name>
638638
<implementation>jpaconfiguration</implementation>
639-
<outputDirectory>target/classes</outputDirectory>
639+
<outputDirectory>${env.dir}/test</outputDirectory>
640640
</component>
641641
</components>
642642
<componentProperties>
@@ -676,15 +676,6 @@
676676
<version>1.0.0.GA</version>
677677
</dependency>
678678
</dependencies>
679-
<executions>
680-
<execution>
681-
<id>generate-hsql-scheme</id>
682-
<phase>prepare-package</phase>
683-
<goals>
684-
<goal>hbm2ddl</goal>
685-
</goals>
686-
</execution>
687-
</executions>
688679
</plugin>
689680

690681
<plugin>

src/env/test/hsql-scheme.sql

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--
2+
-- Generated by Maven: mvn -P test hibernate3:hbm2ddl
3+
--
4+
5+
create table suspicious_activities (
6+
id integer generated by default as identity (start with 1),
7+
ip varchar(15) not null,
8+
occured_at timestamp not null,
9+
page varchar(100) not null,
10+
referer_page varchar(255) not null,
11+
user_agent varchar(255) not null,
12+
type_id integer not null,
13+
user_id integer,
14+
primary key (id)
15+
);
16+
17+
create table suspicious_activities_types (
18+
id integer generated by default as identity (start with 1),
19+
name varchar(100) not null,
20+
primary key (id),
21+
unique (name)
22+
);
23+
24+
create table users (
25+
id integer generated by default as identity (start with 1),
26+
activated_at timestamp not null,
27+
email varchar(255) not null,
28+
hash varchar(40) not null,
29+
login varchar(15) not null,
30+
name varchar(100) not null,
31+
registered_at timestamp not null,
32+
salt varchar(10) not null,
33+
primary key (id),
34+
unique (login)
35+
);
36+
37+
create table users_activation (
38+
act_key varchar(10) not null,
39+
created_at timestamp not null,
40+
email varchar(255) not null,
41+
primary key (act_key)
42+
);
43+
44+
alter table suspicious_activities
45+
add constraint FK35F0CA0F8D3FBEA4
46+
foreign key (user_id)
47+
references users;
48+
49+
alter table suspicious_activities
50+
add constraint FK35F0CA0FC005E970
51+
foreign key (type_id)
52+
references suspicious_activities_types;

0 commit comments

Comments
 (0)