Advertisement
codegod313

Hibernate database generation for ViBank

May 13th, 2022
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hibernate: create sequence hibernate_sequence start 1 increment 1
  2. Hibernate: create table accounts_table (id int8 not null, balance numeric(19, 2), name varchar(255), currency_id int8, primary key (id))
  3. Hibernate: create table credit (dtype varchar(31) not null, id int8 not null, amount numeric(19, 2), description varchar(255), name varchar(255), percent numeric(19, 2), quantity_of_months int4, active boolean, balance numeric(19, 2), date timestamp, number_of_months int4, currency_id int8, primary key (id))
  4. Hibernate: create table currency (id int8 not null, name varchar(255), short_name varchar(255), primary key (id))
  5. Hibernate: create table user_role (user_id int8 not null, roles varchar(255))
  6. Hibernate: create table users (dtype varchar(31) not null, id int8 not null, active boolean not null, email varchar(255), password varchar(255), avatar_path varchar(255), last_name varchar(255), name varchar(255), passport_id varchar(255), passport_number varchar(255), primary key (id))
  7. Hibernate: create table users_accounts (client_id int8 not null, accounts_id int8 not null, primary key (client_id, accounts_id))
  8. Hibernate: create table users_credits (client_id int8 not null, credits_id int8 not null, primary key (client_id, credits_id))
  9. Hibernate: alter table if exists users_accounts add constraint UK_nbnvigj13od728soebnnv9fks unique (accounts_id)
  10. Hibernate: alter table if exists users_credits add constraint UK_ru2jqguaksvngori66jhqnq1p unique (credits_id)
  11. Hibernate: alter table if exists accounts_table add constraint FKkdlcl54pccie2vrigbnmr2m68 foreign key (currency_id) references currency
  12. Hibernate: alter table if exists credit add constraint FKiydmp1c8lao7q4340cluq9gqm foreign key (currency_id) references currency
  13. Hibernate: alter table if exists user_role add constraint FKj345gk1bovqvfame88rcx7yyx foreign key (user_id) references users
  14. Hibernate: alter table if exists users_accounts add constraint FK221tebd9nsiftqib8ljp43i9j foreign key (accounts_id) references accounts_table
  15. Hibernate: alter table if exists users_accounts add constraint FKcnjqbtamd7ct458o2xf5vmicw foreign key (client_id) references users
  16. Hibernate: alter table if exists users_credits add constraint FKdybbnnapu2086n6rn8sotrdds foreign key (credits_id) references credit
  17. Hibernate: alter table if exists users_credits add constraint FKnc6evhca4cf4ng3u6r9yk5hx8 foreign key (client_id) references users
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement