From 3afd08170da6f003b4f11ae1a3f737b14dedec40 Mon Sep 17 00:00:00 2001 From: Mehmet Beydogan Date: Thu, 10 Mar 2016 16:26:56 +0200 Subject: Add due_date:time field to Issue model Add due_date text field to sidebar issue#show Add ability sorting issues by due date ASC and DESC Add ability to filtering issues by No Due Date, Any Due Date, Due to tomorrow, Due in this week options Add handling issue due_date field for MergeRequest Update CHANGELOG Fix ambigous match for issues#show sidebar Fix SCREAMING_SNAKE_CASE offenses for due date contants Add specs for due date sorting and filtering on issues --- db/migrate/20160310124959_add_due_date_to_issues.rb | 5 +++++ db/schema.rb | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 db/migrate/20160310124959_add_due_date_to_issues.rb (limited to 'db') diff --git a/db/migrate/20160310124959_add_due_date_to_issues.rb b/db/migrate/20160310124959_add_due_date_to_issues.rb new file mode 100644 index 00000000000..c232387a6f3 --- /dev/null +++ b/db/migrate/20160310124959_add_due_date_to_issues.rb @@ -0,0 +1,5 @@ +class AddDueDateToIssues < ActiveRecord::Migration + def change + add_column :issues, :due_date, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index d82c8c1e257..699a99c0743 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -366,6 +366,19 @@ ActiveRecord::Schema.define(version: 20160419120017) do add_index "emails", ["email"], name: "index_emails_on_email", unique: true, using: :btree add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree + create_table "emoji_awards", force: :cascade do |t| + t.string "name" + t.integer "user_id" + t.integer "awardable_id" + t.string "awardable_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "emoji_awards", ["awardable_id"], name: "index_emoji_awards_on_awardable_id", using: :btree + add_index "emoji_awards", ["awardable_type"], name: "index_emoji_awards_on_awardable_type", using: :btree + add_index "emoji_awards", ["user_id"], name: "index_emoji_awards_on_user_id", using: :btree + create_table "events", force: :cascade do |t| t.string "target_type" t.integer "target_id" @@ -422,6 +435,7 @@ ActiveRecord::Schema.define(version: 20160419120017) do t.integer "moved_to_id" t.boolean "confidential", default: false t.datetime "deleted_at" + t.date "due_date" end add_index "issues", ["assignee_id"], name: "index_issues_on_assignee_id", using: :btree @@ -431,6 +445,7 @@ ActiveRecord::Schema.define(version: 20160419120017) do add_index "issues", ["created_at"], name: "index_issues_on_created_at", using: :btree add_index "issues", ["deleted_at"], name: "index_issues_on_deleted_at", using: :btree add_index "issues", ["description"], name: "index_issues_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"} + add_index "issues", ["due_date"], name: "index_issues_on_due_date", using: :btree add_index "issues", ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree add_index "issues", ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree add_index "issues", ["project_id"], name: "index_issues_on_project_id", using: :btree -- cgit v1.2.1 From c1f51655a054878ab1870afc9c5b2237c0e6a7bb Mon Sep 17 00:00:00 2001 From: Mehmet Beydogan Date: Sun, 20 Mar 2016 14:33:38 +0200 Subject: Add index to issues due date --- db/migrate/20160320123111_add_index_to_issues_due_date.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20160320123111_add_index_to_issues_due_date.rb (limited to 'db') diff --git a/db/migrate/20160320123111_add_index_to_issues_due_date.rb b/db/migrate/20160320123111_add_index_to_issues_due_date.rb new file mode 100644 index 00000000000..03a33c679f4 --- /dev/null +++ b/db/migrate/20160320123111_add_index_to_issues_due_date.rb @@ -0,0 +1,5 @@ +class AddIndexToIssuesDueDate < ActiveRecord::Migration + def change + add_index :issues, :due_date + end +end -- cgit v1.2.1 From 6cdf4acd4eef55c616d633757772c6e05f6b93c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 19 Apr 2016 13:03:28 +0200 Subject: Address MR feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- db/migrate/20160310124959_add_due_date_to_issues.rb | 1 + db/migrate/20160320123111_add_index_to_issues_due_date.rb | 5 ----- db/schema.rb | 13 ------------- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 db/migrate/20160320123111_add_index_to_issues_due_date.rb (limited to 'db') diff --git a/db/migrate/20160310124959_add_due_date_to_issues.rb b/db/migrate/20160310124959_add_due_date_to_issues.rb index c232387a6f3..ec08bd9fdfa 100644 --- a/db/migrate/20160310124959_add_due_date_to_issues.rb +++ b/db/migrate/20160310124959_add_due_date_to_issues.rb @@ -1,5 +1,6 @@ class AddDueDateToIssues < ActiveRecord::Migration def change add_column :issues, :due_date, :date + add_index :issues, :due_date end end diff --git a/db/migrate/20160320123111_add_index_to_issues_due_date.rb b/db/migrate/20160320123111_add_index_to_issues_due_date.rb deleted file mode 100644 index 03a33c679f4..00000000000 --- a/db/migrate/20160320123111_add_index_to_issues_due_date.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddIndexToIssuesDueDate < ActiveRecord::Migration - def change - add_index :issues, :due_date - end -end diff --git a/db/schema.rb b/db/schema.rb index 699a99c0743..a93ba690730 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -366,19 +366,6 @@ ActiveRecord::Schema.define(version: 20160419120017) do add_index "emails", ["email"], name: "index_emails_on_email", unique: true, using: :btree add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree - create_table "emoji_awards", force: :cascade do |t| - t.string "name" - t.integer "user_id" - t.integer "awardable_id" - t.string "awardable_type" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "emoji_awards", ["awardable_id"], name: "index_emoji_awards_on_awardable_id", using: :btree - add_index "emoji_awards", ["awardable_type"], name: "index_emoji_awards_on_awardable_type", using: :btree - add_index "emoji_awards", ["user_id"], name: "index_emoji_awards_on_user_id", using: :btree - create_table "events", force: :cascade do |t| t.string "target_type" t.integer "target_id" -- cgit v1.2.1