Skip to content

Instantly share code, notes, and snippets.

View muhammadkholidb's full-sized avatar

Muhammad Kholid B muhammadkholidb

View GitHub Profile
@muhammadkholidb
muhammadkholidb / fix-pgsql-sequence.sql
Created June 15, 2020 12:38
Fixing PostgreSQL Sequence
SELECT 'SELECT SETVAL(' ||
quote_literal(quote_ident(PGT.schemaname) || '.' || quote_ident(S.relname)) ||
', COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) ) FROM ' ||
quote_ident(PGT.schemaname)|| '.'||quote_ident(T.relname)|| ';'
FROM pg_class AS S,
pg_depend AS D,
pg_class AS T,
pg_attribute AS C,
pg_tables AS PGT
WHERE S.relkind = 'S'
// Install openssl 1.0.0
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
rvm install 2.1 --with-openssl-dir=/usr/local/opt/openssl
brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=/usr/local/opt/v8@3.15