hair_trigger icon indicating copy to clipboard operation
hair_trigger copied to clipboard

Triggers at the beginning of schema, before tables created

Open sportsbook123 opened this issue 7 years ago • 1 comments

When I dump a schema for a DB with some triggers on some tables, them triggers are added at the top of the schema.rb file before the table definitions. When trying to load the schema it throws errors for the missing tables.

Any way around this? Basically need to be able to specify triggers should go last in the schema file.

sportsbook123 avatar Nov 30 '17 19:11 sportsbook123

Hi @sportsbook123, I haven't seen this issue before. The triggers are added at the very end of the schema dumping code by extending the trailer method (which normally just outputs the end)

Anything unusual happening in your environment or other details you could provide, e.g. rails version, Gemfile, whether you use multiple dbs, etc.?

jenseng avatar Feb 08 '19 05:02 jenseng