Sha256: 440df4b57add567a8ff64c4718376a472312529740d770367f11f4a5dd37386d

Contents?: true

Size: 825 Bytes

Versions: 2

Compression:

Stored size: 825 Bytes

Contents

Sequel.migration do
  transaction
  up do
    run 'ALTER TABLE `relationships` ADD CONSTRAINT `relationship_chain_id` FOREIGN KEY (`chain_id`) REFERENCES `chains` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;'
    run 'ALTER TABLE `relationships` ADD CONSTRAINT `relationship_trigger_id` FOREIGN KEY (`trigger_id`) REFERENCES `functions` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;'
    run 'ALTER TABLE `relationships` ADD CONSTRAINT `relationship_action_id` FOREIGN KEY (`action_id`) REFERENCES `functions` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;'
  end

  down do
    run 'ALTER TABLE `relationships` DROP FOREIGN KEY `relationship_action_id`;'
    run 'ALTER TABLE `relationships` DROP FOREIGN KEY `relationship_trigger_id`;'
    run 'ALTER TABLE `relationships` DROP FOREIGN KEY `relationship_chain_id`;'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
legion-data-0.1.1 lib/legion/data/migrations/015_relationships_foreign_keys.rb
legion-data-0.1.0 lib/legion/data/migrations/015_relationships_foreign_keys.rb