Sha256: b4183cda0c527c065cd9d6195d850cc740cc0a2fca20b0efadfabd82ceaa4c1e
Contents?: true
Size: 629 Bytes
Versions: 1
Compression:
Stored size: 629 Bytes
Contents
class AddForeignKeysToProfissionaisUnidadesSaude < ActiveRecord::Migration[5.0] def up ActiveRecord::Base.connection.execute( "UPDATE profissionais_unidades_saude SET created_at = NOW(), updated_at = NOW() WHERE CAST(created_at AS CHAR(20)) = '0000-00-00 00:00:00'" ) add_foreign_key :profissionais_unidades_saude, :profissionais, on_delete: :cascade add_foreign_key :profissionais_unidades_saude, :unidades_saude, on_delete: :cascade end def down remove_foreign_key :profissionais_unidades_saude, :profissionais remove_foreign_key :profissionais_unidades_saude, :unidades_saude end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
omniauth-sabia-1.0.1 | db/migrate/20170525102825_add_foreign_keys_to_profissionais_unidades_saude.rb |