create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;

    create table books (
        rating integer,
        bot_user_id bigint,
        id bigint generated by default as identity,
        author varchar(255),
        title varchar(255),
        primary key (id)
    );

    create table bot_user (
        chat_id bigint,
        created_date_time timestamp(6),
        id bigint not null,
        user_type varchar(255) check (user_type in ('USER','ADMIN')),
        working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')),
        primary key (id)
    );

    create table messages (
        bot_user_id bigint,
        created_at timestamp(6),
        id bigint generated by default as identity,
        content TEXT,
        type varchar(255) check (type in ('TEXT','FILE','COMMAND')),
        primary key (id)
    );

    alter table if exists books 
       add constraint FKa9x6empm1nnnicld7s6v8yipr 
       foreign key (bot_user_id) 
       references bot_user;

    alter table if exists messages 
       add constraint FKbaqitbc8w0203kqcxcj88wfn9 
       foreign key (bot_user_id) 
       references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
create table books (rating integer, bot_user_id bigint, id bigint generated by default as identity, author varchar(255), title varchar(255), primary key (id));
create table bot_user (chat_id bigint, created_date_time timestamp(6), id bigint not null, user_type varchar(255) check (user_type in ('USER','ADMIN')), working_mode varchar(255) check (working_mode in ('BOOK','TORRENT','AI','NO_MODE')), primary key (id));
create table messages (bot_user_id bigint, created_at timestamp(6), id bigint generated by default as identity, content TEXT, type varchar(255) check (type in ('TEXT','FILE','COMMAND')), primary key (id));
alter table if exists books add constraint FKa9x6empm1nnnicld7s6v8yipr foreign key (bot_user_id) references bot_user;
alter table if exists messages add constraint FKbaqitbc8w0203kqcxcj88wfn9 foreign key (bot_user_id) references bot_user;
