Fix up the schema relationships

unstable
HD Moore 2012-06-14 00:23:23 -05:00
parent 2aa9de7f63
commit 80db388354
1 changed files with 36 additions and 36 deletions

View File

@ -2,7 +2,7 @@ class AddModuleDetails < ActiveRecord::Migration
def self.up
create_table :module_details do |t|
create_table :modules_details do |t|
t.timestamp :mtime # disk modified time
t.text :file # location on disk
t.string :type # exploit, auxiliary, post, etc
@ -18,68 +18,68 @@ class AddModuleDetails < ActiveRecord::Migration
t.string :stance # "passive"
end
add_index :module_details, :refname
add_index :module_details, :name
add_index :modules_details, :refname
add_index :modules_details, :name
create_table :module_authors do |t|
create_table :modules_authors do |t|
t.text :name
t.text :email
end
create_table :module_details_authors, :id => false do |t|
create_table :modules_details_authors, :id => false do |t|
t.integer :module_detail_id
t.integer :module_author_id
end
create_table :module_mixins do |t|
create_table :modules_mixins do |t|
t.text :name
end
create_table :module_details_mixins, :id => false do |t|
create_table :modules_details_mixins, :id => false do |t|
t.integer :module_detail_id
t.integer :module_mixin_id
end
create_table :module_targets do |t|
create_table :modules_targets do |t|
t.integer :index
t.text :name
end
create_table :module_details_targets, :id => false do |t|
create_table :modules_details_targets, :id => false do |t|
t.integer :module_detail_id
t.integer :module_target_id
end
create_table :module_actions do |t|
create_table :modules_actions do |t|
t.text :name
end
create_table :module_details_actions, :id => false do |t|
create_table :modules_details_actions, :id => false do |t|
t.integer :module_detail_id
t.integer :module_action_id
end
create_table :module_refs do |t|
create_table :modules_refs do |t|
t.text :name
end
create_table :module_details_refs, :id => false do |t|
create_table :modules_details_refs, :id => false do |t|
t.integer :module_detail_id
t.integer :module_ref_id
end
add_index :module_refs, :name
add_index :modules_refs, :name
create_table :module_archs do |t|
create_table :modules_archs do |t|
t.text :name
end
create_table :module_details_archs, :id => false do |t|
create_table :modules_details_archs, :id => false do |t|
t.integer :module_detail_id
t.integer :module_arch_id
end
create_table :module_platforms do |t|
create_table :modules_platforms do |t|
t.text :name
end
create_table :module_details_platforms, :id => false do |t|
create_table :modules_details_platforms, :id => false do |t|
t.integer :module_detail_id
t.integer :module_platform_id
end
@ -87,24 +87,24 @@ class AddModuleDetails < ActiveRecord::Migration
end
def self.down
remove_index :module_details, :refname
remove_index :module_details, :name
remove_index :module_refs, :name
remove_index :modules_details, :refname
remove_index :modules_details, :name
remove_index :modules_refs, :name
drop_table :module_details
drop_table :module_authors
drop_table :module_details_authors
drop_table :module_mixins
drop_table :module_details_mixins
drop_table :module_targets
drop_table :module_details_targets
drop_table :module_actions
drop_table :module_details_actions
drop_table :module_refs
drop_table :module_details_refs
drop_table :module_archs
drop_table :module_details_archs
drop_table :module_platforms
drop_table :module_details_platforms
drop_table :modules_details
drop_table :modules_authors
drop_table :modules_details_authors
drop_table :modules_mixins
drop_table :modules_details_mixins
drop_table :modules_targets
drop_table :modules_details_targets
drop_table :modules_actions
drop_table :modules_details_actions
drop_table :modules_refs
drop_table :modules_details_refs
drop_table :modules_archs
drop_table :modules_details_archs
drop_table :modules_platforms
drop_table :modules_details_platforms
end
end