File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ def cast_with_dbschema(object, type)
3131 :dbschema_alter_column_default
3232 when ::DbSchema ::Operations ::CreateIndex
3333 :dbschema_create_index
34+ when ::DbSchema ::Operations ::DropIndex
35+ :dbschema_drop_index
3436 when ::DbSchema ::Operations ::CreateCheckConstraint
3537 :dbschema_create_check_constraint
3638 when ::DbSchema ::Operations ::CreateForeignKey
@@ -109,6 +111,13 @@ def awesome_dbschema_create_index(object)
109111 "#<#{ object . class } #{ object . index . name . ai } on #{ columns } #{ using } #{ data . join ( ', ' ) } >"
110112 end
111113
114+ def awesome_dbschema_drop_index ( object )
115+ data = [ object . name . ai ]
116+ data << colorize ( 'primary key' , :nilclass ) if object . primary?
117+
118+ "#<#{ object . class } #{ data . join ( ' ' ) } >"
119+ end
120+
112121 def awesome_dbschema_create_check_constraint ( object )
113122 "#<#{ object . class } #{ object . check . name . ai } #{ object . check . condition . ai } >"
114123 end
You can’t perform that action at this time.
0 commit comments