CREATE TABLE `project_git_repos` (
  `id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
  `project_id` BIGINT NOT NULL COMMENT '项目ID',
  `name` VARCHAR(50) NOT NULL COMMENT '仓库别名',
  `repo_url` VARCHAR(255) NOT NULL COMMENT 'Git仓库地址',
  `branch` VARCHAR(50) DEFAULT 'main' COMMENT 'Git分支',
  `username` VARCHAR(100) DEFAULT NULL COMMENT 'Git用户名',
  `token` VARCHAR(255) DEFAULT NULL COMMENT 'Git访问令牌/密码',
  `is_default` TINYINT DEFAULT 0 COMMENT '是否默认仓库',
  `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  INDEX `idx_project_id` (`project_id`),
  FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目Git仓库表';
