Update primary keys on customer data to UUIDs

- schema changes to primary and foreign keys
- fixture changes
- customer data models subclass AccountScopedRecord
- import script updated
This commit is contained in:
Mike Dalessio
2025-11-11 15:05:47 -05:00
parent ab35c730d0
commit e4011ef211
64 changed files with 608 additions and 494 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
class Access < ApplicationRecord
class Access < AccountScopedRecord
belongs_to :board, touch: true
belongs_to :user, touch: true
+1 -1
View File
@@ -1,4 +1,4 @@
class Account < ApplicationRecord
class Account < AccountScopedRecord
include Entropic, Seedeable
has_one :join_code
+1 -1
View File
@@ -1,4 +1,4 @@
class Account::JoinCode < ApplicationRecord
class Account::JoinCode < AccountScopedRecord
CODE_LENGTH = 12
belongs_to :account
+5
View File
@@ -0,0 +1,5 @@
class AccountScopedRecord < ApplicationRecord
self.abstract_class = true
include UuidPrimaryKey
end
+1 -1
View File
@@ -1,4 +1,4 @@
class Assignment < ApplicationRecord
class Assignment < AccountScopedRecord
belongs_to :card, touch: true
belongs_to :assignee, class_name: "User"
+1 -1
View File
@@ -1,4 +1,4 @@
class Board < ApplicationRecord
class Board < AccountScopedRecord
include Accessible, AutoPostponing, Broadcastable, Cards, Entropic, Filterable, Publishable, Triageable
belongs_to :account, default: -> { Current.account }
+1 -1
View File
@@ -11,7 +11,7 @@ module Board::Accessible
end
def grant_to(users)
Access.insert_all Array(users).collect { |user| { board_id: proxy_association.owner.id, user_id: user.id } }
Access.insert_all Array(users).collect { |user| { id: SecureRandom.uuid_v7, board_id: proxy_association.owner.id, user_id: user.id } }
end
def revoke_from(users)
+1 -1
View File
@@ -1,4 +1,4 @@
class Board::Publication < ApplicationRecord
class Board::Publication < AccountScopedRecord
belongs_to :board
has_secure_token :key
+1 -1
View File
@@ -1,4 +1,4 @@
class Card < ApplicationRecord
class Card < AccountScopedRecord
include Assignable, Attachments, Broadcastable, Closeable, Colored, Entropic, Eventable,
Golden, Mentions, Multistep, Pinnable, Postponable, Promptable,
Readable, Searchable, Stallable, Statuses, Taggable, Triageable, Watchable
+1 -1
View File
@@ -1,3 +1,3 @@
class Card::ActivitySpike < ApplicationRecord
class Card::ActivitySpike < AccountScopedRecord
belongs_to :card, touch: true
end
+1 -1
View File
@@ -1,4 +1,4 @@
class Card::Engagement < ApplicationRecord
class Card::Engagement < AccountScopedRecord
belongs_to :card, class_name: "::Card", touch: true
validates :status, presence: true, inclusion: { in: %w[doing on_deck] }
+1 -1
View File
@@ -1,3 +1,3 @@
class Card::Goldness < ApplicationRecord
class Card::Goldness < AccountScopedRecord
belongs_to :card, touch: true
end
+1 -1
View File
@@ -1,4 +1,4 @@
class Card::NotNow < ApplicationRecord
class Card::NotNow < AccountScopedRecord
belongs_to :card, class_name: "::Card", touch: true
belongs_to :user, optional: true
end
+1 -1
View File
@@ -1,4 +1,4 @@
class Closure < ApplicationRecord
class Closure < AccountScopedRecord
belongs_to :card, touch: true
belongs_to :user, optional: true
end
+1 -1
View File
@@ -1,4 +1,4 @@
class Column < ApplicationRecord
class Column < AccountScopedRecord
include Colored, Positioned
belongs_to :account, default: -> { Current.account }
+1 -1
View File
@@ -1,4 +1,4 @@
class Comment < ApplicationRecord
class Comment < AccountScopedRecord
include Attachments, Eventable, Mentions, Promptable, Searchable
belongs_to :account, default: -> { Current.account }
+14
View File
@@ -0,0 +1,14 @@
module UuidPrimaryKey
extend ActiveSupport::Concern
included do
before_create :generate_uuid_primary_key
end
private
def generate_uuid_primary_key
return if id.present?
self.id = SecureRandom.uuid_v7
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
class Entropy < ApplicationRecord
class Entropy < AccountScopedRecord
belongs_to :container, polymorphic: true
after_commit -> { container.cards.touch_all }
+1 -1
View File
@@ -1,4 +1,4 @@
class Event < ApplicationRecord
class Event < AccountScopedRecord
include Notifiable, Particulars, Promptable
belongs_to :account, default: -> { Current.account }
+1 -1
View File
@@ -1,4 +1,4 @@
class Filter < ApplicationRecord
class Filter < AccountScopedRecord
include Fields, Params, Resources, Summarized
belongs_to :account, default: -> { Current.account }
+1 -1
View File
@@ -1,4 +1,4 @@
class Mention < ApplicationRecord
class Mention < AccountScopedRecord
include Notifiable
belongs_to :source, polymorphic: true
+1 -1
View File
@@ -1,4 +1,4 @@
class Notification < ApplicationRecord
class Notification < AccountScopedRecord
include PushNotifiable
belongs_to :account, default: -> { user.account }
+1 -1
View File
@@ -1,4 +1,4 @@
class Notification::Bundle < ApplicationRecord
class Notification::Bundle < AccountScopedRecord
belongs_to :account, default: -> { user.account }
belongs_to :user
+1 -1
View File
@@ -1,4 +1,4 @@
class Pin < ApplicationRecord
class Pin < AccountScopedRecord
belongs_to :card
belongs_to :user
+1 -1
View File
@@ -1,4 +1,4 @@
class Push::Subscription < ApplicationRecord
class Push::Subscription < AccountScopedRecord
belongs_to :account, default: -> { Current.account }
belongs_to :user
+1 -1
View File
@@ -1,4 +1,4 @@
class Reaction < ApplicationRecord
class Reaction < AccountScopedRecord
belongs_to :comment, touch: true
belongs_to :reacter, class_name: "User", default: -> { Current.user }
+1 -1
View File
@@ -1,4 +1,4 @@
class Search::Query < ApplicationRecord
class Search::Query < AccountScopedRecord
validates :terms, presence: true
before_validation :sanitize_terms
+1 -1
View File
@@ -1,4 +1,4 @@
class Search::Result < ApplicationRecord
class Search::Result < AccountScopedRecord
belongs_to :creator, class_name: "User"
belongs_to :card, foreign_key: :card_id, optional: true
belongs_to :comment, foreign_key: :comment_id, optional: true
+1 -1
View File
@@ -1,4 +1,4 @@
class Step < ApplicationRecord
class Step < AccountScopedRecord
belongs_to :account, default: -> { Current.account }
belongs_to :card, touch: true
+1 -1
View File
@@ -1,4 +1,4 @@
class Tag < ApplicationRecord
class Tag < AccountScopedRecord
include Attachable, Filterable
belongs_to :account, default: -> { Current.account }
+1 -1
View File
@@ -1,4 +1,4 @@
class Tagging < ApplicationRecord
class Tagging < AccountScopedRecord
belongs_to :tag
belongs_to :card, touch: true
end
+1 -1
View File
@@ -1,4 +1,4 @@
class User < ApplicationRecord
class User < AccountScopedRecord
include Accessor, Assignee, Attachable, Configurable,
Mentionable, Named, Notifiable, Role, Searcher, Watcher
include Timelined # Depends on Accessor
+1 -1
View File
@@ -12,6 +12,6 @@ module User::Accessor
private
def grant_access_to_boards
Access.insert_all account.boards.all_access.pluck(:id).collect { |board_id| { board_id: board_id, user_id: id } }
Access.insert_all account.boards.all_access.pluck(:id).collect { |board_id| { id: SecureRandom.uuid_v7, board_id: board_id, user_id: id } }
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
class User::Settings < ApplicationRecord
class User::Settings < AccountScopedRecord
belongs_to :user
enum :bundle_email_frequency, %i[ never every_few_hours daily weekly ],
+1 -1
View File
@@ -1,4 +1,4 @@
class Watch < ApplicationRecord
class Watch < AccountScopedRecord
belongs_to :user
belongs_to :card, touch: true
+1 -1
View File
@@ -1,4 +1,4 @@
class Webhook < ApplicationRecord
class Webhook < AccountScopedRecord
include Triggerable
SLACK_WEBHOOK_URL_REGEX = %r{//hooks\.slack\.com/services/T[^\/]+/B[^\/]+/[^\/]+\Z}i
+1 -1
View File
@@ -1,4 +1,4 @@
class Webhook::DelinquencyTracker < ApplicationRecord
class Webhook::DelinquencyTracker < AccountScopedRecord
DELINQUENCY_THRESHOLD = 10
DELINQUENCY_DURATION = 1.hour
+1 -1
View File
@@ -1,4 +1,4 @@
class Webhook::Delivery < ApplicationRecord
class Webhook::Delivery < AccountScopedRecord
STALE_TRESHOLD = 7.days
USER_AGENT = "fizzy/1.0.0 Webhook"
ENDPOINT_TIMEOUT = 7.seconds
@@ -0,0 +1,7 @@
# Inject UUID primary key support into Rails framework models
Rails.application.config.to_prepare do
ActionText::RichText.include UuidPrimaryKey
ActiveStorage::Attachment.include UuidPrimaryKey
ActiveStorage::Blob.include UuidPrimaryKey
ActiveStorage::VariantRecord.include UuidPrimaryKey
end
+116 -116
View File
@@ -1,20 +1,20 @@
class InitialSchema < ActiveRecord::Migration[8.2]
def change
create_table "accesses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "accesses", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.datetime "accessed_at"
t.bigint "board_id", null: false
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "involvement", default: "access_only", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["accessed_at"], name: "index_accesses_on_accessed_at", order: :desc
t.index ["board_id", "user_id"], name: "index_accesses_on_board_id_and_user_id", unique: true
t.index ["board_id"], name: "index_accesses_on_board_id"
t.index ["user_id"], name: "index_accesses_on_user_id"
end
create_table "account_join_codes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "account_join_codes", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "code", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -23,7 +23,7 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["code"], name: "index_account_join_codes_on_code", unique: true
end
create_table "accounts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "accounts", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.datetime "created_at", null: false
t.integer "external_account_id"
t.string "name", null: false
@@ -31,27 +31,27 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["external_account_id"], name: "index_accounts_on_external_account_id", unique: true
end
create_table "action_text_rich_texts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "action_text_rich_texts", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.text "body", size: :long
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_id", limit: 36, null: false
t.string "record_type", null: false
t.datetime "updated_at", null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "blob_id", null: false
create_table "active_storage_attachments", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "blob_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_id", limit: 36, null: false
t.string "record_type", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "active_storage_blobs", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "byte_size", null: false
t.string "checksum"
t.string "content_type"
@@ -63,38 +63,38 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "blob_id", null: false
create_table "active_storage_variant_records", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "blob_id", limit: 36, null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "assignees_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "assignee_id", null: false
t.bigint "filter_id", null: false
t.string "assignee_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["assignee_id"], name: "index_assignees_filters_on_assignee_id"
t.index ["filter_id"], name: "index_assignees_filters_on_filter_id"
end
create_table "assigners_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "assigner_id", null: false
t.bigint "filter_id", null: false
t.string "assigner_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["assigner_id"], name: "index_assigners_filters_on_assigner_id"
t.index ["filter_id"], name: "index_assigners_filters_on_filter_id"
end
create_table "assignments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "assignee_id", null: false
t.integer "assigner_id", null: false
t.bigint "card_id", null: false
create_table "assignments", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "assignee_id", limit: 36, null: false
t.string "assigner_id", limit: 36, null: false
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["assignee_id", "card_id"], name: "index_assignments_on_assignee_id_and_card_id", unique: true
t.index ["card_id"], name: "index_assignments_on_card_id"
end
create_table "board_publications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "board_id", null: false
create_table "board_publications", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "key"
t.datetime "updated_at", null: false
@@ -102,32 +102,32 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["key"], name: "index_board_publications_on_key", unique: true
end
create_table "boards", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "boards", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.boolean "all_access", default: false, null: false
t.datetime "created_at", null: false
t.bigint "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.string "name", null: false
t.datetime "updated_at", null: false
t.index ["creator_id"], name: "index_boards_on_creator_id"
end
create_table "boards_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "board_id", null: false
t.bigint "filter_id", null: false
t.string "board_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["board_id"], name: "index_boards_filters_on_board_id"
t.index ["filter_id"], name: "index_boards_filters_on_filter_id"
end
create_table "card_activity_spikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "card_activity_spikes", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_id"], name: "index_card_activity_spikes_on_card_id"
end
create_table "card_engagements", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id"
create_table "card_engagements", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36
t.datetime "created_at", null: false
t.string "status", default: "doing", null: false
t.datetime "updated_at", null: false
@@ -135,28 +135,28 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["status"], name: "index_card_engagements_on_status"
end
create_table "card_goldnesses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "card_goldnesses", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_id"], name: "index_card_goldnesses_on_card_id", unique: true
end
create_table "card_not_nows", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "card_not_nows", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id"
t.string "user_id", limit: 36
t.index ["card_id"], name: "index_card_not_nows_on_card_id", unique: true
t.index ["user_id"], name: "index_card_not_nows_on_user_id"
end
create_table "cards", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
t.bigint "board_id", null: false
t.bigint "column_id"
create_table "cards", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "board_id", limit: 36, null: false
t.string "column_id", limit: 36
t.datetime "created_at", null: false
t.integer "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.date "due_on"
t.datetime "last_active_at", null: false
t.string "status", default: "drafted", null: false
@@ -168,25 +168,25 @@ class InitialSchema < ActiveRecord::Migration[8.2]
end
create_table "closers_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "closer_id", null: false
t.integer "filter_id", null: false
t.string "closer_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["closer_id"], name: "index_closers_filters_on_closer_id"
t.index ["filter_id"], name: "index_closers_filters_on_filter_id"
end
create_table "closures", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "closures", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id"
t.string "user_id", limit: 36
t.index ["card_id", "created_at"], name: "index_closures_on_card_id_and_created_at"
t.index ["card_id"], name: "index_closures_on_card_id", unique: true
t.index ["user_id"], name: "index_closures_on_user_id"
end
create_table "columns", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
t.bigint "board_id", null: false
create_table "columns", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "board_id", limit: 36, null: false
t.string "color", null: false
t.datetime "created_at", null: false
t.string "name", null: false
@@ -196,25 +196,25 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["board_id"], name: "index_columns_on_board_id"
end
create_table "comments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
t.bigint "card_id", null: false
create_table "comments", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.integer "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.datetime "updated_at", null: false
t.index ["card_id"], name: "index_comments_on_card_id"
end
create_table "creators_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "creator_id", null: false
t.integer "filter_id", null: false
t.string "creator_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["creator_id"], name: "index_creators_filters_on_creator_id"
t.index ["filter_id"], name: "index_creators_filters_on_filter_id"
end
create_table "entropies", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "entropies", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "auto_postpone_period", default: 2592000, null: false
t.bigint "container_id", null: false
t.string "container_id", limit: 36, null: false
t.string "container_type", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -222,13 +222,13 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["container_type", "container_id"], name: "index_entropy_configurations_on_container", unique: true
end
create_table "events", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "events", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "action", null: false
t.bigint "board_id", null: false
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.bigint "creator_id", null: false
t.bigint "eventable_id", null: false
t.string "creator_id", limit: 36, null: false
t.string "eventable_id", limit: 36, null: false
t.string "eventable_type", null: false
t.json "particulars", default: -> { "(json_object())" }
t.datetime "updated_at", null: false
@@ -239,10 +239,10 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["eventable_type", "eventable_id"], name: "index_events_on_eventable"
end
create_table "filters", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "filters", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.bigint "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.json "fields", default: -> { "(json_object())" }, null: false
t.string "params_digest", null: false
t.datetime "updated_at", null: false
@@ -250,8 +250,8 @@ class InitialSchema < ActiveRecord::Migration[8.2]
end
create_table "filters_tags", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "filter_id", null: false
t.bigint "tag_id", null: false
t.string "filter_id", limit: 36, null: false
t.string "tag_id", limit: 36, null: false
t.index ["filter_id"], name: "index_filters_tags_on_filter_id"
t.index ["tag_id"], name: "index_filters_tags_on_tag_id"
end
@@ -285,11 +285,11 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["tenant"], name: "index_memberships_on_user_tenant_and_user_id"
end
create_table "mentions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "mentions", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.datetime "created_at", null: false
t.bigint "mentionee_id", null: false
t.bigint "mentioner_id", null: false
t.bigint "source_id", null: false
t.string "mentionee_id", limit: 36, null: false
t.string "mentioner_id", limit: 36, null: false
t.string "source_id", limit: 36, null: false
t.string "source_type", null: false
t.datetime "updated_at", null: false
t.index ["mentionee_id"], name: "index_mentions_on_mentionee_id"
@@ -297,53 +297,53 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["source_type", "source_id"], name: "index_mentions_on_source"
end
create_table "notification_bundles", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "notification_bundles", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.datetime "ends_at", null: false
t.datetime "starts_at", null: false
t.integer "status", default: 0, null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["ends_at", "status"], name: "index_notification_bundles_on_ends_at_and_status"
t.index ["user_id", "starts_at", "ends_at"], name: "idx_on_user_id_starts_at_ends_at_7eae5d3ac5"
t.index ["user_id", "status"], name: "index_notification_bundles_on_user_id_and_status"
end
create_table "notifications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "notifications", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.bigint "creator_id"
t.string "creator_id", limit: 36
t.datetime "read_at"
t.bigint "source_id", null: false
t.string "source_id", limit: 36, null: false
t.string "source_type", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["creator_id"], name: "index_notifications_on_creator_id"
t.index ["source_type", "source_id"], name: "index_notifications_on_source"
t.index ["user_id", "read_at", "created_at"], name: "index_notifications_on_user_id_and_read_at_and_created_at", order: { read_at: :desc, created_at: :desc }
t.index ["user_id"], name: "index_notifications_on_user_id"
end
create_table "pins", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "pins", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["card_id", "user_id"], name: "index_pins_on_card_id_and_user_id", unique: true
t.index ["card_id"], name: "index_pins_on_card_id"
t.index ["user_id"], name: "index_pins_on_user_id"
end
create_table "push_subscriptions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "push_subscriptions", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "auth_key"
t.datetime "created_at", null: false
t.string "endpoint"
t.string "p256dh_key"
t.datetime "updated_at", null: false
t.string "user_agent"
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["endpoint", "p256dh_key", "auth_key"], name: "idx_on_endpoint_p256dh_key_auth_key_7553014576"
t.index ["endpoint"], name: "index_push_subscriptions_on_endpoint"
t.index ["user_agent"], name: "index_push_subscriptions_on_user_agent"
@@ -351,27 +351,27 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["user_id"], name: "index_push_subscriptions_on_user_id"
end
create_table "reactions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "comment_id", null: false
create_table "reactions", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "comment_id", limit: 36, null: false
t.string "content", limit: 16, null: false
t.datetime "created_at", null: false
t.integer "reacter_id", null: false
t.string "reacter_id", limit: 36, null: false
t.datetime "updated_at", null: false
t.index ["comment_id"], name: "index_reactions_on_comment_id"
t.index ["reacter_id"], name: "index_reactions_on_reacter_id"
end
create_table "search_queries", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "search_queries", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.datetime "created_at", null: false
t.string "terms", limit: 2000, null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["user_id", "terms"], name: "index_search_queries_on_user_id_and_terms", length: { terms: 255 }
t.index ["user_id", "updated_at"], name: "index_search_queries_on_user_id_and_updated_at", unique: true
t.index ["user_id"], name: "index_search_queries_on_user_id"
end
create_table "search_results", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "search_results", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
@@ -385,9 +385,9 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["identity_id"], name: "index_sessions_on_identity_id"
end
create_table "steps", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
t.bigint "card_id", null: false
create_table "steps", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.string "card_id", limit: 36, null: false
t.boolean "completed", default: false, null: false
t.text "content", null: false
t.datetime "created_at", null: false
@@ -396,35 +396,35 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["card_id"], name: "index_steps_on_card_id"
end
create_table "taggings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "taggings", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.bigint "tag_id", null: false
t.string "tag_id", limit: 36, null: false
t.datetime "updated_at", null: false
t.index ["card_id", "tag_id"], name: "index_taggings_on_card_id_and_tag_id", unique: true
t.index ["tag_id"], name: "index_taggings_on_tag_id"
end
create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "tags", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.string "title"
t.datetime "updated_at", null: false
t.index ["title"], name: "index_tags_on_title", unique: true
end
create_table "user_settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "user_settings", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "bundle_email_frequency", default: 0, null: false
t.datetime "created_at", null: false
t.string "timezone_name"
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["user_id", "bundle_email_frequency"], name: "index_user_settings_on_user_id_and_bundle_email_frequency"
t.index ["user_id"], name: "index_user_settings_on_user_id"
end
create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "users", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.boolean "active", default: true, null: false
t.datetime "created_at", null: false
t.integer "membership_id"
@@ -435,42 +435,42 @@ class InitialSchema < ActiveRecord::Migration[8.2]
t.index ["role"], name: "index_users_on_role"
end
create_table "watches", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.bigint "card_id", null: false
create_table "watches", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.boolean "watching", default: true, null: false
t.index ["card_id"], name: "index_watches_on_card_id"
t.index ["user_id", "card_id"], name: "index_watches_on_user_id_and_card_id"
t.index ["user_id"], name: "index_watches_on_user_id"
end
create_table "webhook_delinquency_trackers", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "webhook_delinquency_trackers", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "consecutive_failures_count", default: 0
t.datetime "created_at", null: false
t.datetime "first_failure_at"
t.datetime "updated_at", null: false
t.bigint "webhook_id", null: false
t.string "webhook_id", limit: 36, null: false
t.index ["webhook_id"], name: "index_webhook_delinquency_trackers_on_webhook_id"
end
create_table "webhook_deliveries", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
create_table "webhook_deliveries", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.datetime "created_at", null: false
t.bigint "event_id", null: false
t.string "event_id", limit: 36, null: false
t.text "request"
t.text "response"
t.string "state", null: false
t.datetime "updated_at", null: false
t.bigint "webhook_id", null: false
t.string "webhook_id", limit: 36, null: false
t.index ["event_id"], name: "index_webhook_deliveries_on_event_id"
t.index ["webhook_id"], name: "index_webhook_deliveries_on_webhook_id"
end
create_table "webhooks", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.integer "account_id"
create_table "webhooks", id: :string, limit: 36, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci" do |t|
t.string "account_id", limit: 36
t.boolean "active", default: true, null: false
t.bigint "board_id", null: false
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "name"
t.string "signing_secret", null: false
Generated
+116 -116
View File
@@ -11,21 +11,21 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
create_table "accesses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "accesses", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "accessed_at"
t.bigint "board_id", null: false
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "involvement", default: "access_only", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["accessed_at"], name: "index_accesses_on_accessed_at", order: :desc
t.index ["board_id", "user_id"], name: "index_accesses_on_board_id_and_user_id", unique: true
t.index ["board_id"], name: "index_accesses_on_board_id"
t.index ["user_id"], name: "index_accesses_on_user_id"
end
create_table "account_join_codes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "account_join_codes", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "code", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -34,7 +34,7 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["code"], name: "index_account_join_codes_on_code", unique: true
end
create_table "accounts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "accounts", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "cards_count", default: 0, null: false
t.datetime "created_at", null: false
t.integer "external_account_id"
@@ -43,27 +43,27 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["external_account_id"], name: "index_accounts_on_external_account_id", unique: true
end
create_table "action_text_rich_texts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "action_text_rich_texts", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.text "body", size: :long
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_id", limit: 36, null: false
t.string "record_type", null: false
t.datetime "updated_at", null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "blob_id", null: false
create_table "active_storage_attachments", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "blob_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "name", null: false
t.bigint "record_id", null: false
t.string "record_id", limit: 36, null: false
t.string "record_type", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "active_storage_blobs", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "byte_size", null: false
t.string "checksum"
t.string "content_type"
@@ -75,38 +75,38 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "blob_id", null: false
create_table "active_storage_variant_records", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "blob_id", limit: 36, null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "assignees_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "assignee_id", null: false
t.bigint "filter_id", null: false
t.string "assignee_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["assignee_id"], name: "index_assignees_filters_on_assignee_id"
t.index ["filter_id"], name: "index_assignees_filters_on_filter_id"
end
create_table "assigners_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "assigner_id", null: false
t.bigint "filter_id", null: false
t.string "assigner_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["assigner_id"], name: "index_assigners_filters_on_assigner_id"
t.index ["filter_id"], name: "index_assigners_filters_on_filter_id"
end
create_table "assignments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "assignee_id", null: false
t.integer "assigner_id", null: false
t.bigint "card_id", null: false
create_table "assignments", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "assignee_id", limit: 36, null: false
t.string "assigner_id", limit: 36, null: false
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["assignee_id", "card_id"], name: "index_assignments_on_assignee_id_and_card_id", unique: true
t.index ["card_id"], name: "index_assignments_on_card_id"
end
create_table "board_publications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "board_id", null: false
create_table "board_publications", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "key"
t.datetime "updated_at", null: false
@@ -114,32 +114,32 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["key"], name: "index_board_publications_on_key", unique: true
end
create_table "boards", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "boards", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.boolean "all_access", default: false, null: false
t.datetime "created_at", null: false
t.bigint "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.string "name", null: false
t.datetime "updated_at", null: false
t.index ["creator_id"], name: "index_boards_on_creator_id"
end
create_table "boards_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "board_id", null: false
t.bigint "filter_id", null: false
t.string "board_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["board_id"], name: "index_boards_filters_on_board_id"
t.index ["filter_id"], name: "index_boards_filters_on_filter_id"
end
create_table "card_activity_spikes", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "card_activity_spikes", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_id"], name: "index_card_activity_spikes_on_card_id"
end
create_table "card_engagements", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id"
create_table "card_engagements", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36
t.datetime "created_at", null: false
t.string "status", default: "doing", null: false
t.datetime "updated_at", null: false
@@ -147,28 +147,28 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["status"], name: "index_card_engagements_on_status"
end
create_table "card_goldnesses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "card_goldnesses", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_id"], name: "index_card_goldnesses_on_card_id", unique: true
end
create_table "card_not_nows", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "card_not_nows", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id"
t.string "user_id", limit: 36
t.index ["card_id"], name: "index_card_not_nows_on_card_id", unique: true
t.index ["user_id"], name: "index_card_not_nows_on_user_id"
end
create_table "cards", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
t.bigint "board_id", null: false
t.bigint "column_id"
create_table "cards", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "board_id", limit: 36, null: false
t.string "column_id", limit: 36
t.datetime "created_at", null: false
t.integer "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.date "due_on"
t.datetime "last_active_at", null: false
t.bigint "number", null: false
@@ -182,25 +182,25 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
end
create_table "closers_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "closer_id", null: false
t.integer "filter_id", null: false
t.string "closer_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["closer_id"], name: "index_closers_filters_on_closer_id"
t.index ["filter_id"], name: "index_closers_filters_on_filter_id"
end
create_table "closures", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "closures", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id"
t.string "user_id", limit: 36
t.index ["card_id", "created_at"], name: "index_closures_on_card_id_and_created_at"
t.index ["card_id"], name: "index_closures_on_card_id", unique: true
t.index ["user_id"], name: "index_closures_on_user_id"
end
create_table "columns", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
t.bigint "board_id", null: false
create_table "columns", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "board_id", limit: 36, null: false
t.string "color", null: false
t.datetime "created_at", null: false
t.string "name", null: false
@@ -210,25 +210,25 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["board_id"], name: "index_columns_on_board_id"
end
create_table "comments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
t.bigint "card_id", null: false
create_table "comments", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.integer "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.datetime "updated_at", null: false
t.index ["card_id"], name: "index_comments_on_card_id"
end
create_table "creators_filters", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "creator_id", null: false
t.integer "filter_id", null: false
t.string "creator_id", limit: 36, null: false
t.string "filter_id", limit: 36, null: false
t.index ["creator_id"], name: "index_creators_filters_on_creator_id"
t.index ["filter_id"], name: "index_creators_filters_on_filter_id"
end
create_table "entropies", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "entropies", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "auto_postpone_period", default: 2592000, null: false
t.bigint "container_id", null: false
t.string "container_id", limit: 36, null: false
t.string "container_type", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -236,13 +236,13 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["container_type", "container_id"], name: "index_entropy_configurations_on_container", unique: true
end
create_table "events", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "events", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "action", null: false
t.bigint "board_id", null: false
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.bigint "creator_id", null: false
t.bigint "eventable_id", null: false
t.string "creator_id", limit: 36, null: false
t.string "eventable_id", limit: 36, null: false
t.string "eventable_type", null: false
t.json "particulars", default: -> { "(json_object())" }
t.datetime "updated_at", null: false
@@ -253,10 +253,10 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["eventable_type", "eventable_id"], name: "index_events_on_eventable"
end
create_table "filters", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "filters", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.bigint "creator_id", null: false
t.string "creator_id", limit: 36, null: false
t.json "fields", default: -> { "(json_object())" }, null: false
t.string "params_digest", null: false
t.datetime "updated_at", null: false
@@ -264,8 +264,8 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
end
create_table "filters_tags", id: false, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "filter_id", null: false
t.bigint "tag_id", null: false
t.string "filter_id", limit: 36, null: false
t.string "tag_id", limit: 36, null: false
t.index ["filter_id"], name: "index_filters_tags_on_filter_id"
t.index ["tag_id"], name: "index_filters_tags_on_tag_id"
end
@@ -298,11 +298,11 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["tenant"], name: "index_memberships_on_user_tenant_and_user_id"
end
create_table "mentions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "mentions", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "created_at", null: false
t.bigint "mentionee_id", null: false
t.bigint "mentioner_id", null: false
t.bigint "source_id", null: false
t.string "mentionee_id", limit: 36, null: false
t.string "mentioner_id", limit: 36, null: false
t.string "source_id", limit: 36, null: false
t.string "source_type", null: false
t.datetime "updated_at", null: false
t.index ["mentionee_id"], name: "index_mentions_on_mentionee_id"
@@ -310,53 +310,53 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["source_type", "source_id"], name: "index_mentions_on_source"
end
create_table "notification_bundles", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "notification_bundles", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.datetime "ends_at", null: false
t.datetime "starts_at", null: false
t.integer "status", default: 0, null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["ends_at", "status"], name: "index_notification_bundles_on_ends_at_and_status"
t.index ["user_id", "starts_at", "ends_at"], name: "idx_on_user_id_starts_at_ends_at_7eae5d3ac5"
t.index ["user_id", "status"], name: "index_notification_bundles_on_user_id_and_status"
end
create_table "notifications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "notifications", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.bigint "creator_id"
t.string "creator_id", limit: 36
t.datetime "read_at"
t.bigint "source_id", null: false
t.string "source_id", limit: 36, null: false
t.string "source_type", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["creator_id"], name: "index_notifications_on_creator_id"
t.index ["source_type", "source_id"], name: "index_notifications_on_source"
t.index ["user_id", "read_at", "created_at"], name: "index_notifications_on_user_id_and_read_at_and_created_at", order: { read_at: :desc, created_at: :desc }
t.index ["user_id"], name: "index_notifications_on_user_id"
end
create_table "pins", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "pins", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["card_id", "user_id"], name: "index_pins_on_card_id_and_user_id", unique: true
t.index ["card_id"], name: "index_pins_on_card_id"
t.index ["user_id"], name: "index_pins_on_user_id"
end
create_table "push_subscriptions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "push_subscriptions", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "auth_key"
t.datetime "created_at", null: false
t.string "endpoint"
t.string "p256dh_key"
t.datetime "updated_at", null: false
t.string "user_agent"
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["endpoint", "p256dh_key", "auth_key"], name: "idx_on_endpoint_p256dh_key_auth_key_7553014576"
t.index ["endpoint"], name: "index_push_subscriptions_on_endpoint"
t.index ["user_agent"], name: "index_push_subscriptions_on_user_agent"
@@ -364,11 +364,11 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["user_id"], name: "index_push_subscriptions_on_user_id"
end
create_table "reactions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "comment_id", null: false
create_table "reactions", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "comment_id", limit: 36, null: false
t.string "content", limit: 16, null: false
t.datetime "created_at", null: false
t.integer "reacter_id", null: false
t.string "reacter_id", limit: 36, null: false
t.datetime "updated_at", null: false
t.index ["comment_id"], name: "index_reactions_on_comment_id"
t.index ["reacter_id"], name: "index_reactions_on_reacter_id"
@@ -566,17 +566,17 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["searchable_type", "searchable_id"], name: "idx_si9_type_id", unique: true
end
create_table "search_queries", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "search_queries", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "terms", limit: 2000, null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["user_id", "terms"], name: "index_search_queries_on_user_id_and_terms", length: { terms: 255 }
t.index ["user_id", "updated_at"], name: "index_search_queries_on_user_id_and_updated_at", unique: true
t.index ["user_id"], name: "index_search_queries_on_user_id"
end
create_table "search_results", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "search_results", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
@@ -590,9 +590,9 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["identity_id"], name: "index_sessions_on_identity_id"
end
create_table "steps", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
t.bigint "card_id", null: false
create_table "steps", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.string "card_id", limit: 36, null: false
t.boolean "completed", default: false, null: false
t.text "content", null: false
t.datetime "created_at", null: false
@@ -601,35 +601,35 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["card_id"], name: "index_steps_on_card_id"
end
create_table "taggings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "taggings", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.bigint "tag_id", null: false
t.string "tag_id", limit: 36, null: false
t.datetime "updated_at", null: false
t.index ["card_id", "tag_id"], name: "index_taggings_on_card_id_and_tag_id", unique: true
t.index ["tag_id"], name: "index_taggings_on_tag_id"
end
create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "tags", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.datetime "created_at", null: false
t.string "title"
t.datetime "updated_at", null: false
t.index ["title"], name: "index_tags_on_title", unique: true
end
create_table "user_settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "user_settings", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "bundle_email_frequency", default: 0, null: false
t.datetime "created_at", null: false
t.string "timezone_name"
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.index ["user_id", "bundle_email_frequency"], name: "index_user_settings_on_user_id_and_bundle_email_frequency"
t.index ["user_id"], name: "index_user_settings_on_user_id"
end
create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "users", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.boolean "active", default: true, null: false
t.datetime "created_at", null: false
t.integer "membership_id"
@@ -640,42 +640,42 @@ ActiveRecord::Schema[8.2].define(version: 2025_11_12_184932) do
t.index ["role"], name: "index_users_on_role"
end
create_table "watches", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "card_id", null: false
create_table "watches", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "card_id", limit: 36, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.string "user_id", limit: 36, null: false
t.boolean "watching", default: true, null: false
t.index ["card_id"], name: "index_watches_on_card_id"
t.index ["user_id", "card_id"], name: "index_watches_on_user_id_and_card_id"
t.index ["user_id"], name: "index_watches_on_user_id"
end
create_table "webhook_delinquency_trackers", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "webhook_delinquency_trackers", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "consecutive_failures_count", default: 0
t.datetime "created_at", null: false
t.datetime "first_failure_at"
t.datetime "updated_at", null: false
t.bigint "webhook_id", null: false
t.string "webhook_id", limit: 36, null: false
t.index ["webhook_id"], name: "index_webhook_delinquency_trackers_on_webhook_id"
end
create_table "webhook_deliveries", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
create_table "webhook_deliveries", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "created_at", null: false
t.bigint "event_id", null: false
t.string "event_id", limit: 36, null: false
t.text "request"
t.text "response"
t.string "state", null: false
t.datetime "updated_at", null: false
t.bigint "webhook_id", null: false
t.string "webhook_id", limit: 36, null: false
t.index ["event_id"], name: "index_webhook_deliveries_on_event_id"
t.index ["webhook_id"], name: "index_webhook_deliveries_on_webhook_id"
end
create_table "webhooks", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.integer "account_id"
create_table "webhooks", id: { type: :string, limit: 36 }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "account_id", limit: 36
t.boolean "active", default: true, null: false
t.bigint "board_id", null: false
t.string "board_id", limit: 36, null: false
t.datetime "created_at", null: false
t.string "name"
t.string "signing_secret", null: false
+19 -28
View File
@@ -100,6 +100,10 @@ class Import
result
end
def generate_uuid
SecureRandom.uuid_v7
end
def setup_account
step("Setting up account", "Account set up in %{duration}") do
oldest_admin = import.users.order(id: :asc).where(role: :admin, active: true).first
@@ -229,8 +233,6 @@ class Import
mapping[:cards] ||= {}
account.update_columns(cards_count: import.cards.maximum(:id) || 0)
next_id = (Card.maximum(:id) || 0) + 1
activity_spikes_to_insert = []
engagements_to_insert = []
goldnesses_to_insert = []
@@ -242,8 +244,7 @@ class Import
cards_to_insert = []
batch.each do |old_card|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:cards][old_card.id] = new_id
# Map old 'creating' status to 'drafted' since it's no longer a valid enum value
@@ -267,6 +268,7 @@ class Import
old_activity_spike = old_card.activity_spike
if old_activity_spike
activity_spikes_to_insert << {
id: generate_uuid,
card_id: new_id,
created_at: old_activity_spike.created_at,
updated_at: old_activity_spike.updated_at
@@ -276,6 +278,7 @@ class Import
old_engagement = old_card.engagement
if old_engagement
engagements_to_insert << {
id: generate_uuid,
card_id: new_id,
status: old_engagement.status,
created_at: old_engagement.created_at,
@@ -286,6 +289,7 @@ class Import
old_goldness = old_card.goldness
if old_goldness
goldnesses_to_insert << {
id: generate_uuid,
card_id: new_id,
created_at: old_goldness.created_at,
updated_at: old_goldness.updated_at
@@ -295,6 +299,7 @@ class Import
old_not_now = old_card.not_now
if old_not_now
not_nows_to_insert << {
id: generate_uuid,
card_id: new_id,
user_id: old_not_now.user_id ? mapping[:users][old_not_now.user_id] : nil,
created_at: old_not_now.created_at,
@@ -304,6 +309,7 @@ class Import
old_card.assignments.each do |old_assignment|
assignments_to_insert << {
id: generate_uuid,
card_id: new_id,
assignee_id: mapping[:users][old_assignment.assignee_id],
assigner_id: mapping[:users][old_assignment.assigner_id],
@@ -315,6 +321,7 @@ class Import
old_closure = old_card.closure
if old_closure
closures_to_insert << {
id: generate_uuid,
card_id: new_id,
user_id: old_closure.user_id ? mapping[:users][old_closure.user_id] : nil,
created_at: old_closure.created_at,
@@ -368,14 +375,12 @@ class Import
def copy_comments
step("Copying comments", "Copied %{count} comments in %{duration}") do
mapping[:comments] ||= {}
next_id = (Comment.maximum(:id) || 0) + 1
import.comments.in_batches(of: 1000) do |batch|
comments_to_insert = []
batch.each do |old_comment|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:comments][old_comment.id] = new_id
comments_to_insert << {
@@ -425,14 +430,12 @@ class Import
def copy_accesses
step("Copying accesses", "Copied %{count} accesses in %{duration}") do
mapping[:accesses] ||= {}
next_id = (Access.maximum(:id) || 0) + 1
import.accesses.in_batches(of: 1000) do |batch|
accesses_to_insert = []
batch.each do |old_access|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:accesses][old_access.id] = new_id
accesses_to_insert << {
@@ -456,14 +459,12 @@ class Import
def copy_notifications
step("Copying notifications", "Copied %{count} notifications in %{duration}") do
mapping[:notifications] ||= {}
next_id = (Notification.maximum(:id) || 0) + 1
import.notifications.in_batches(of: 1000) do |batch|
notifications_to_insert = []
batch.each do |old_notification|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:notifications][old_notification.id] = new_id
notifications_to_insert << {
@@ -489,14 +490,12 @@ class Import
def copy_notification_bundles
step("Copying notification bundles", "Copied %{count} notification bundles in %{duration}") do
mapping[:notification_bundles] ||= {}
next_id = (Notification::Bundle.maximum(:id) || 0) + 1
import.notification_bundles.in_batches(of: 1000) do |batch|
bundles_to_insert = []
batch.each do |old_bundle|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:notification_bundles][old_bundle.id] = new_id
bundles_to_insert << {
@@ -542,15 +541,13 @@ class Import
def copy_filters
step("Copying filters", "Copied %{count} filters in %{duration}") do
mapping[:filters] ||= {}
next_id = (Filter.maximum(:id) || 0) + 1
# First, insert all filters
import.filters.in_batches(of: 1000) do |batch|
filters_to_insert = []
batch.each do |old_filter|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:filters][old_filter.id] = new_id
filters_to_insert << {
@@ -600,14 +597,12 @@ class Import
def copy_events
step("Copying events", "Copied %{count} events in %{duration}") do
mapping[:events] ||= {}
next_id = (Event.maximum(:id) || 0) + 1
import.events.in_batches(of: 1000) do |batch|
events_to_insert = []
batch.each do |old_event|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:events][old_event.id] = new_id
events_to_insert << {
@@ -765,14 +760,12 @@ class Import
def copy_watches
step("Copying watches", "Copied %{count} watches in %{duration}") do
mapping[:watches] ||= {}
next_id = (Watch.maximum(:id) || 0) + 1
import.watches.in_batches(of: 1000) do |batch|
watches_to_insert = []
batch.each do |old_watch|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:watches][old_watch.id] = new_id
watches_to_insert << {
@@ -795,14 +788,12 @@ class Import
def copy_pins
step("Copying pins", "Copied %{count} pins in %{duration}") do
mapping[:pins] ||= {}
next_id = (Pin.maximum(:id) || 0) + 1
import.pins.in_batches(of: 1000) do |batch|
pins_to_insert = []
batch.each do |old_pin|
new_id = next_id
next_id += 1
new_id = generate_uuid
mapping[:pins][old_pin.id] = new_id
pins_to_insert << {
+12 -8
View File
@@ -1,15 +1,19 @@
writebook_david:
board: writebook
user: david
id: <%= ActiveRecord::FixtureSet.identify("writebook_david", :uuid) %>
board: writebook_uuid
user: david_uuid
writebook_jz:
board: writebook
user: jz
id: <%= ActiveRecord::FixtureSet.identify("writebook_jz", :uuid) %>
board: writebook_uuid
user: jz_uuid
writebook_kevin:
board: writebook
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("writebook_kevin", :uuid) %>
board: writebook_uuid
user: kevin_uuid
private_kevin:
board: private
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("private_kevin", :uuid) %>
board: private_uuid
user: kevin_uuid
+2
View File
@@ -1,9 +1,11 @@
37s:
id: <%= ActiveRecord::FixtureSet.identify("37s", :uuid) %>
name: 37signals
external_account_id: <%= ActiveRecord::FixtureSet.identify("37signals") %>
cards_count: 5
initech:
id: <%= ActiveRecord::FixtureSet.identify("initech", :uuid) %>
name: Initech LLC
external_account_id: <%= ActiveRecord::FixtureSet.identify("initech") %>
cards_count: 0
+3 -3
View File
@@ -1,15 +1,15 @@
logo_agreement_jz:
record: logo_agreement_jz (Comment)
record: logo_agreement_jz_uuid (Comment)
name: body
body: I agree.
logo_agreement_kevin:
record: logo_agreement_kevin (Comment)
record: logo_agreement_kevin_uuid (Comment)
name: body
body: Same, lets do it.
layout_overflowing_david:
record: layout_overflowing_david (Comment)
record: layout_overflowing_david_uuid (Comment)
name: body
body: The text is overflowing the container.
+12 -9
View File
@@ -1,16 +1,19 @@
logo_jz:
assigner: david
assignee: jz
card: logo
id: <%= ActiveRecord::FixtureSet.identify("logo_jz", :uuid) %>
assigner: david_uuid
assignee: jz_uuid
card: logo_uuid
created_at: <%= 1.week.ago %>
logo_kevin:
assigner: david
assignee: kevin
card: logo
id: <%= ActiveRecord::FixtureSet.identify("logo_kevin", :uuid) %>
assigner: david_uuid
assignee: kevin_uuid
card: logo_uuid
created_at: <%= 1.day.ago %>
layout_jz:
assigner: david
assignee: jz
card: layout
id: <%= ActiveRecord::FixtureSet.identify("layout_jz", :uuid) %>
assigner: david_uuid
assignee: jz_uuid
card: layout_uuid
+9 -6
View File
@@ -1,17 +1,20 @@
writebook:
id: <%= ActiveRecord::FixtureSet.identify("writebook", :uuid) %>
name: Writebook
creator: david
creator: david_uuid
all_access: true
account: 37s
account: 37s_uuid
private:
id: <%= ActiveRecord::FixtureSet.identify("private", :uuid) %>
name: Private board
creator: kevin
creator: kevin_uuid
all_access: false
account: 37s
account: 37s_uuid
staplers:
id: <%= ActiveRecord::FixtureSet.identify("staplers", :uuid) %>
name: Staplers
creator: mike
creator: mike_uuid
all_access: true
account: initech
account: initech_uuid
+24 -19
View File
@@ -1,55 +1,60 @@
logo:
id: <%= ActiveRecord::FixtureSet.identify("logo", :uuid) %>
number: 1
board: writebook
creator: david
column: writebook_triage
board: writebook_uuid
creator: david_uuid
column: writebook_triage_uuid
title: The logo isn't big enough
due_on: <%= 3.days.from_now %>
created_at: <%= 1.week.ago %>
status: published
last_active_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
layout:
id: <%= ActiveRecord::FixtureSet.identify("layout", :uuid) %>
number: 2
board: writebook
creator: david
column: writebook_triage
board: writebook_uuid
creator: david_uuid
column: writebook_triage_uuid
title: Layout is broken
created_at: <%= 1.week.ago %>
status: published
last_active_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
text:
id: <%= ActiveRecord::FixtureSet.identify("text", :uuid) %>
number: 3
board: writebook
creator: kevin
column: writebook_in_progress
board: writebook_uuid
creator: kevin_uuid
column: writebook_in_progress_uuid
title: The text is too small
created_at: <%= 1.week.ago %>
status: published
last_active_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
shipping:
id: <%= ActiveRecord::FixtureSet.identify("shipping", :uuid) %>
number: 4
board: writebook
creator: kevin
column: writebook_triage
board: writebook_uuid
creator: kevin_uuid
column: writebook_triage_uuid
title: We need to ship the app
created_at: <%= 1.week.ago %>
status: published
last_active_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
buy_domain:
id: <%= ActiveRecord::FixtureSet.identify("buy_domain", :uuid) %>
number: 5
board: writebook
creator: david
board: writebook_uuid
creator: david_uuid
title: Buy domain
created_at: <%= 1.week.ago %>
status: published
last_active_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
+3 -2
View File
@@ -1,3 +1,4 @@
shipping:
card: shipping
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("shipping_closure", :uuid) %>
card: shipping_uuid
user: kevin_uuid
+12 -8
View File
@@ -1,28 +1,32 @@
# Columns for writebook board (which has qa workflow)
writebook_triage:
id: <%= ActiveRecord::FixtureSet.identify("writebook_triage", :uuid) %>
name: Triage
color: "var(--color-card-4)"
board: writebook
board: writebook_uuid
position: 0
account: 37s
account: 37s_uuid
writebook_in_progress:
id: <%= ActiveRecord::FixtureSet.identify("writebook_in_progress", :uuid) %>
name: In progress
color: "var(--color-card-2)"
board: writebook
board: writebook_uuid
position: 1
account: 37s
account: 37s_uuid
writebook_on_hold:
id: <%= ActiveRecord::FixtureSet.identify("writebook_on_hold", :uuid) %>
name: On Hold
color: "var(--color-card-4)"
board: writebook
board: writebook_uuid
position: 2
account: 37s
account: 37s_uuid
writebook_review:
id: <%= ActiveRecord::FixtureSet.identify("writebook_review", :uuid) %>
name: Review
color: "var(--color-card-3)"
board: writebook
board: writebook_uuid
position: 3
account: 37s
account: 37s_uuid
+36 -27
View File
@@ -1,49 +1,58 @@
logo_1:
card: logo
creator: system
id: <%= ActiveRecord::FixtureSet.identify("logo_1", :uuid) %>
card: logo_uuid
creator: system_uuid
created_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
logo_agreement_jz:
card: logo
creator: jz
id: <%= ActiveRecord::FixtureSet.identify("logo_agreement_jz", :uuid) %>
card: logo_uuid
creator: jz_uuid
created_at: <%= 2.days.ago %>
account: 37s
account: 37s_uuid
logo_3:
card: logo
creator: system
id: <%= ActiveRecord::FixtureSet.identify("logo_3", :uuid) %>
card: logo_uuid
creator: system_uuid
created_at: <%= 1.day.ago %>
account: 37s
account: 37s_uuid
logo_agreement_kevin:
card: logo
creator: kevin
id: <%= ActiveRecord::FixtureSet.identify("logo_agreement_kevin", :uuid) %>
card: logo_uuid
creator: kevin_uuid
created_at: <%= 2.hours.ago %>
account: 37s
account: 37s_uuid
logo_5:
card: logo
creator: system
id: <%= ActiveRecord::FixtureSet.identify("logo_5", :uuid) %>
card: logo_uuid
creator: system_uuid
created_at: <%= 1.hour.ago %>
account: 37s
account: 37s_uuid
layout_1:
card: layout
creator: system
account: 37s
id: <%= ActiveRecord::FixtureSet.identify("layout_1", :uuid) %>
card: layout_uuid
creator: system_uuid
account: 37s_uuid
layout_overflowing_david:
card: layout
creator: david
account: 37s
id: <%= ActiveRecord::FixtureSet.identify("layout_overflowing_david", :uuid) %>
card: layout_uuid
creator: david_uuid
account: 37s_uuid
text_1:
card: text
creator: system
account: 37s
id: <%= ActiveRecord::FixtureSet.identify("text_1", :uuid) %>
card: text_uuid
creator: system_uuid
account: 37s_uuid
shipping_1:
card: shipping
creator: system
account: 37s
id: <%= ActiveRecord::FixtureSet.identify("shipping_1", :uuid) %>
card: shipping_uuid
creator: system_uuid
account: 37s_uuid
+6 -3
View File
@@ -1,11 +1,14 @@
37s_account:
container: 37s (Account)
id: <%= ActiveRecord::FixtureSet.identify("37s_account", :uuid) %>
container: 37s_uuid (Account)
auto_postpone_period: <%= 30.days.to_i %>
writebook_board:
container: writebook (Board)
id: <%= ActiveRecord::FixtureSet.identify("writebook_board", :uuid) %>
container: writebook_uuid (Board)
auto_postpone_period: <%= 90.days.to_i %>
private_board:
container: private (Board)
id: <%= ActiveRecord::FixtureSet.identify("private_board", :uuid) %>
container: private_uuid (Board)
auto_postpone_period: <%= 30.days.to_i %>
+54 -44
View File
@@ -1,83 +1,93 @@
logo_published:
creator: david
board: writebook
eventable: logo (Card)
id: <%= ActiveRecord::FixtureSet.identify("logo_published", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_published
created_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
logo_assignment_jz:
creator: david
board: writebook
eventable: logo (Card)
id: <%= ActiveRecord::FixtureSet.identify("logo_assignment_jz", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }.to_json %>
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }.to_json %>
created_at: <%= 1.week.ago + 1.hour %>
account: 37s
account: 37s_uuid
logo_assignment_david:
creator: david
board: writebook
eventable: logo (Card)
id: <%= ActiveRecord::FixtureSet.identify("logo_assignment_david", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:david) ] }.to_json %>
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("david", :uuid) ] }.to_json %>
created_at: <%= 1.week.ago + 1.hour %>
account: 37s
account: 37s_uuid
logo_assignment_km:
creator: david
board: writebook
eventable: logo (Card)
id: <%= ActiveRecord::FixtureSet.identify("logo_assignment_km", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: logo_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:kevin) ] }.to_json %>
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("kevin", :uuid) ] }.to_json %>
created_at: <%= 1.day.ago %>
account: 37s
account: 37s_uuid
layout_published:
creator: david
board: writebook
eventable: layout (Card)
id: <%= ActiveRecord::FixtureSet.identify("layout_published", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: layout_uuid (Card)
action: card_published
created_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
layout_commented:
creator: david
board: writebook
eventable: layout_overflowing_david (Comment)
id: <%= ActiveRecord::FixtureSet.identify("layout_commented", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: layout_overflowing_david_uuid (Comment)
action: comment_created
created_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
layout_assignment_jz:
creator: david
board: writebook
eventable: layout (Card)
id: <%= ActiveRecord::FixtureSet.identify("layout_assignment_jz", :uuid) %>
creator: david_uuid
board: writebook_uuid
eventable: layout_uuid (Card)
action: card_assigned
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }.to_json %>
particulars: <%= { assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }.to_json %>
created_at: <%= 1.hour.ago %>
account: 37s
account: 37s_uuid
text_published:
creator: kevin
board: writebook
eventable: text (Card)
id: <%= ActiveRecord::FixtureSet.identify("text_published", :uuid) %>
creator: kevin_uuid
board: writebook_uuid
eventable: text_uuid (Card)
action: card_published
created_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
shipping_published:
creator: kevin
board: writebook
eventable: shipping (Card)
id: <%= ActiveRecord::FixtureSet.identify("shipping_published", :uuid) %>
creator: kevin_uuid
board: writebook_uuid
eventable: shipping_uuid (Card)
action: card_published
created_at: <%= 1.week.ago %>
account: 37s
account: 37s_uuid
shipping_closed:
creator: kevin
board: writebook
eventable: shipping (Card)
id: <%= ActiveRecord::FixtureSet.identify("shipping_closed", :uuid) %>
creator: kevin_uuid
board: writebook_uuid
eventable: shipping_uuid (Card)
action: card_closed
created_at: <%= 2.days.ago %>
account: 37s
account: 37s_uuid
+4 -3
View File
@@ -1,7 +1,8 @@
jz_assignments:
creator: david
id: <%= ActiveRecord::FixtureSet.identify("jz_assignments", :uuid) %>
creator: david_uuid
tags: mobile
assignees: jz
fields: <%= { indexed_by: :all, sorted_by: :newest }.to_json %>
params_digest: <%= Filter.digest_params({ indexed_by: :all, sorted_by: :newest, tag_ids: [ ActiveRecord::FixtureSet.identify(:mobile) ], assignee_ids: [ ActiveRecord::FixtureSet.identify(:jz) ] }) %>
account: 37s
params_digest: <%= Filter.digest_params({ indexed_by: :all, sorted_by: :newest, tag_ids: [ ActiveRecord::FixtureSet.identify("mobile", :uuid) ], assignee_ids: [ ActiveRecord::FixtureSet.identify("jz", :uuid) ] }) %>
account: 37s_uuid
+8 -6
View File
@@ -1,9 +1,11 @@
logo_card_david_mention_by_jz:
source: logo (Card)
mentioner: jz
mentionee: david
id: <%= ActiveRecord::FixtureSet.identify("logo_card_david_mention_by_jz", :uuid) %>
source: logo_uuid_uuid (Card)
mentioner: jz_uuid
mentionee: david_uuid
logo_comment_david_mention_by_jz:
source: logo_agreement_jz (Comment)
mentioner: jz
mentionee: david
id: <%= ActiveRecord::FixtureSet.identify("logo_comment_david_mention_by_jz", :uuid) %>
source: logo_agreement_jz_uuid (Comment)
mentioner: jz_uuid
mentionee: david_uuid
+25 -20
View File
@@ -1,34 +1,39 @@
logo_published_kevin:
user: kevin
source: logo_published (Event)
id: <%= ActiveRecord::FixtureSet.identify("logo_published_kevin", :uuid) %>
user: kevin_uuid
source: logo_published_uuid (Event)
created_at: <%= 1.week.ago %>
creator: david
account: 37s
creator: david_uuid
account: 37s_uuid
logo_assignment_kevin:
user: kevin
source: logo_assignment_km (Event)
id: <%= ActiveRecord::FixtureSet.identify("logo_assignment_kevin", :uuid) %>
user: kevin_uuid
source: logo_assignment_km_uuid (Event)
created_at: <%= 1.week.ago %>
creator: david
account: 37s
creator: david_uuid
account: 37s_uuid
layout_commented_kevin:
user: kevin
source: layout_commented (Event)
id: <%= ActiveRecord::FixtureSet.identify("layout_commented_kevin", :uuid) %>
user: kevin_uuid
source: layout_commented_uuid (Event)
created_at: <%= 1.week.ago %>
creator: david
account: 37s
creator: david_uuid
account: 37s_uuid
logo_card_david_mention_by_jz:
user: david
source: logo_card_david_mention_by_jz (Mention)
id: <%= ActiveRecord::FixtureSet.identify("logo_card_david_mention_by_jz_notif", :uuid) %>
user: david_uuid
source: logo_card_david_mention_by_jz_uuid (Mention)
created_at: <%= 1.week.ago %>
creator: david
account: 37s
creator: david_uuid
account: 37s_uuid
logo_comment_david_mention_by_jz:
user: david
source: logo_comment_david_mention_by_jz (Mention)
id: <%= ActiveRecord::FixtureSet.identify("logo_comment_david_mention_by_jz_notif", :uuid) %>
user: david_uuid
source: logo_comment_david_mention_by_jz_uuid (Mention)
created_at: <%= 1.week.ago %>
creator: david
account: 37s
creator: david_uuid
account: 37s_uuid
+5 -3
View File
@@ -1,7 +1,9 @@
logo_kevin:
card: logo
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("logo_kevin_pin", :uuid) %>
card: logo_uuid
user: kevin_uuid
shipping_kevin:
card: shipping
id: <%= ActiveRecord::FixtureSet.identify("shipping_kevin_pin", :uuid) %>
card: shipping_uuid
user: kevin
+2
View File
@@ -1,9 +1,11 @@
kevin:
id: <%= ActiveRecord::FixtureSet.identify("kevin_reaction", :uuid) %>
content: "👍"
comment: logo_agreement_jz
reacter: kevin
david:
id: <%= ActiveRecord::FixtureSet.identify("david_reaction", :uuid) %>
content: "👍"
comment: logo_agreement_jz
reacter: david
+12 -8
View File
@@ -1,15 +1,19 @@
logo_web:
card: logo
tag: web
id: <%= ActiveRecord::FixtureSet.identify("logo_web_tagging", :uuid) %>
card: logo_uuid
tag: web_uuid
layout_web:
card: layout
tag: web
id: <%= ActiveRecord::FixtureSet.identify("layout_web_tagging", :uuid) %>
card: layout_uuid
tag: web_uuid
layout_mobile:
card: layout
tag: mobile
id: <%= ActiveRecord::FixtureSet.identify("layout_mobile_tagging", :uuid) %>
card: layout_uuid
tag: mobile_uuid
text_mobile:
card: text
tag: mobile
id: <%= ActiveRecord::FixtureSet.identify("text_mobile_tagging", :uuid) %>
card: text_uuid
tag: mobile_uuid
+4 -2
View File
@@ -1,7 +1,9 @@
web:
id: <%= ActiveRecord::FixtureSet.identify("web", :uuid) %>
title: web
account: 37s
account: 37s_uuid
mobile:
id: <%= ActiveRecord::FixtureSet.identify("mobile", :uuid) %>
title: mobile
account: 37s
account: 37s_uuid
+10 -5
View File
@@ -1,28 +1,33 @@
david:
id: <%= ActiveRecord::FixtureSet.identify("david", :uuid) %>
name: David
role: member
membership: david_in_37signals
account: 37s
account: 37s_uuid
jz:
id: <%= ActiveRecord::FixtureSet.identify("jz", :uuid) %>
name: JZ
role: member
membership: jz_in_37signals
account: 37s
account: 37s_uuid
kevin:
id: <%= ActiveRecord::FixtureSet.identify("kevin", :uuid) %>
name: Kevin
role: admin
membership: kevin_in_37signals
account: 37s
account: 37s_uuid
system:
id: <%= ActiveRecord::FixtureSet.identify("system", :uuid) %>
name: System
role: system
account: 37s
account: 37s_uuid
mike:
id: <%= ActiveRecord::FixtureSet.identify("mike", :uuid) %>
name: Mike
role: admin
membership: mike_in_initech
account: initech
account: initech_uuid
+27 -18
View File
@@ -1,44 +1,53 @@
logo_david:
card: logo
user: david
id: <%= ActiveRecord::FixtureSet.identify("logo_david_watch", :uuid) %>
card: logo_uuid
user: david_uuid
watching: true
logo_kevin:
card: logo
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("logo_kevin_watch", :uuid) %>
card: logo_uuid
user: kevin_uuid
watching: true
layout_david:
card: layout
user: david
id: <%= ActiveRecord::FixtureSet.identify("layout_david_watch", :uuid) %>
card: layout_uuid
user: david_uuid
watching: true
layout_kevin:
card: layout
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("layout_kevin_watch", :uuid) %>
card: layout_uuid
user: kevin_uuid
watching: true
text_david:
card: text
user: david
id: <%= ActiveRecord::FixtureSet.identify("text_david_watch", :uuid) %>
card: text_uuid
user: david_uuid
watching: true
text_jz:
card: text
user: jz
id: <%= ActiveRecord::FixtureSet.identify("text_jz_watch", :uuid) %>
card: text_uuid
user: jz_uuid
watching: true
shipping_david:
card: shipping
user: david
id: <%= ActiveRecord::FixtureSet.identify("shipping_david_watch", :uuid) %>
card: shipping_uuid
user: david_uuid
watching: true
shipping_jz:
card: shipping
user: jz
id: <%= ActiveRecord::FixtureSet.identify("shipping_jz_watch", :uuid) %>
card: shipping_uuid
user: jz_uuid
watching: true
shipping_kevin:
card: shipping
user: kevin
id: <%= ActiveRecord::FixtureSet.identify("shipping_kevin_watch", :uuid) %>
card: shipping_uuid
user: kevin_uuid
watching: true
+6 -4
View File
@@ -1,17 +1,19 @@
active:
id: <%= ActiveRecord::FixtureSet.identify("active_webhook", :uuid) %>
active: true
name: Production API
url: https://api.example.com/webhooks
signing_secret: p94Bx2HjempCdYB4DTyZkY1b
subscribed_actions: '<%= %w[ card_published card_assigned card_closed ].to_json %>'
board: writebook
account: 37s
board: writebook_uuid
account: 37s_uuid
inactive:
id: <%= ActiveRecord::FixtureSet.identify("inactive_webhook", :uuid) %>
active: false
name: Test Webhook
url: https://test.example.com/webhooks
signing_secret: H8ms8ADcV92v2x17hnLEiL5m
subscribed_actions: '<%= %w[ card_published card_assigned card_closed ].to_json %>'
board: private
account: 37s
board: private_uuid
account: 37s_uuid
+19
View File
@@ -70,6 +70,25 @@ class ActionDispatch::SystemTestCase
end
end
module FixturesTestHelper
extend ActiveSupport::Concern
class_methods do
def identify(label, column_type = :integer)
if label.to_s.end_with?("_uuid")
label_without_suffix = label.to_s.delete_suffix("_uuid")
super(label_without_suffix, :uuid)
else
super(label, column_type)
end
end
end
end
ActiveSupport.on_load(:active_record_fixture_set) do
prepend(FixturesTestHelper)
end
unless Rails.application.config.x.oss_config
load File.expand_path("../gems/fizzy-saas/test/test_helper.rb", __dir__)
end