Skip to content

Commit

Permalink
Merge pull request #5804 from WikiEducationFoundation/BigIntMwRevId
Browse files Browse the repository at this point in the history
Add handling for BigInt mw_rev_id
  • Loading branch information
ragesoss committed May 16, 2024
2 parents 06ef0e9 + fd40581 commit bca8685
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions db/migrate/20240515163420_change_mw_rev_id_size.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeMwRevIdSize < ActiveRecord::Migration[7.0]
def up
change_column :revisions, :mw_rev_id, :bigint
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_08_15_143028) do
ActiveRecord::Schema[7.0].define(version: 2024_05_15_163420) do
create_table "alerts", id: :integer, charset: "utf8mb4", force: :cascade do |t|
t.integer "course_id"
t.integer "user_id"
Expand Down Expand Up @@ -370,7 +370,7 @@
t.boolean "system", default: false
t.integer "ithenticate_id"
t.integer "wiki_id"
t.integer "mw_rev_id"
t.bigint "mw_rev_id"
t.integer "mw_page_id"
t.text "features"
t.text "features_previous"
Expand Down
11 changes: 11 additions & 0 deletions docs/analytics_scripts/ithenticate_revisions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Get the essential data about revisions flagged by the copyvio detection system
# since it can't be recreated if the revisions table is cleared.

Revision.where.not(ithenticate_id: nil).count

CSV.open('/home/sage/ithenticate_revisions.csv', 'wb') do |csv|
csv << ['mw_rev_id', 'ithenticate_id', 'wiki', 'article_title']
Revision.where.not(ithenticate_id: nil).each do |rev|
csv << [rev.mw_rev_id, rev.ithenticate_id, rev.wiki.domain, rev.article.title]
end
end

0 comments on commit bca8685

Please sign in to comment.