diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-08-17 21:02:26 +0300 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-08-17 22:55:24 +0300 |
commit | a5b5061ee61d16b6d01e1a1ff9c7817be1b866c3 (patch) | |
tree | b3d9f4c13602cb666db1271285c9b581541e46f3 /db | |
parent | 4b0d5a9ce1893e9de486ec8245ce4953de71aa01 (diff) |
Merge branch 'issue-boards' into 'master'
Issue boards
- Issue: #17907
- Issue backend: #20335
- Backend MR: !5548
- Frontend MR: !5554
- Documentation !5713
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [X] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [X] ~~API support added~~
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5548
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160727191041_create_boards.rb | 13 | ||||
-rw-r--r-- | db/migrate/20160727193336_create_lists.rb | 16 | ||||
-rw-r--r-- | db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 24 |
4 files changed, 68 insertions, 0 deletions
diff --git a/db/migrate/20160727191041_create_boards.rb b/db/migrate/20160727191041_create_boards.rb new file mode 100644 index 00000000000..56afbd4e030 --- /dev/null +++ b/db/migrate/20160727191041_create_boards.rb @@ -0,0 +1,13 @@ +class CreateBoards < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :boards do |t| + t.references :project, index: true, foreign_key: true, null: false + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160727193336_create_lists.rb b/db/migrate/20160727193336_create_lists.rb new file mode 100644 index 00000000000..61d501215f2 --- /dev/null +++ b/db/migrate/20160727193336_create_lists.rb @@ -0,0 +1,16 @@ +class CreateLists < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :lists do |t| + t.references :board, index: true, foreign_key: true, null: false + t.references :label, index: true, foreign_key: true + t.integer :list_type, null: false, default: 1 + t.integer :position + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb b/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb new file mode 100644 index 00000000000..baf2e70b127 --- /dev/null +++ b/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb @@ -0,0 +1,15 @@ +class AddUniqueIndexToListsLabelId < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :lists, [:board_id, :label_id], unique: true + end + + def down + remove_index :lists, column: [:board_id, :label_id] if index_exists?(:lists, [:board_id, :label_id], unique: true) + end +end diff --git a/db/schema.rb b/db/schema.rb index 52ba60ace11..666a4bef574 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -117,6 +117,14 @@ ActiveRecord::Schema.define(version: 20160810142633) do add_index "award_emoji", ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree add_index "award_emoji", ["user_id"], name: "index_award_emoji_on_user_id", using: :btree + create_table "boards", force: :cascade do |t| + t.integer "project_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "boards", ["project_id"], name: "index_boards_on_project_id", using: :btree + create_table "broadcast_messages", force: :cascade do |t| t.text "message", null: false t.datetime "starts_at" @@ -533,6 +541,19 @@ ActiveRecord::Schema.define(version: 20160810142633) do add_index "lfs_objects_projects", ["project_id"], name: "index_lfs_objects_projects_on_project_id", using: :btree + create_table "lists", force: :cascade do |t| + t.integer "board_id", null: false + t.integer "label_id" + t.integer "list_type", default: 1, null: false + t.integer "position" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "lists", ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true, using: :btree + add_index "lists", ["board_id"], name: "index_lists_on_board_id", using: :btree + add_index "lists", ["label_id"], name: "index_lists_on_label_id", using: :btree + create_table "members", force: :cascade do |t| t.integer "access_level", null: false t.integer "source_id", null: false @@ -1114,6 +1135,9 @@ ActiveRecord::Schema.define(version: 20160810142633) do add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree + add_foreign_key "boards", "projects" + add_foreign_key "lists", "boards" + add_foreign_key "lists", "labels" add_foreign_key "personal_access_tokens", "users" add_foreign_key "protected_branch_merge_access_levels", "protected_branches" add_foreign_key "protected_branch_push_access_levels", "protected_branches" |