Remove summary id column too

This commit is contained in:
Jorge Manrubia
2025-04-30 10:18:02 +02:00
parent e7400fe129
commit 2d2cd702ca
4 changed files with 21 additions and 16 deletions
@@ -13,6 +13,7 @@ class FlattenMessagesAndComments < ActiveRecord::Migration[8.1]
)
SQL
remove_column :events, :summary_id
change_column_null :comments, :card_id, false
drop_table :messages
drop_table :event_summaries
Generated
+2 -3
View File
@@ -182,12 +182,11 @@ ActiveRecord::Schema[8.1].define(version: 2025_04_29_162506) do
t.integer "eventable_id", null: false
t.string "eventable_type", null: false
t.json "particulars", default: {}
t.integer "summary_id"
t.datetime "updated_at", null: false
t.index ["action"], name: "index_events_on_summary_id_and_action"
t.index ["collection_id"], name: "index_events_on_collection_id"
t.index ["creator_id"], name: "index_events_on_creator_id"
t.index ["eventable_type", "eventable_id"], name: "index_events_on_eventable"
t.index ["summary_id", "action"], name: "index_events_on_summary_id_and_action"
end
create_table "filters", force: :cascade do |t|
@@ -281,6 +280,7 @@ ActiveRecord::Schema[8.1].define(version: 2025_04_29_162506) do
t.datetime "created_at", null: false
t.string "title"
t.datetime "updated_at", null: false
t.index ["title"], name: "index_tags_on_account_id_and_title", unique: true
end
create_table "users", force: :cascade do |t|
@@ -329,7 +329,6 @@ ActiveRecord::Schema[8.1].define(version: 2025_04_29_162506) do
add_foreign_key "collections", "workflows"
add_foreign_key "comments", "cards"
add_foreign_key "events", "collections"
add_foreign_key "events", "event_summaries", column: "summary_id"
add_foreign_key "mentions", "users", column: "mentionee_id"
add_foreign_key "mentions", "users", column: "mentioner_id"
add_foreign_key "notifications", "users"
+17 -12
View File
@@ -594,16 +594,6 @@ columns:
default_function:
collation:
comment:
- !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column
auto_increment:
name: summary_id
cast_type: *1
sql_type_metadata: *2
'null': true
default:
default_function:
collation:
comment:
- *9
filters:
- *5
@@ -1565,7 +1555,6 @@ indexes:
name: index_events_on_summary_id_and_action
unique: false
columns:
- summary_id
- action
lengths: {}
orders: {}
@@ -1916,7 +1905,23 @@ indexes:
nulls_not_distinct:
comment:
valid: true
tags: []
tags:
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
table: tags
name: index_tags_on_account_id_and_title
unique: true
columns:
- title
lengths: {}
orders: {}
opclasses: {}
where:
type:
using:
include:
nulls_not_distinct:
comment:
valid: true
users:
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
table: users
+1 -1
View File
@@ -5,7 +5,7 @@ require_relative "../config/environment"
ApplicationRecord.with_each_tenant do |tenant|
Card.find_each do |card|
card.events.find_each do |event|
Card::Eventable::SystemCommenter.new(card, event).comment
Card::Eventable::SystemCommenter.new(card.reload, event).comment
end
end
end