Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit bb8160b

Browse files
committed
Split create and copy
1 parent e87a4b7 commit bb8160b

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
#
3+
class CreateDiscourseSolvedSolvedTopics < ActiveRecord::Migration[7.2]
4+
def change
5+
create_table :discourse_solved_solved_topics do |t|
6+
t.integer :topic_id, null: false
7+
t.integer :answer_post_id, null: false
8+
t.integer :accepter_user_id, null: false
9+
t.integer :topic_timer_id
10+
t.timestamps
11+
end
12+
end
13+
end

db/migrate/20250318024953_copy_solved_topic_custom_field_to_discourse_solved_topics.rb renamed to db/migrate/20250318024953_copy_solved_topic_custom_field_to_discourse_solved_solved_topics.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
# frozen_string_literal: true
22
#
3-
class CopySolvedTopicCustomFieldToDiscourseSolvedTopics < ActiveRecord::Migration[7.2]
3+
class CopySolvedTopicCustomFieldToDiscourseSolvedSolvedTopics < ActiveRecord::Migration[7.2]
44
disable_ddl_transaction!
55

66
BATCH_SIZE = 5000
77

88
def up
9-
create_table :discourse_solved_solved_topics do |t|
10-
t.integer :topic_id, null: false
11-
t.integer :answer_post_id, null: false
12-
t.integer :accepter_user_id, null: false
13-
t.integer :topic_timer_id
14-
t.timestamps
15-
end
16-
179
last_id = 0
1810
loop do
1911
rows = DB.query(<<~SQL, last_id: last_id, batch_size: BATCH_SIZE)

0 commit comments

Comments
 (0)