2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/generators/templates/permissive_migration.rb', line 2
def self.up
create_table :permissive_permissions do |t|
t.integer :circle_id
t.integer :mask, :null => false, :default => 0
t.timestamps
end
create_table :permissive_groupings do |t|
t.integer :permission_id
t.integer :permissible_id
t.string :permissible_type
t.timestamps
end
create_table :permissive_circles do |t|
t.string :name
t.string :guid
t.timestamps
end
create_table :permissive_circlings do |t|
t.string :circleable_type
t.integer :circleable_id
t.integer :circle_id
t.timestamps
end
add_index :permissive_permissions, :circle_id, :name => "circles_index"
add_index :permissive_permissions, :mask, :name => "masks_masks"
add_index :permissive_groupings, [:permissible_id, :permissible_type], :name => "grouper_index"
add_index :permissive_groupings, :permission_id, :name => "permission_grouping_index"
add_index :permissive_circles, :guid, :name => "circle_guids_index"
add_index :permissive_circles, :name, :name => "circle_name_index"
add_index :permissive_circlings, [:circleable_id, :circleable_type], :name => "thing_circling_index"
add_index :permissive_circlings, :circle_id, :name => "circle_circling_index"
end
|