From 2b0142580f9c5e0b9dc54d1e338e355b235bb844 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 16 Dec 2006 13:37:32 +0000 Subject: "queries" branch merged git-svn-id: http://redmine.rubyforge.org/svn/trunk@95 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- db/migrate/013_create_queries.rb | 15 +++++++++++++++ db/migrate/014_add_queries_permissions.rb | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 db/migrate/013_create_queries.rb create mode 100644 db/migrate/014_add_queries_permissions.rb (limited to 'db/migrate') 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 -- cgit v1.2.3