Flowdock
method

remove_default_constraint

Importance_0
v1.1.6 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::SQLServerAdapter
remove_default_constraint(table_name, column_name) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb, line 461
      def remove_default_constraint(table_name, column_name)
        defaults = select "select def.name from sysobjects def, syscolumns col, sysobjects tab where col.cdefault = def.id and col.name = '#{column_name}' and tab.name = '#{table_name}' and col.id = tab.id"
        defaults.each {|constraint|
          execute "ALTER TABLE #{table_name} DROP CONSTRAINT #{constraint["name"]}"
        }
      end
Register or log in to add new notes.