diff --git a/app/assets/javascripts/discourse/templates/flag.js.handlebars b/app/assets/javascripts/discourse/templates/flag.js.handlebars
index 1ddebe9b7bc..3d1f3e2898d 100644
--- a/app/assets/javascripts/discourse/templates/flag.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/flag.js.handlebars
@@ -6,18 +6,21 @@
+ {{#if is_custom_flag}}
+ {{#if view.isCustomFlag}}
+ {{view Ember.TextArea name="message" class="flag-message" placeholderBinding="view.customPlaceholder" valueBinding="view.customFlagMessage"}}
+
{{view.customMessageLength}}
+ {{/if}}
+ {{/if}}
{{/each}}
diff --git a/app/assets/javascripts/discourse/views/flag_view.js.coffee b/app/assets/javascripts/discourse/views/flag_view.js.coffee
index ad020ed1b78..1753b3c1f3c 100644
--- a/app/assets/javascripts/discourse/views/flag_view.js.coffee
+++ b/app/assets/javascripts/discourse/views/flag_view.js.coffee
@@ -3,6 +3,8 @@ window.Discourse.FlagView = Ember.View.extend
title: Em.String.i18n('flagging.title')
changePostActionType: (action) ->
+ if @get('postActionTypeId') == action.id
+ return false
@set('postActionTypeId', action.id)
@set('isCustomFlag', action.is_custom_flag)
Em.run.next -> $("#radio_#{action.name_key}").prop('checked', 'true')
@@ -40,7 +42,7 @@ window.Discourse.FlagView = Ember.View.extend
message = Em.String.i18n("flagging.custom_message.left", n: 500 - len)
@set("customMessageLengthClasses", "ok custom-message-length")
@set("customMessageLength",message)
-
+ return
).observes("customFlagMessage")
didInsertElement: ->
@@ -51,3 +53,4 @@ window.Discourse.FlagView = Ember.View.extend
# Would be nice if there were an EmberJs radio button to do this for us. Oh well, one should be coming
# in an upcoming release.
$("input[type='radio']", $flagModal).prop('checked', false)
+ return
diff --git a/db/structure.sql b/db/structure.sql
index 50340548078..f1a3fe910fb 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -71,7 +71,7 @@ CREATE TABLE categories (
--
CREATE SEQUENCE categories_id_seq
- START WITH 2
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -125,7 +125,7 @@ CREATE TABLE category_featured_users (
--
CREATE SEQUENCE category_featured_users_id_seq
- START WITH 247
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -156,7 +156,7 @@ CREATE TABLE draft_sequences (
--
CREATE SEQUENCE draft_sequences_id_seq
- START WITH 16
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -190,7 +190,7 @@ CREATE TABLE drafts (
--
CREATE SEQUENCE drafts_id_seq
- START WITH 2
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -223,7 +223,7 @@ CREATE TABLE email_logs (
--
CREATE SEQUENCE email_logs_id_seq
- START WITH 3
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -258,7 +258,7 @@ CREATE TABLE email_tokens (
--
CREATE SEQUENCE email_tokens_id_seq
- START WITH 3
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -505,7 +505,7 @@ CREATE TABLE post_action_types (
--
CREATE SEQUENCE post_action_types_id_seq
- START WITH 6
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -636,7 +636,7 @@ CREATE TABLE posts (
--
CREATE SEQUENCE posts_id_seq
- START WITH 12
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -727,7 +727,7 @@ CREATE TABLE site_settings (
--
CREATE SEQUENCE site_settings_id_seq
- START WITH 6
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -759,7 +759,7 @@ CREATE TABLE topic_allowed_users (
--
CREATE SEQUENCE topic_allowed_users_id_seq
- START WITH 3
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -951,7 +951,7 @@ CREATE TABLE topics (
--
CREATE SEQUENCE topics_id_seq
- START WITH 14
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -1057,7 +1057,7 @@ CREATE TABLE user_actions (
--
CREATE SEQUENCE user_actions_id_seq
- START WITH 27
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -1121,7 +1121,7 @@ CREATE TABLE user_visits (
--
CREATE SEQUENCE user_visits_id_seq
- START WITH 6
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -1187,7 +1187,7 @@ CREATE TABLE users (
--
CREATE SEQUENCE users_id_seq
- START WITH 3
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@@ -1236,7 +1236,7 @@ CREATE TABLE versions (
--
CREATE SEQUENCE versions_id_seq
- START WITH 2
+ START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE