Skip to content

Sequel+postgresql truncate strategy fails if there's tables in other schemas #9

Description

@joevandyk

If I have a table in the "audit" schema on postgresql, using the Sequel truncate strategy will fail. A quick review of the code shows something like this is happening:

execute "truncate #{ db.tables.join(', ')"

db.tables will return a list of all the tables without being schema-qualified. So if I have public.orders and audit.logged_actions, this gets ran: truncate orders, logged_actions which will fail.

A possible solution is to get this SQL running instead: truncate public.orders, audit.logged_actions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions