-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ubuntu 18.04 LTS (Bionic) Support
* Adds patch for Postgres 10 https://stackoverflow.com/a/51373732/387558 * Adds Cosmic repo for pdftk-java https://askubuntu.com/a/1028983
- Loading branch information
1 parent
1f2a600
commit b4983e4
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'active_record/connection_adapters/postgresql/schema_statements' | ||
|
||
# | ||
# Monkey-patch the refused Rails 4.2 patch at https://github.com/rails/rails/pull /31330 | ||
# | ||
# Updates sequence logic to support PostgreSQL 10. | ||
# | ||
|
||
module ActiveRecord | ||
module ConnectionAdapters | ||
module PostgreSQL | ||
module SchemaStatements | ||
# Resets the sequence of a table's primary key to the maximum value. | ||
def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc: | ||
unless pk and sequence | ||
default_pk, default_sequence = pk_and_sequence_for(table) | ||
|
||
pk ||= default_pk | ||
sequence ||= default_sequence | ||
end | ||
|
||
if @logger && pk && !sequence | ||
@logger.warn "#{table} has primary key #{pk} with no default sequence" | ||
end | ||
|
||
if pk && sequence | ||
quoted_sequence = quote_table_name(sequence) | ||
max_pk = select_value("SELECT MAX(#{quote_column_name pk}) FROM #{quote_table_name(table)}") | ||
if max_pk.nil? | ||
if postgresql_version >= 100000 | ||
minvalue = select_value("SELECT seqmin FROM pg_sequence WHERE seqrelid = #{quote(quoted_sequence)}::regclass") | ||
else | ||
minvalue = select_value("SELECT min_value FROM #{quoted_sequence}") | ||
end | ||
end | ||
|
||
select_value <<-end_sql, 'SCHEMA' | ||
SELECT setval(#{quote(quoted_sequence)}, #{max_pk ? max_pk : minvalue}, #{max_pk ? true : false}) | ||
end_sql | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
build-essential | ||
bundler | ||
catdoc | ||
elinks | ||
geoip-database | ||
gettext | ||
ghostscript | ||
gnuplot-nox | ||
imagemagick | ||
libicu-dev | ||
libmagic-dev | ||
libmagickwand-dev | ||
libpq-dev | ||
libsqlite3-dev | ||
libxml2-dev | ||
libxslt-dev | ||
links | ||
lockfile-progs | ||
memcached | ||
mutt | ||
pdftk-java | ||
poppler-utils | ||
postgresql | ||
postgresql-client | ||
python-yaml | ||
rake | ||
ruby | ||
ruby-dev | ||
sqlite3 | ||
tnef | ||
ttf-bitstream-vera | ||
unrtf | ||
unzip | ||
uuid-dev | ||
wkhtmltopdf-static | ||
wv | ||
xapian-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters