summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-02-22 07:08:23 -0500
committerPeter Kozak <spag@golwen.net>2013-02-22 07:08:23 -0500
commit2a9b798f9e122582abb36605a7d4a1da0e70eca9 (patch)
tree45fe362d677cb243fba57dc7c0c23d01e653863e /db/migrate
parentd6009d77ffa221c14a4536be98a04e8e4b6474a9 (diff)
pickup group permission model added
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20130222074610_create_groups.rb14
-rw-r--r--db/migrate/20130222074652_create_group_memberships.rb14
-rw-r--r--db/migrate/20130222092313_create_group_permissions.rb14
3 files changed, 42 insertions, 0 deletions
diff --git a/db/migrate/20130222074610_create_groups.rb b/db/migrate/20130222074610_create_groups.rb
new file mode 100644
index 0000000..e5848b9
--- /dev/null
+++ b/db/migrate/20130222074610_create_groups.rb
@@ -0,0 +1,14 @@
+class CreateGroups < ActiveRecord::Migration
+ def self.up
+ create_table :groups do |t|
+ t.string :name
+ t.boolean :active
+ t.string :comment
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :groups
+ end
+end
diff --git a/db/migrate/20130222074652_create_group_memberships.rb b/db/migrate/20130222074652_create_group_memberships.rb
new file mode 100644
index 0000000..e572445
--- /dev/null
+++ b/db/migrate/20130222074652_create_group_memberships.rb
@@ -0,0 +1,14 @@
+class CreateGroupMemberships < ActiveRecord::Migration
+ def self.up
+ create_table :group_memberships do |t|
+ t.integer :group_id
+ t.string :item_type
+ t.integer :item_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :group_memberships
+ end
+end
diff --git a/db/migrate/20130222092313_create_group_permissions.rb b/db/migrate/20130222092313_create_group_permissions.rb
new file mode 100644
index 0000000..5949819
--- /dev/null
+++ b/db/migrate/20130222092313_create_group_permissions.rb
@@ -0,0 +1,14 @@
+class CreateGroupPermissions < ActiveRecord::Migration
+ def self.up
+ create_table :group_permissions do |t|
+ t.integer :group_id
+ t.string :permission
+ t.integer :target_group_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :group_permissions
+ end
+end