summaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2006-12-16 13:37:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2006-12-16 13:37:32 +0000
commit2b0142580f9c5e0b9dc54d1e338e355b235bb844 (patch)
treee5128fc007811c52a15391ee773eaae3fdbecdae /db/migrate
parent236c735d08c097cfe1a7e5f5c52a9dd6711250aa (diff)
downloadredmine-2b0142580f9c5e0b9dc54d1e338e355b235bb844.tar.gz
redmine-2b0142580f9c5e0b9dc54d1e338e355b235bb844.zip
"queries" branch merged
git-svn-id: http://redmine.rubyforge.org/svn/trunk@95 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/013_create_queries.rb15
-rw-r--r--db/migrate/014_add_queries_permissions.rb9
2 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/013_create_queries.rb b/db/migrate/013_create_queries.rb
new file mode 100644
index 000000000..e0e8c90c0
--- /dev/null
+++ b/db/migrate/013_create_queries.rb
@@ -0,0 +1,15 @@
+class CreateQueries < ActiveRecord::Migration
+ def self.up
+ create_table :queries, :force => true do |t|
+ t.column "project_id", :integer
+ t.column "name", :string, :default => "", :null => false
+ t.column "filters", :text
+ t.column "user_id", :integer, :default => 0, :null => false
+ t.column "is_public", :boolean, :default => false, :null => false
+ end
+ end
+
+ def self.down
+ drop_table :queries
+ end
+end
diff --git a/db/migrate/014_add_queries_permissions.rb b/db/migrate/014_add_queries_permissions.rb
new file mode 100644
index 000000000..27d674650
--- /dev/null
+++ b/db/migrate/014_add_queries_permissions.rb
@@ -0,0 +1,9 @@
+class AddQueriesPermissions < ActiveRecord::Migration
+ def self.up
+ Permission.create :controller => "projects", :action => "add_query", :description => "button_create", :sort => 600, :is_public => false, :mail_option => 0, :mail_enabled => 0
+ end
+
+ def self.down
+ Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'add_query']).destroy
+ end
+end