mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 19:55:16 +00:00
* Add goals * Fix up some migrations * Formatting * Simplify migration * Update test/controllers/settings_goals_controller_test.rb Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update test/controllers/settings_goals_controller_test.rb Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Fix svelte-check issues, make CI less janky on dev * svelte-check/fix tests * Fix N+1s * Formatting! * More tests, fix anonymization and N+1 --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
16 lines
533 B
Ruby
16 lines
533 B
Ruby
class CreateGoals < ActiveRecord::Migration[8.1]
|
|
def change
|
|
create_table :goals do |t|
|
|
t.references :user, null: false, foreign_key: true
|
|
t.string :period, null: false
|
|
t.integer :target_seconds, null: false
|
|
t.string :languages, array: true, default: [], null: false
|
|
t.string :projects, array: true, default: [], null: false
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :goals,
|
|
[ :user_id, :period, :target_seconds, :languages, :projects ],
|
|
name: "index_goals_on_user_and_scope"
|
|
end
|
|
end
|