Skip to content

Schema updates#1206

Open
skyfallwastaken wants to merge 1 commit intomainfrom
schema
Open

Schema updates#1206
skyfallwastaken wants to merge 1 commit intomainfrom
schema

Conversation

@skyfallwastaken
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 21, 2026 21:51
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Rails schema snapshot to reflect several database-level constraint/index changes around goals, heartbeats, instance import sources, and Mailkick subscriptions.

Changes:

  • Makes the goals “scope” index unique.
  • Adds a new heartbeats index on (time, source_type).
  • Removes multiple columns/indexes from instance_import_sources and relaxes nullability on mailkick_subscriptions.subscriber_*.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread db/schema.rb
Comment on lines +390 to +391
t.bigint "subscriber_id"
t.string "subscriber_type"
Comment thread db/schema.rb
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.index ["user_id", "period", "target_seconds", "languages", "projects"], name: "index_goals_on_user_and_scope"
t.index ["user_id", "period", "target_seconds", "languages", "projects"], name: "index_goals_on_user_and_scope", unique: true
Comment thread db/schema.rb
t.index ["project", "time"], name: "index_heartbeats_on_project_and_time"
t.index ["project"], name: "index_heartbeats_on_project"
t.index ["source_type", "time", "user_id", "project"], name: "index_heartbeats_on_source_type_time_user_project"
t.index ["time", "source_type"], name: "index_heartbeats_on_time_and_source_type"
Comment thread db/schema.rb
Comment on lines 352 to 358
create_table "instance_import_sources", force: :cascade do |t|
t.boolean "active", default: true, null: false
t.datetime "created_at", null: false
t.string "encrypted_api_key", null: false
t.string "endpoint_url", null: false
t.text "last_error"
t.datetime "last_import_finished_at"
t.datetime "last_import_started_at"
t.integer "last_imported_count", default: 0, null: false
t.float "last_imported_heartbeat_time"
t.integer "last_processed_count", default: 0, null: false
t.integer "last_skipped_count", default: 0, null: false
t.datetime "last_synced_at"
t.integer "sync_state", default: 0, null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
t.index ["active"], name: "index_instance_import_sources_on_active"
t.index ["user_id"], name: "index_instance_import_sources_on_user_id", unique: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants