veganstraightedge,
@veganstraightedge@ruby.social avatar

Re-upping my plea for help!

I’m really jammed up on this and blocked by it

When I get it solved, I get to delete 55 triggers and a gem!

And then a similar amount in three other rails apps

Help!?
https://ruby.social/@veganstraightedge/112340159120060018

jesseplusplus,
@jesseplusplus@mastodon.social avatar

@veganstraightedge if fx doesn’t offer a function to do that for you, I would write the migration in raw SQL. Postgres has a DROP TRIGGER IF EXISTS: https://www.postgresql.org/docs/current/sql-droptrigger.html

jamie,
@jamie@zomglol.wtf avatar

@jesseplusplus @veganstraightedge Was just coming to say this. I don’t see a lot of (or any?) functionality in ActiveRecord for dealing with triggers or SQL functions. The raw SQL with the IF EXISTS clause seems to be the best route.

veganstraightedge,
@veganstraightedge@ruby.social avatar

@jamie @jesseplusplus thanks, both of yall!

honestly, I’m surprised that the fx gem doesn’t have this (that I know of) as an argument on drop_function and drop_trigger

jesseplusplus,
@jesseplusplus@mastodon.social avatar

@veganstraightedge @jamie I’m surprised too. I would honestly expect the drop trigger function to use the IF EXISTS as the default for safety. Maybe you can submit a PR 🙂

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines