Skip to content

Commit

Permalink
remove sqlite from supported database adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
roylez committed Jan 8, 2022
1 parent 8651ef2 commit 3ff610d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN umask 002 && git init && \

COPY . .

ENV LC_ALL=en_US.UTF-8 RAILS_ENV=production DATABASE_URL=sqlite3:/data/huginn.db
ENV LC_ALL=en_US.UTF-8 RAILS_ENV=production DATABASE_URL=postgres://localhost

RUN bundle exec rails assets:precompile && rm -rf app/assets spec

Expand All @@ -58,7 +58,7 @@ RUN addgroup -g 1000 -S app \

RUN apk --update add --no-cache \
git zlib yaml libssl3 gdbm readline ncurses-libs libffi libxml2 libxslt icu \
sqlite-libs mariadb-connector-c libpq \
mariadb-connector-c libpq \
graphviz curl tzdata shared-mime-info iputils jq \
libc6-compat nodejs && \
mkdir /data && \
Expand All @@ -74,7 +74,7 @@ ENV LC_ALL=en_US.UTF-8 \
RAILS_LOG_TO_STDOUT=true \
RAILS_SERVE_STATIC_FILES=true \
IP="0.0.0.0" PORT=3000 \
DATABASE_URL=sqlite3:/data/huginn.db \
DATABASE_URL=postgres://localhost \
APP_SECRET_TOKEN=changeme

USER app
Expand Down
4 changes: 0 additions & 4 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,4 @@
config.action_mailer.delivery_method = ENV.fetch('SMTP_DELIVERY_METHOD', 'smtp').to_sym
config.action_mailer.perform_caching = false
# smtp_settings moved to config/initializers/action_mailer.rb

if ENV['DATABASE_URL'].start_with? "sqlite"
config.middleware.use ConnectionManagement
end
end
18 changes: 0 additions & 18 deletions lib/connection_management.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/rdbms_functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ def rdbms_date_add(source, unit, amount)
"DATE_ADD(`#{source}`, INTERVAL #{amount} #{unit})"
when :postgresql
"(#{source} + INTERVAL '#{amount} #{unit}')"
when :sqlite
"datetime('#{source}', '+ #{amount} #{unit}')"
else
raise NotImplementedError, "Unknown adapter type '#{adapter_type}'"
end
Expand Down

0 comments on commit 3ff610d

Please sign in to comment.