summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2017-12-17 00:20:20 +0000
committerLuke Bennett <lukeeeebennettplus@gmail.com>2017-12-17 00:20:20 +0000
commit9a238d259a5825fbc348cfb611f836bc1dc9f645 (patch)
tree6ccb1349d722053933019c3a2d8497b1e91d092b
parenta5b19090ca9f437ad9f1540b2f9173851d9ef3a4 (diff)
downloadgitlab-ce-background-pipeline-notifications.tar.gz
-rw-r--r--app/assets/javascripts/pipelines/components/header_component.vue11
-rw-r--r--app/assets/javascripts/pipelines/pipeline_details_bundle.js9
-rw-r--r--app/assets/javascripts/pipelines/pipeline_details_mediatior.js1
-rw-r--r--app/assets/javascripts/service_workers/clients/pipeline_notification_client.js1
-rw-r--r--app/assets/javascripts/service_workers/workers/pipeline_notification_worker.js1
-rw-r--r--app/assets/javascripts/vue_shared/components/header_ci_component.vue18
-rw-r--r--app/assets/javascripts/vue_shared/components/pipeline_push_notifications_subscribe_button.vue (renamed from app/assets/javascripts/vue_shared/components/push_notifications_subscribe_button.vue)31
-rw-r--r--app/controllers/profiles_controller.rb14
-rw-r--r--app/models/ci/pipeline.rb4
-rw-r--r--app/models/ci/pipeline_subscription.rb2
-rw-r--r--app/models/user.rb7
-rw-r--r--app/services/users/update_service.rb15
-rw-r--r--app/views/projects/pipelines/show.html.haml2
-rw-r--r--app/workers/pipeline_webpush_worker.rb11
-rw-r--r--db/schema.rb89
15 files changed, 150 insertions, 66 deletions
diff --git a/app/assets/javascripts/pipelines/components/header_component.vue b/app/assets/javascripts/pipelines/components/header_component.vue
index 2a1ecac3707..20dfe5ea649 100644
--- a/app/assets/javascripts/pipelines/components/header_component.vue
+++ b/app/assets/javascripts/pipelines/components/header_component.vue
@@ -14,6 +14,11 @@ export default {
type: Boolean,
required: true,
},
+ isSubscribed: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
components: {
ciHeader,
@@ -44,6 +49,10 @@ export default {
eventHub.$emit('headerPostAction', action);
},
+ emitSetIsSubscribed(...args) {
+ eventHub.$emit('setIsSubscribed', ...args);
+ },
+
getActions() {
const actions = [];
@@ -88,7 +97,9 @@ export default {
:time="pipeline.created_at"
:user="pipeline.user"
:actions="actions"
+ :is-subscribed="isSubscribed"
@actionClicked="postAction"
+ @setIsSubscribed="emitSetIsSubscribed"
/>
<loading-icon
v-if="isLoading"
diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
index 206023d4ddb..28e198ee628 100644
--- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js
+++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
@@ -8,7 +8,7 @@ import eventHub from './event_hub';
document.addEventListener('DOMContentLoaded', () => {
const dataset = document.querySelector('.js-pipeline-details-vue').dataset;
- const mediator = new PipelinesMediator({ endpoint: dataset.endpoint });
+ const mediator = new PipelinesMediator({ endpoint: dataset.endpoint, isSubscribed: dataset.isSubscribed });
mediator.fetchPipeline();
@@ -46,9 +46,11 @@ document.addEventListener('DOMContentLoaded', () => {
},
created() {
eventHub.$on('headerPostAction', this.postAction);
+ eventHub.$on('setIsSubscribed', this.setIsSubscribed);
},
beforeDestroy() {
eventHub.$off('headerPostAction', this.postAction);
+ eventHub.$off('setIsSubscribed', this.setIsSubscribed);
},
methods: {
postAction(action) {
@@ -56,11 +58,16 @@ document.addEventListener('DOMContentLoaded', () => {
.then(() => this.mediator.refreshPipeline())
.catch(() => new Flash('An error occurred while making the request.'));
},
+
+ setIsSubscribed(isSubscribed) {
+ this.mediator.state.isSubscribed = isSubscribed;
+ },
},
render(createElement) {
return createElement('pipeline-header', {
props: {
isLoading: this.mediator.state.isLoading,
+ isSubscribed: this.mediator.state.isSubscribed,
pipeline: this.mediator.store.state.pipeline,
},
});
diff --git a/app/assets/javascripts/pipelines/pipeline_details_mediatior.js b/app/assets/javascripts/pipelines/pipeline_details_mediatior.js
index 823ccd849f4..e63de175b0c 100644
--- a/app/assets/javascripts/pipelines/pipeline_details_mediatior.js
+++ b/app/assets/javascripts/pipelines/pipeline_details_mediatior.js
@@ -12,6 +12,7 @@ export default class pipelinesMediator {
this.state = {};
this.state.isLoading = false;
+ this.state.isSubscribed = options.isSubscribed === 'true';
}
fetchPipeline() {
diff --git a/app/assets/javascripts/service_workers/clients/pipeline_notification_client.js b/app/assets/javascripts/service_workers/clients/pipeline_notification_client.js
index ba0266a2991..5532abb12aa 100644
--- a/app/assets/javascripts/service_workers/clients/pipeline_notification_client.js
+++ b/app/assets/javascripts/service_workers/clients/pipeline_notification_client.js
@@ -29,6 +29,7 @@ export default {
register() {
return this.worker.register(this.workerPath)
+ .then(this.worker.ready)
.then((registration) => {
this.registration = registration;
});
diff --git a/app/assets/javascripts/service_workers/workers/pipeline_notification_worker.js b/app/assets/javascripts/service_workers/workers/pipeline_notification_worker.js
index bf332a0afdd..6da713960f1 100644
--- a/app/assets/javascripts/service_workers/workers/pipeline_notification_worker.js
+++ b/app/assets/javascripts/service_workers/workers/pipeline_notification_worker.js
@@ -1,5 +1,6 @@
function onPush(event) {
console.log('PipelineNotificatinWorker onPush', event);
+ debugger;
console.log('JSON', event.data.json());
console.log('logo', gon);
console.log('test');
diff --git a/app/assets/javascripts/vue_shared/components/header_ci_component.vue b/app/assets/javascripts/vue_shared/components/header_ci_component.vue
index f1ec9bcfda1..adc871a086e 100644
--- a/app/assets/javascripts/vue_shared/components/header_ci_component.vue
+++ b/app/assets/javascripts/vue_shared/components/header_ci_component.vue
@@ -4,7 +4,7 @@ import loadingIcon from './loading_icon.vue';
import timeagoTooltip from './time_ago_tooltip.vue';
import tooltip from '../directives/tooltip';
import userAvatarImage from './user_avatar/user_avatar_image.vue';
-import pushNotificationsSubscribeButton from './push_notifications_subscribe_button.vue';
+import pipelinePushNotificationsSubscribeButton from './pipeline_push_notifications_subscribe_button.vue';
/**
* Renders header component for job and pipeline page based on UI mockups
@@ -46,6 +46,11 @@ export default {
required: false,
default: false,
},
+ isSubscribed: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
directives: {
@@ -57,7 +62,7 @@ export default {
loadingIcon,
timeagoTooltip,
userAvatarImage,
- pushNotificationsSubscribeButton,
+ pipelinePushNotificationsSubscribeButton,
},
computed: {
@@ -70,6 +75,10 @@ export default {
onClickAction(action) {
this.$emit('actionClicked', action);
},
+
+ emitSetIsSubscribed(...args) {
+ this.$emit('setIsSubscribed', ...args);
+ },
},
};
</script>
@@ -143,9 +152,10 @@ export default {
aria-hidden="true">
</i>
</button>
-
</template>
- <push-notifications-subscribe-button />
+
+ <pipeline-push-notifications-subscribe-button :pipeline-id="itemId" :is-subscribed="isSubscribed" @setIsSubscribed="emitSetIsSubscribed" />
+
<button
v-if="hasSidebarButton"
type="button"
diff --git a/app/assets/javascripts/vue_shared/components/push_notifications_subscribe_button.vue b/app/assets/javascripts/vue_shared/components/pipeline_push_notifications_subscribe_button.vue
index ac40285c244..8265aa49c1b 100644
--- a/app/assets/javascripts/vue_shared/components/push_notifications_subscribe_button.vue
+++ b/app/assets/javascripts/vue_shared/components/pipeline_push_notifications_subscribe_button.vue
@@ -3,12 +3,31 @@ import PipelineNotificationClient from '../../service_workers/clients/pipeline_n
import axios from '../../lib/utils/axios_utils';
export default {
+ props: {
+ pipelineId: {
+ type: Number,
+ required: true,
+ },
+
+ isSubscribed: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
+ },
+
data() {
return {
hasPermission: true,
};
},
+ computed: {
+ actionName() {
+ return this.isSubscribed ? 'Unsubscribe' : 'Subscribe';
+ },
+ },
+
methods: {
subscribe() {
PipelineNotificationClient.init()
@@ -20,22 +39,22 @@ export default {
})
.then((subscription) => {
const subscriptionData = subscription.toJSON();
-
+
// lazy
- return axios.put('/profile', {
+ return axios.put('/profile.json', {
user: {
webpush_endpoint: subscriptionData.endpoint,
webpush_p256dh: subscriptionData.keys.p256dh,
webpush_auth: subscriptionData.keys.auth,
- subscribed_pipelines: '68,69',
+ subscribed_pipeline: this.pipelineId,
},
});
})
.then(() => {
+ this.$emit('setIsSubscribed', true);
this.hasPermission = true;
})
- .catch((error) => {
- console.log(error);
+ .catch(() => {
this.hasPermission = false;
});
},
@@ -51,6 +70,6 @@ export default {
type="button"
@click="subscribe"
>
- Subscribe to push notifications
+ {{ actionName }} to push notifications
</button>
</template>
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 0f99cf1e7db..9b7239e6233 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -15,8 +15,16 @@ class ProfilesController < Profiles::ApplicationController
if result[:status] == :success
message = "Profile was successfully updated"
- format.html { redirect_back_or_default(default: { action: 'show' }, options: { notice: message }) }
- format.json { render json: { message: message } }
+ p 'πŸ˜‚'
+
+ format.html do
+ p '😘'
+ redirect_back_or_default(default: { action: 'show' }, options: { notice: message })
+ end
+ format.json do
+ p 'πŸ™„'
+ render json: { message: message }
+ end
else
format.html { redirect_back_or_default(default: { action: 'show' }, options: { alert: result[:message] }) }
format.json { render json: result }
@@ -95,7 +103,7 @@ class ProfilesController < Profiles::ApplicationController
:webpush_endpoint,
:webpush_p256dh,
:webpush_auth,
- :subscribed_pipelines
+ :subscribed_pipeline
)
end
end
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 6e7c43c35c6..39674cb88ef 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -31,7 +31,7 @@ module Ci
has_many :auto_canceled_pipelines, class_name: 'Ci::Pipeline', foreign_key: 'auto_canceled_by_id'
has_many :auto_canceled_jobs, class_name: 'CommitStatus', foreign_key: 'auto_canceled_by_id'
- has_many :pipeline_subscriptions, class_name: 'Ci::PipelineSubscription'
+ has_many :pipeline_subscriptions, class_name: 'Ci::PipelineSubscription', foreign_key: 'ci_pipeline_id'
has_many :webpush_subscribers, through: :pipeline_subscriptions, class_name: 'User', source: :user
delegate :id, to: :project, prefix: true
@@ -139,7 +139,7 @@ module Ci
next if transition.loopback?
pipeline.run_after_commit do
- PipelineWebpushWorker.perform_async(pipeline.id, pipeline.webpush_subscribers)
+ PipelineWebpushWorker.perform_async(pipeline.id)
PipelineHooksWorker.perform_async(pipeline.id)
ExpirePipelineCacheWorker.perform_async(pipeline.id)
end
diff --git a/app/models/ci/pipeline_subscription.rb b/app/models/ci/pipeline_subscription.rb
index 797e942a5ca..424c592225e 100644
--- a/app/models/ci/pipeline_subscription.rb
+++ b/app/models/ci/pipeline_subscription.rb
@@ -3,6 +3,6 @@ module Ci
extend Gitlab::Ci::Model
belongs_to :user
- belongs_to :pipeline, class_name: 'Ci::Pipeline'
+ belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: 'ci_pipeline_id'
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 19672b2a28f..e8551748d66 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -135,7 +135,7 @@ class User < ActiveRecord::Base
has_many :custom_attributes, class_name: 'UserCustomAttribute'
has_many :pipeline_subscriptions, class_name: 'Ci::PipelineSubscription'
- has_many :subscribed_pipelines, through: :pipeline_subscriptions, class_name: 'Ci::Pipeline', source: :pipeline
+ has_many :subscribed_pipelines, through: :pipeline_subscriptions, class_name: 'Ci::Pipeline', source: :pipeline, foreign_key: 'ci_pipeline_id'
#
# Validations
@@ -168,7 +168,6 @@ class User < ActiveRecord::Base
validates :webpush_p256dh, uniqueness: true, allow_nil: true
validates :webpush_auth, uniqueness: true, allow_nil: true
validates :webpush_endpoint, uniqueness: true, allow_nil: true
-
before_validation :sanitize_attrs
before_validation :set_notification_email, if: :email_changed?
@@ -1188,6 +1187,10 @@ class User < ActiveRecord::Base
max_member_access_for_group_ids([group_id])[group_id]
end
+ def is_subscribed?(pipeline)
+ subscribed_pipelines.exists?(pipeline.id)
+ end
+
protected
# override, from Devise::Validatable
diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb
index e7e6d59df56..cc9c557e419 100644
--- a/app/services/users/update_service.rb
+++ b/app/services/users/update_service.rb
@@ -1,3 +1,5 @@
+require 'byebug'
+
module Users
class UpdateService < BaseService
include NewUserNotifier
@@ -13,13 +15,14 @@ module Users
user_exists = @user.persisted?
- if @params[:subscribed_pipelines]
- @params[:subscribed_pipelines].split(/\,/).each do |pipeline_id|
- Ci::Pipeline.find(pipeline_id).try do |pipeline|
- p 'πŸ”₯'
- @user.subscribed_pipelines << pipeline
- end
+ if @params[:subscribed_pipeline]
+ Ci::Pipeline.find(@params[:subscribed_pipeline]).try do |pipeline|
+ p 'πŸ”₯'
+ p pipeline
+ @user.subscribed_pipelines << pipeline
end
+
+ @params.delete(:subscribed_pipeline)
end
assign_attributes(&block)
diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml
index 2174154b207..32c41f3b199 100644
--- a/app/views/projects/pipelines/show.html.haml
+++ b/app/views/projects/pipelines/show.html.haml
@@ -9,7 +9,7 @@
= render "projects/pipelines/with_tabs", pipeline: @pipeline
-.js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json) } }
+.js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json), is_subscribed: current_user ? current_user.is_subscribed?(@pipeline).to_s : false } }
- content_for :page_specific_javascripts do
= webpack_bundle_tag('common_vue')
diff --git a/app/workers/pipeline_webpush_worker.rb b/app/workers/pipeline_webpush_worker.rb
index e40e3e1f3ca..e94e3786b1d 100644
--- a/app/workers/pipeline_webpush_worker.rb
+++ b/app/workers/pipeline_webpush_worker.rb
@@ -7,9 +7,16 @@ class PipelineWebpushWorker
queue_namespace :pipeline_default
- def perform(pipeline_id, subscribers)
+ def perform(pipeline_id)
+ p "πŸ”₯"
+ p pipeline_id
Ci::Pipeline.find(pipeline_id).try do |pipeline|
- subscribers.each do |subscriber|
+ p "πŸ˜‚test"
+ p pipeline
+ p pipeline.webpush_subscribers
+ pipeline.webpush_subscribers.each do |subscriber|
+ p "❀️"
+ p subscriber
Webpush.payload_send(
message: "#{pipeline_id} has updated",
endpoint: subscriber.webpush_endpoint,
diff --git a/db/schema.rb b/db/schema.rb
index 2048c50f892..bdb32a25efe 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20171213160445) do
+ActiveRecord::Schema.define(version: 20171216024411) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -32,8 +32,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.text "description", null: false
t.string "header_logo"
t.string "logo"
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.text "description_html"
t.integer "cached_markdown_version"
t.text "new_project_guidelines"
@@ -236,8 +236,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
create_table "ci_build_trace_sections", force: :cascade do |t|
t.integer "project_id", null: false
- t.datetime_with_timezone "date_start", null: false
- t.datetime_with_timezone "date_end", null: false
+ t.datetime "date_start", null: false
+ t.datetime "date_end", null: false
t.integer "byte_start", limit: 8, null: false
t.integer "byte_end", limit: 8, null: false
t.integer "build_id", null: false
@@ -314,8 +314,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.string "encrypted_value_iv"
t.integer "group_id", null: false
t.boolean "protected", default: false, null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
add_index "ci_group_variables", ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true, using: :btree
@@ -325,9 +325,9 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.integer "job_id", null: false
t.integer "file_type", null: false
t.integer "size", limit: 8
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
- t.datetime_with_timezone "expire_at"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.datetime "expire_at"
t.string "file"
end
@@ -341,8 +341,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.string "encrypted_value_salt"
t.string "encrypted_value_iv"
t.integer "pipeline_schedule_id", null: false
- t.datetime_with_timezone "created_at"
- t.datetime_with_timezone "updated_at"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
add_index "ci_pipeline_schedule_variables", ["pipeline_schedule_id", "key"], name: "index_ci_pipeline_schedule_variables_on_schedule_id_and_key", unique: true, using: :btree
@@ -364,6 +364,14 @@ ActiveRecord::Schema.define(version: 20171213160445) do
add_index "ci_pipeline_schedules", ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active", using: :btree
add_index "ci_pipeline_schedules", ["project_id"], name: "index_ci_pipeline_schedules_on_project_id", using: :btree
+ create_table "ci_pipeline_subscriptions", force: :cascade do |t|
+ t.integer "ci_pipeline_id"
+ t.integer "user_id"
+ end
+
+ add_index "ci_pipeline_subscriptions", ["ci_pipeline_id"], name: "index_ci_pipeline_subscriptions_on_ci_pipeline_id", using: :btree
+ add_index "ci_pipeline_subscriptions", ["user_id"], name: "index_ci_pipeline_subscriptions_on_user_id", using: :btree
+
create_table "ci_pipeline_variables", force: :cascade do |t|
t.string "key", null: false
t.text "value"
@@ -492,8 +500,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
create_table "cluster_platforms_kubernetes", force: :cascade do |t|
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.text "api_url"
t.text "ca_cert"
t.string "namespace"
@@ -509,8 +517,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
create_table "cluster_projects", force: :cascade do |t|
t.integer "project_id", null: false
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
add_index "cluster_projects", ["cluster_id"], name: "index_cluster_projects_on_cluster_id", using: :btree
@@ -520,8 +528,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.integer "cluster_id", null: false
t.integer "status"
t.integer "num_nodes", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.text "status_reason"
t.string "gcp_project_id", null: false
t.string "zone", null: false
@@ -538,8 +546,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.integer "user_id"
t.integer "provider_type"
t.integer "platform_type"
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "enabled", default: true
t.string "name", null: false
t.string "environment_scope", default: "*", null: false
@@ -550,8 +558,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
create_table "clusters_applications_helm", force: :cascade do |t|
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "status", null: false
t.string "version", null: false
t.text "status_reason"
@@ -559,8 +567,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
create_table "clusters_applications_ingress", force: :cascade do |t|
t.integer "cluster_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "status", null: false
t.integer "ingress_type", null: false
t.string "version", null: false
@@ -674,8 +682,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.integer "project_id"
t.integer "author_id", null: false
t.integer "target_id"
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "action", limit: 2, null: false
t.string "target_type"
end
@@ -734,8 +742,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.integer "service_id"
t.integer "status"
t.integer "gcp_cluster_size", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "enabled", default: true
t.text "status_reason"
t.string "project_namespace"
@@ -768,8 +776,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
add_index "gpg_key_subkeys", ["keyid"], name: "index_gpg_key_subkeys_on_keyid", unique: true, using: :btree
create_table "gpg_keys", force: :cascade do |t|
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "user_id"
t.binary "primary_keyid"
t.binary "fingerprint"
@@ -781,8 +789,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
add_index "gpg_keys", ["user_id"], name: "index_gpg_keys_on_user_id", using: :btree
create_table "gpg_signatures", force: :cascade do |t|
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "project_id"
t.integer "gpg_key_id"
t.binary "commit_sha"
@@ -863,7 +871,7 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.datetime "last_edited_at"
t.integer "last_edited_by_id"
t.boolean "discussion_locked"
- t.datetime_with_timezone "closed_at"
+ t.datetime "closed_at"
end
add_index "issues", ["author_id"], name: "index_issues_on_author_id", using: :btree
@@ -994,8 +1002,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
add_index "members", ["user_id"], name: "index_members_on_user_id", using: :btree
create_table "merge_request_diff_commits", id: false, force: :cascade do |t|
- t.datetime_with_timezone "authored_date"
- t.datetime_with_timezone "committed_date"
+ t.datetime "authored_date"
+ t.datetime "committed_date"
t.integer "merge_request_diff_id", null: false
t.integer "relative_order", null: false
t.binary "sha", null: false
@@ -1321,8 +1329,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
create_table "project_auto_devops", force: :cascade do |t|
t.integer "project_id", null: false
- t.datetime_with_timezone "created_at", null: false
- t.datetime_with_timezone "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "enabled"
t.string "domain"
end
@@ -1686,7 +1694,7 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.datetime "updated_at", null: false
t.integer "issue_id"
t.integer "merge_request_id"
- t.datetime_with_timezone "spent_at"
+ t.datetime "spent_at"
end
add_index "timelogs", ["issue_id"], name: "index_timelogs_on_issue_id", using: :btree
@@ -1846,6 +1854,9 @@ ActiveRecord::Schema.define(version: 20171213160445) do
t.string "preferred_language"
t.string "rss_token"
t.integer "theme_id", limit: 2
+ t.string "webpush_p256dh"
+ t.string "webpush_auth"
+ t.string "webpush_endpoint"
end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
@@ -1929,6 +1940,8 @@ ActiveRecord::Schema.define(version: 20171213160445) do
add_foreign_key "ci_pipeline_schedule_variables", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_41c35fda51", on_delete: :cascade
add_foreign_key "ci_pipeline_schedules", "projects", name: "fk_8ead60fcc4", on_delete: :cascade
add_foreign_key "ci_pipeline_schedules", "users", column: "owner_id", name: "fk_9ea99f58d2", on_delete: :nullify
+ add_foreign_key "ci_pipeline_subscriptions", "ci_pipelines"
+ add_foreign_key "ci_pipeline_subscriptions", "users"
add_foreign_key "ci_pipeline_variables", "ci_pipelines", column: "pipeline_id", name: "fk_f29c5f4380", on_delete: :cascade
add_foreign_key "ci_pipelines", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_3d34ab2e06", on_delete: :nullify
add_foreign_key "ci_pipelines", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_262d4c2d19", on_delete: :nullify