File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ func (c ForeignKeySchema) Add() {
4343
4444// Return SQL to drop the table
4545func (c ForeignKeySchema ) Drop () {
46- fmt .Printf ("ALTER TABLE %s DROP CONSTRAINT %s;\n " , c .row ["table_name" ], c .row ["constraint_name" ])
46+ fmt .Printf ("ALTER TABLE %s DROP CONSTRAINT IF EXISTS %s;\n " , c .row ["table_name" ], c .row ["constraint_name" ])
4747}
4848
4949// Handle the case where the table and column match, but the details do not
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ func (c TableSchema) Add() {
3838
3939// Return SQL to drop the table
4040func (c TableSchema ) Drop () {
41- fmt .Printf ("DROP TABLE %s;\n " , c .row ["table_name" ])
41+ fmt .Printf ("DROP TABLE IF EXISTS %s;\n " , c .row ["table_name" ])
4242}
4343
4444// Handle the case where the table and column match, but the details do not
You can’t perform that action at this time.
0 commit comments