Group push rules: Create table `group_push_rules`

Description

As a first step to extract group push rules into a separate table, we need to create a table group_push_rules.

It should be similar to push_rules, but some fields should be missing:

  • project_id - should be removed
  • organization_id - should be removed
  • group_id - should be added
  • is_sample - should be removed
  • force_push_regex - is not used, can be removed
  • delete_branch_regex - is not used, can be removed
  • regexp_uses_re2 - is always true, can be removed

Proposed table structure:

CREATE TABLE group_push_rules (
    id bigint NOT NULL,
    commit_message_regex character varying,
    deny_delete_tag boolean,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    author_email_regex character varying,
    member_check boolean DEFAULT false NOT NULL,
    file_name_regex character varying,
    max_file_size integer DEFAULT 0 NOT NULL,
    prevent_secrets boolean DEFAULT false NOT NULL,
    branch_name_regex character varying,
    reject_unsigned_commits boolean,
    commit_committer_check boolean,
    commit_message_negative_regex character varying,
    reject_non_dco_commits boolean,
    commit_committer_name_check boolean DEFAULT false NOT NULL,
    group_id bigint,
    CONSTRAINT author_email_regex_size_constraint CHECK ((char_length((author_email_regex)::text) <= 511)),
    CONSTRAINT branch_name_regex_size_constraint CHECK ((char_length((branch_name_regex)::text) <= 511)),
    CONSTRAINT commit_message_negative_regex_size_constraint CHECK ((char_length((commit_message_negative_regex)::text) <= 2047)),
    CONSTRAINT commit_message_regex_size_constraint CHECK ((char_length((commit_message_regex)::text) <= 511)),
    CONSTRAINT file_name_regex_size_constraint CHECK ((char_length((file_name_regex)::text) <= 511))
);
Edited by Vasilii Iakliushin