Skip to content

self-hosted sentry with docker file and data migration

Notifications You must be signed in to change notification settings

mohammadmasoumi/docker-sentry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

docker sentry

self-hosted sentry with docker file and data migration

Reset postgres auth increment after importing data

export USER="sentry"
export DATABASE="postgres"

cat << 'EOF' >> prepare.sql
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'
    AND S.oid = D.objid
    AND D.refobjid = T.oid
    AND D.refobjid = C.attrelid
    AND D.refobjsubid = C.attnum
    AND T.relname = PGT.tablename
ORDER BY S.relname;
EOF

psql -Atq -f prepare.sql -o fix.sql "$DATABASE" "$USER"
psql -f fix.sql "$DATABASE" "$USER"


About

self-hosted sentry with docker file and data migration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published