Created
January 19, 2022 21:00
-
-
Save 0x000def42/0af491570bd3b237149dd002c129ca05 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.connection.execute('select \'drop table "\' || tablename || \'" cascade;\' from pg_tables where schemaname = \'public\'').to_a.map{|e| e.values[0]}.each {|stmt| ActiveRecord::Base.connection.execute(stmt)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's can be executed under
rails c