DROP TABLE IF EXISTS `repositorys`;
create table `repositorys`
(
    id            binary(16)   default (uuid_to_bin(
            uuid(),
            1)) primary key,
    name          varchar(256) unique                       not null,
    type          enum ('PROXY','LOCAL','GROUP')            not null,
    explanation   text,
    group_names   json,
    creation_time timestamp(6) default current_timestamp(6) not null,
    creator_id     binary(16)                                not null,
    update_time   timestamp(6)                              null,
    regenerator_id binary(16)                                null,
    foreign key (creator_id) references users (id),
    foreign key (regenerator_id) references users (id)
);

insert into repositorys (id, name, type, explanation, group_names, creator_id, regenerator_id)
values (0x689EFC204D1F11F08134DB0063E177A7, 'public', 'GROUP', '主仓库', '[]', 0x689EFC204D1F11F08134DB0063E177A7,
        0x689EFC204D1F11F08134DB0063E177A7);

