diff --git a/app/models/account.rb b/app/models/account.rb index 62bb0d450..0cfc14293 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -21,7 +21,8 @@ class Account < ApplicationRecord include Featurable DEFAULT_QUERY_SETTING = { - flag_query_mode: :bit_operator + flag_query_mode: :bit_operator, + check_for_column: false }.freeze ACCOUNT_SETTINGS_FLAGS = { diff --git a/app/models/channel/web_widget.rb b/app/models/channel/web_widget.rb index 793544531..591efcaab 100644 --- a/app/models/channel/web_widget.rb +++ b/app/models/channel/web_widget.rb @@ -39,7 +39,9 @@ class Channel::WebWidget < ApplicationRecord has_flags 1 => :attachments, 2 => :emoji_picker, - :column => 'feature_flags' + :column => 'feature_flags', + :check_for_column => false + enum reply_time: { in_a_few_minutes: 0, in_a_few_hours: 1, in_a_day: 2 } def name diff --git a/app/models/concerns/featurable.rb b/app/models/concerns/featurable.rb index f8ffde185..5e6b8b8db 100644 --- a/app/models/concerns/featurable.rb +++ b/app/models/concerns/featurable.rb @@ -2,7 +2,8 @@ module Featurable extend ActiveSupport::Concern QUERY_MODE = { - flag_query_mode: :bit_operator + flag_query_mode: :bit_operator, + check_for_column: false }.freeze FEATURE_LIST = YAML.safe_load(File.read(Rails.root.join('config/features.yml'))).freeze diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb index d31d003a5..bf030304f 100644 --- a/app/models/notification_setting.rb +++ b/app/models/notification_setting.rb @@ -23,7 +23,8 @@ class NotificationSetting < ApplicationRecord belongs_to :user DEFAULT_QUERY_SETTING = { - flag_query_mode: :bit_operator + flag_query_mode: :bit_operator, + check_for_column: false }.freeze EMAIL_NOTIFICATION_FLAGS = ::Notification::NOTIFICATION_TYPES.transform_keys { |key| "email_#{key}".to_sym }.invert.freeze diff --git a/config/database.yml b/config/database.yml index e60358062..b2e012f4d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,6 +3,7 @@ default: &default encoding: unicode pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> host: <%= ENV.fetch('POSTGRES_HOST', 'localhost') %> + port: <%= ENV.fetch('POSTGRES_PORT', '5432') %> development: <<: *default diff --git a/docker/entrypoints/helpers/pg_database_url.sh b/docker/entrypoints/helpers/pg_database_url.sh index 05424ceb0..89a36c164 100755 --- a/docker/entrypoints/helpers/pg_database_url.sh +++ b/docker/entrypoints/helpers/pg_database_url.sh @@ -5,6 +5,6 @@ require 'uri' if !ENV['DATABASE_URL'].nil? && ENV['DATABASE_URL'] != '' uri = URI(ENV['DATABASE_URL']) puts "export POSTGRES_HOST=#{uri.host} POSTGRES_PORT=#{uri.port} POSTGRES_USERNAME=#{uri.user}" -else - puts "export POSTGRES_PORT=5432" -end \ No newline at end of file +elif ENV['POSTGRES_PORT'].nil? || ENV['POSTGRES_PORT'] == '' + puts "export POSTGRES_PORT=5432" +end