DDL

Hibernate経由でDDLを生成します。

alter table app_user drop constraint FK459C572946E3A514;
alter table party_relation drop constraint FK7079F335E8B87536;
alter table party_relation drop constraint FK7079F335EF9F3D20;
alter table party_relation drop constraint FK7079F33557129802;
drop table party_relation_type;
drop table app_user;
drop table party_relation;
drop table party;
drop generator hibernate_sequence;
create table party_relation_type (
   party_relation_type_id numeric(18,0) not null,
   name varchar(255) not null,
   primary key (party_relation_type_id)
);
create table app_user (
   party_id numeric(18,0) not null,
   login_id varchar(255) not null,
   passwords varchar(255),
   primary key (party_id)
);
create table party_relation (
   party_relation_id numeric(18,0) not null,
   owner_party_id numeric(18,0),
   target_party_id numeric(18,0),
   party_relation_type_id numeric(18,0),
   primary key (party_relation_id)
);
create table party (
   party_id numeric(18,0) not null,
   party_code varchar(255) not null,
   name varchar(255) not null,
   name_kana varchar(255),
   primary key (party_id)
);
alter table app_user add constraint FK459C572946E3A514 foreign key (party_id) references party;
alter table party_relation add constraint FK7079F335E8B87536 foreign key (party_relation_type_id) references party_relation_type;
alter table party_relation add constraint FK7079F335EF9F3D20 foreign key (owner_party_id) references party;
alter table party_relation add constraint FK7079F33557129802 foreign key (target_party_id) references party;
create generator hibernate_sequence;