Sha256: 6230dbef72e22b4f972d2c38bfd80a707e05156bcfb62da5955720cde29a42e2

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

Sequel.migration do
  up do
    run "CREATE TABLE `relationships` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `chain_id` int(11) unsigned DEFAULT NULL,
  `trigger_id` int(11) unsigned NOT NULL,
  `action_id` int(11) unsigned NOT NULL,
  `delay` int(11) unsigned NOT NULL DEFAULT '0',
  `allow_new_chains` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `conditions` text,
  `transformation` text,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `chain_id` (`chain_id`),
  CONSTRAINT `function_chain_id` FOREIGN KEY (`chain_id`) REFERENCES `chains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `relationship_action_id` FOREIGN KEY (`action_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `relationship_trigger_id` FOREIGN KEY (`trigger_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
  end

  down do
    drop :task_logs
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legion-data-0.2.0 lib/legion/data/migrations/014_add_relationships.rb