Commit c780ad0e authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Remove all instances of theme_id; require downtime

parent 0667d1aa
...@@ -603,4 +603,4 @@ test: ...@@ -603,4 +603,4 @@ test:
admin_group: '' admin_group: ''
staging: staging:
<<: *base <<: *base
\ No newline at end of file
...@@ -5,7 +5,7 @@ class RemoveThemeIdFromUsers < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class RemoveThemeIdFromUsers < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime. # Set this constant to true if this migration requires downtime.
DOWNTIME = false DOWNTIME = true
# When a migration requires downtime you **must** uncomment the following # When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the # constant and define a short and easy to understand explanation as to why the
......
...@@ -109,8 +109,8 @@ ActiveRecord::Schema.define(version: 20170213172852) do ...@@ -109,8 +109,8 @@ ActiveRecord::Schema.define(version: 20170213172852) do
t.boolean "html_emails_enabled", default: true t.boolean "html_emails_enabled", default: true
t.string "plantuml_url" t.string "plantuml_url"
t.boolean "plantuml_enabled" t.boolean "plantuml_enabled"
t.integer "terminal_max_session_time", default: 0, null: false
t.integer "max_pages_size", default: 100, null: false t.integer "max_pages_size", default: 100, null: false
t.integer "terminal_max_session_time", default: 0, null: false
end end
create_table "audit_events", force: :cascade do |t| create_table "audit_events", force: :cascade do |t|
......
...@@ -33,7 +33,6 @@ Parameters: ...@@ -33,7 +33,6 @@ Parameters:
"twitter": "", "twitter": "",
"website_url": "", "website_url": "",
"email": "john@example.com", "email": "john@example.com",
"theme_id": 2,
"color_scheme_id": 1, "color_scheme_id": 1,
"projects_limit": 10, "projects_limit": 10,
"current_sign_in_at": null, "current_sign_in_at": null,
......
...@@ -41,7 +41,6 @@ Example response: ...@@ -41,7 +41,6 @@ Example response:
"twitter": "", "twitter": "",
"website_url": "", "website_url": "",
"email": "john@example.com", "email": "john@example.com",
"theme_id": 1,
"color_scheme_id": 1, "color_scheme_id": 1,
"projects_limit": 10, "projects_limit": 10,
"current_sign_in_at": "2015-07-07T07:10:58.392Z", "current_sign_in_at": "2015-07-07T07:10:58.392Z",
......
...@@ -72,7 +72,6 @@ GET /users ...@@ -72,7 +72,6 @@ GET /users
"organization": "", "organization": "",
"last_sign_in_at": "2012-06-01T11:41:01Z", "last_sign_in_at": "2012-06-01T11:41:01Z",
"confirmed_at": "2012-05-23T09:05:22Z", "confirmed_at": "2012-05-23T09:05:22Z",
"theme_id": 1,
"color_scheme_id": 2, "color_scheme_id": 2,
"projects_limit": 100, "projects_limit": 100,
"current_sign_in_at": "2012-06-02T06:36:55Z", "current_sign_in_at": "2012-06-02T06:36:55Z",
...@@ -105,7 +104,6 @@ GET /users ...@@ -105,7 +104,6 @@ GET /users
"organization": "", "organization": "",
"last_sign_in_at": null, "last_sign_in_at": null,
"confirmed_at": "2012-05-30T16:53:06.148Z", "confirmed_at": "2012-05-30T16:53:06.148Z",
"theme_id": 1,
"color_scheme_id": 3, "color_scheme_id": 3,
"projects_limit": 100, "projects_limit": 100,
"current_sign_in_at": "2014-03-19T17:54:13Z", "current_sign_in_at": "2014-03-19T17:54:13Z",
...@@ -198,7 +196,6 @@ Parameters: ...@@ -198,7 +196,6 @@ Parameters:
"organization": "", "organization": "",
"last_sign_in_at": "2012-06-01T11:41:01Z", "last_sign_in_at": "2012-06-01T11:41:01Z",
"confirmed_at": "2012-05-23T09:05:22Z", "confirmed_at": "2012-05-23T09:05:22Z",
"theme_id": 1,
"color_scheme_id": 2, "color_scheme_id": 2,
"projects_limit": 100, "projects_limit": 100,
"current_sign_in_at": "2012-06-02T06:36:55Z", "current_sign_in_at": "2012-06-02T06:36:55Z",
...@@ -323,7 +320,6 @@ GET /user ...@@ -323,7 +320,6 @@ GET /user
"organization": "", "organization": "",
"last_sign_in_at": "2012-06-01T11:41:01Z", "last_sign_in_at": "2012-06-01T11:41:01Z",
"confirmed_at": "2012-05-23T09:05:22Z", "confirmed_at": "2012-05-23T09:05:22Z",
"theme_id": 1,
"color_scheme_id": 2, "color_scheme_id": 2,
"projects_limit": 100, "projects_limit": 100,
"current_sign_in_at": "2012-06-02T06:36:55Z", "current_sign_in_at": "2012-06-02T06:36:55Z",
...@@ -369,7 +365,6 @@ GET /user ...@@ -369,7 +365,6 @@ GET /user
"organization": "", "organization": "",
"last_sign_in_at": "2012-06-01T11:41:01Z", "last_sign_in_at": "2012-06-01T11:41:01Z",
"confirmed_at": "2012-05-23T09:05:22Z", "confirmed_at": "2012-05-23T09:05:22Z",
"theme_id": 1,
"color_scheme_id": 2, "color_scheme_id": 2,
"projects_limit": 100, "projects_limit": 100,
"current_sign_in_at": "2012-06-02T06:36:55Z", "current_sign_in_at": "2012-06-02T06:36:55Z",
......
...@@ -26,7 +26,7 @@ module API ...@@ -26,7 +26,7 @@ module API
expose :last_sign_in_at expose :last_sign_in_at
expose :confirmed_at expose :confirmed_at
expose :email expose :email
expose :theme_id, :color_scheme_id, :projects_limit, :current_sign_in_at expose :color_scheme_id, :projects_limit, :current_sign_in_at
expose :identities, using: Entities::Identity expose :identities, using: Entities::Identity
expose :can_create_group?, as: :can_create_group expose :can_create_group?, as: :can_create_group
expose :can_create_project?, as: :can_create_project expose :can_create_project?, as: :can_create_project
......
...@@ -25,8 +25,7 @@ describe Profiles::PreferencesController do ...@@ -25,8 +25,7 @@ describe Profiles::PreferencesController do
def go(params: {}, format: :js) def go(params: {}, format: :js)
params.reverse_merge!( params.reverse_merge!(
color_scheme_id: '1', color_scheme_id: '1',
dashboard: 'stars', dashboard: 'stars'
theme_id: '1'
) )
patch :update, user: params, format: format patch :update, user: params, format: format
...@@ -41,8 +40,7 @@ describe Profiles::PreferencesController do ...@@ -41,8 +40,7 @@ describe Profiles::PreferencesController do
it "changes the user's preferences" do it "changes the user's preferences" do
prefs = { prefs = {
color_scheme_id: '1', color_scheme_id: '1',
dashboard: 'stars', dashboard: 'stars'
theme_id: '2'
}.with_indifferent_access }.with_indifferent_access
expect(user).to receive(:update_attributes).with(prefs) expect(user).to receive(:update_attributes).with(prefs)
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
"organization", "organization",
"last_sign_in_at", "last_sign_in_at",
"confirmed_at", "confirmed_at",
"theme_id",
"color_scheme_id", "color_scheme_id",
"projects_limit", "projects_limit",
"current_sign_in_at", "current_sign_in_at",
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
"organization", "organization",
"last_sign_in_at", "last_sign_in_at",
"confirmed_at", "confirmed_at",
"theme_id",
"color_scheme_id", "color_scheme_id",
"projects_limit", "projects_limit",
"current_sign_in_at", "current_sign_in_at",
...@@ -32,14 +31,14 @@ ...@@ -32,14 +31,14 @@
"properties": { "properties": {
"id": { "type": "integer" }, "id": { "type": "integer" },
"username": { "type": "string" }, "username": { "type": "string" },
"email": { "email": {
"type": "string", "type": "string",
"pattern": "^[^@]+@[^@]+$" "pattern": "^[^@]+@[^@]+$"
}, },
"name": { "type": "string" }, "name": { "type": "string" },
"state": { "state": {
"type": "string", "type": "string",
"enum": ["active", "blocked"] "enum": ["active", "blocked"]
}, },
"avatar_url": { "type": "string" }, "avatar_url": { "type": "string" },
"web_url": { "type": "string" }, "web_url": { "type": "string" },
...@@ -54,18 +53,17 @@ ...@@ -54,18 +53,17 @@
"organization": { "type": ["string", "null"] }, "organization": { "type": ["string", "null"] },
"last_sign_in_at": { "type": "date" }, "last_sign_in_at": { "type": "date" },
"confirmed_at": { "type": ["date", "null"] }, "confirmed_at": { "type": ["date", "null"] },
"theme_id": { "type": "integer" },
"color_scheme_id": { "type": "integer" }, "color_scheme_id": { "type": "integer" },
"projects_limit": { "type": "integer" }, "projects_limit": { "type": "integer" },
"current_sign_in_at": { "type": "date" }, "current_sign_in_at": { "type": "date" },
"identities": { "identities": {
"type": "array", "type": "array",
"items": { "items": {
"type": "object", "type": "object",
"properties": { "properties": {
"provider": { "provider": {
"type": "string", "type": "string",
"enum": ["github", "bitbucket", "google_oauth2"] "enum": ["github", "bitbucket", "google_oauth2"]
}, },
"extern_uid": { "type": ["number", "string"] } "extern_uid": { "type": ["number", "string"] }
} }
...@@ -74,6 +72,6 @@ ...@@ -74,6 +72,6 @@
"can_create_group": { "type": "boolean" }, "can_create_group": { "type": "boolean" },
"can_create_project": { "type": "boolean" }, "can_create_project": { "type": "boolean" },
"two_factor_enabled": { "type": "boolean" }, "two_factor_enabled": { "type": "boolean" },
"external": { "type": "boolean" } "external": { "type": "boolean" }
} }
} }
...@@ -587,12 +587,11 @@ describe User, models: true do ...@@ -587,12 +587,11 @@ describe User, models: true do
end end
describe 'with default overrides' do describe 'with default overrides' do
let(:user) { User.new(projects_limit: 123, can_create_group: false, can_create_team: true, theme_id: 1) } let(:user) { User.new(projects_limit: 123, can_create_group: false, can_create_team: true) }
it "applies defaults to user" do it "applies defaults to user" do
expect(user.projects_limit).to eq(123) expect(user.projects_limit).to eq(123)
expect(user.can_create_group).to be_falsey expect(user.can_create_group).to be_falsey
expect(user.theme_id).to eq(1)
end end
end end
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"skype":"aertert", "skype":"aertert",
"linkedin":"", "linkedin":"",
"twitter":"", "twitter":"",
"theme_id":2,"color_scheme_id":2, "color_scheme_id":2,
"state":"active", "state":"active",
"created_at":"2012-12-21T13:02:20Z", "created_at":"2012-12-21T13:02:20Z",
"extern_uid":null, "extern_uid":null,
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
"can_create_project":false, "can_create_project":false,
"private_token":"Wvjy2Krpb7y8xi93owUz", "private_token":"Wvjy2Krpb7y8xi93owUz",
"access_token":"Wvjy2Krpb7y8xi93owUz" "access_token":"Wvjy2Krpb7y8xi93owUz"
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"skype":"aertert", "skype":"aertert",
"linkedin":"", "linkedin":"",
"twitter":"", "twitter":"",
"theme_id":2,"color_scheme_id":2, "color_scheme_id":2,
"state":"active", "state":"active",
"created_at":"2012-12-21T13:02:20Z", "created_at":"2012-12-21T13:02:20Z",
"extern_uid":null, "extern_uid":null,
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
"can_create_project":false, "can_create_project":false,
"private_token":"Wvjy2Krpb7y8xi93owUz", "private_token":"Wvjy2Krpb7y8xi93owUz",
"access_token":"Wvjy2Krpb7y8xi93owUz" "access_token":"Wvjy2Krpb7y8xi93owUz"
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment