main
rb 22 lines 876 Bytes
Raw
1 class CreateGithubPrReviews < ActiveRecord::Migration[8.1]
2 def change
3 create_table :github_pr_reviews do |t|
4 t.references :github_app_installation, null: false, foreign_key: true
5 t.string :repo_full_name, null: false # "owner/repo" on github.com
6 t.integer :pr_number, null: false
7 t.string :head_sha, null: false
8 t.string :status, null: false, default: "pending"
9 t.string :skip_reason # "draft", "too_large", "superseded", ...
10 t.text :error_message
11 t.integer :comment_count
12 t.string :model # onde tier that produced the review
13 t.datetime :started_at
14 t.datetime :completed_at
15
16 t.timestamps
17 end
18
19 add_index :github_pr_reviews, [ :repo_full_name, :pr_number, :head_sha ],
20 unique: true, name: "index_github_pr_reviews_on_repo_pr_sha"
21 end
22 end