Diff
Modified: trunk/config/schema.d/packs.xml (2716 => 2717)
--- trunk/config/schema.d/packs.xml 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/config/schema.d/packs.xml 2011-10-11 10:18:22 UTC (rev 2717)
@@ -17,12 +17,12 @@
<table name="pack_contributable_entries">
- <column type="integer" name="pack_id"/>
- <column type="integer" name="contributable_id"/>
+ <column type="integer" name="pack_id" null="false"/>
+ <column type="integer" name="contributable_id" null="false"/>
<column type="integer" name="contributable_version"/>
<column type="string" name="contributable_type"/>
<column type="text" name="comment"/>
- <column type="integer" name="user_id"/>
+ <column type="integer" name="user_id" null="false"/>
<column type="datetime" name="created_at"/>
<column type="datetime" name="updated_at"/>
@@ -30,12 +30,12 @@
<table name="pack_remote_entries">
- <column type="integer" name="pack_id"/>
+ <column type="integer" name="pack_id" null="false"/>
<column type="string" name="title"/>
<column type="string" name="uri"/>
<column type="string" name="alternate_uri"/>
<column type="text" name="comment"/>
- <column type="integer" name="user_id"/>
+ <column type="integer" name="user_id" null="false"/>
<column type="datetime" name="created_at"/>
<column type="datetime" name="updated_at"/>
Modified: trunk/db/migrate/006_create_relationships.rb (2716 => 2717)
--- trunk/db/migrate/006_create_relationships.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/006_create_relationships.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,15 +5,15 @@
class CreateRelationships < ActiveRecord::Migration
def self.up
- create_table :relationships do |t|
- t.column :network_id, :integer
- t.column :relation_id, :integer
- t.column :created_at, :datetime
- t.column :accepted_at, :datetime
- end
+# create_table :relationships do |t|
+# t.column :network_id, :integer
+# t.column :relation_id, :integer
+# t.column :created_at, :datetime
+# t.column :accepted_at, :datetime
+# end
end
def self.down
- drop_table :relationships
+# drop_table :relationships
end
end
Modified: trunk/db/migrate/009_create_contributions.rb (2716 => 2717)
--- trunk/db/migrate/009_create_contributions.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/009_create_contributions.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,21 +5,21 @@
class CreateContributions < ActiveRecord::Migration
def self.up
- create_table :contributions do |t|
- t.column :contributor_id, :integer
- t.column :contributor_type, :string
-
- t.column :contributable_id, :integer
- t.column :contributable_type, :string
-
- t.column :policy_id, :integer
-
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :contributions do |t|
+# t.column :contributor_id, :integer
+# t.column :contributor_type, :string
+#
+# t.column :contributable_id, :integer
+# t.column :contributable_type, :string
+#
+# t.column :policy_id, :integer
+#
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
end
def self.down
- drop_table :contributions
+# drop_table :contributions
end
end
Modified: trunk/db/migrate/010_create_policies.rb (2716 => 2717)
--- trunk/db/migrate/010_create_policies.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/010_create_policies.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,26 +5,26 @@
class CreatePolicies < ActiveRecord::Migration
def self.up
- create_table :policies do |t|
- t.column :contributor_id, :integer
- t.column :contributor_type, :string
-
- t.column :name, :string
-
- t.column :download_public, :boolean, :default => true
- t.column :edit_public, :boolean, :default => true
- t.column :view_public, :boolean, :default => true
-
- t.column :download_protected, :boolean, :default => true
- t.column :edit_protected, :boolean, :default => true
- t.column :view_protected, :boolean, :default => true
-
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :policies do |t|
+# t.column :contributor_id, :integer
+# t.column :contributor_type, :string
+#
+# t.column :name, :string
+#
+# t.column :download_public, :boolean, :default => true
+# t.column :edit_public, :boolean, :default => true
+# t.column :view_public, :boolean, :default => true
+#
+# t.column :download_protected, :boolean, :default => true
+# t.column :edit_protected, :boolean, :default => true
+# t.column :view_protected, :boolean, :default => true
+#
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
end
def self.down
- drop_table :policies
+# drop_table :policies
end
end
Modified: trunk/db/migrate/012_create_blobs.rb (2716 => 2717)
--- trunk/db/migrate/012_create_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/012_create_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,18 +5,18 @@
class CreateBlobs < ActiveRecord::Migration
def self.up
- create_table :blobs do |t|
- t.column :contributor_id, :integer
- t.column :contributor_type, :string
- t.column :local_name, :string
- t.column :content_type, :string
- t.column :data, :binary
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :blobs do |t|
+# t.column :contributor_id, :integer
+# t.column :contributor_type, :string
+# t.column :local_name, :string
+# t.column :content_type, :string
+# t.column :data, :binary
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
end
def self.down
- drop_table :blobs
+# drop_table :blobs
end
end
Modified: trunk/db/migrate/013_create_workflows.rb (2716 => 2717)
--- trunk/db/migrate/013_create_workflows.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/013_create_workflows.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,34 +5,34 @@
class CreateWorkflows < ActiveRecord::Migration
def self.up
- create_table :workflows do |t|
- t.column :contributor_id, :integer
- t.column :contributor_type, :string
-
- t.column :scufl, :binary
- t.column :image, :string
- t.column :svg, :string
-
- t.column :title, :string
- t.column :unique_name, :string
-
- t.column :body, :text
- t.column :body_html, :text
-
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
-
- t.column :license, :string,
- :limit => 10, :null => false,
- :default => "by-sa"
- end
+# create_table :workflows do |t|
+# t.column :contributor_id, :integer
+# t.column :contributor_type, :string
+#
+# t.column :scufl, :binary
+# t.column :image, :string
+# t.column :svg, :string
+#
+# t.column :title, :string
+# t.column :unique_name, :string
+#
+# t.column :body, :text
+# t.column :body_html, :text
+#
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+#
+# t.column :license, :string,
+# :limit => 10, :null => false,
+# :default => "by-sa"
+# end
- Workflow.create_versioned_table
+# Workflow.create_versioned_table
end
def self.down
- drop_table :workflows
+# drop_table :workflows
- Workflow.drop_versioned_table
+# Workflow.drop_versioned_table
end
end
Modified: trunk/db/migrate/018_savage_beast_tables.rb (2716 => 2717)
--- trunk/db/migrate/018_savage_beast_tables.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/018_savage_beast_tables.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -6,74 +6,74 @@
class SavageBeastTables < ActiveRecord::Migration
def self.up
- create_table "forums", :force => true do |t|
- t.column "name", :string
- t.column "contributor_id", :integer
- t.column "contributor_type", :string
- t.column "description", :string
- t.column "topics_count", :integer, :default => 0
- t.column "posts_count", :integer, :default => 0
- t.column "position", :integer
- t.column "description_html", :text
- end
+# create_table "forums", :force => true do |t|
+# t.column "name", :string
+# t.column "contributor_id", :integer
+# t.column "contributor_type", :string
+# t.column "description", :string
+# t.column "topics_count", :integer, :default => 0
+# t.column "posts_count", :integer, :default => 0
+# t.column "position", :integer
+# t.column "description_html", :text
+# end
- create_table "moderatorships", :force => true do |t|
- t.column "forum_id", :integer
- t.column "user_id", :integer
- end
+# create_table "moderatorships", :force => true do |t|
+# t.column "forum_id", :integer
+# t.column "user_id", :integer
+# end
- add_index "moderatorships", ["forum_id"], :name => "index_moderatorships_on_forum_id"
+# add_index "moderatorships", ["forum_id"], :name => "index_moderatorships_on_forum_id"
- create_table "monitorships", :force => true do |t|
- t.column "topic_id", :integer
- t.column "user_id", :integer
- t.column "active", :boolean, :default => true
- end
+# create_table "monitorships", :force => true do |t|
+# t.column "topic_id", :integer
+# t.column "user_id", :integer
+# t.column "active", :boolean, :default => true
+# end
- create_table "posts", :force => true do |t|
- t.column "user_id", :integer
- t.column "topic_id", :integer
- t.column "body", :text
- t.column "created_at", :datetime
- t.column "updated_at", :datetime
- t.column "forum_id", :integer
- t.column "body_html", :text
- end
+# create_table "posts", :force => true do |t|
+# t.column "user_id", :integer
+# t.column "topic_id", :integer
+# t.column "body", :text
+# t.column "created_at", :datetime
+# t.column "updated_at", :datetime
+# t.column "forum_id", :integer
+# t.column "body_html", :text
+# end
- add_index "posts", ["forum_id", "created_at"], :name => "index_posts_on_forum_id"
- add_index "posts", ["user_id", "created_at"], :name => "index_posts_on_user_id"
-
- create_table "topics", :force => true do |t|
- t.column "forum_id", :integer
- t.column "user_id", :integer
- t.column "title", :string
- t.column "created_at", :datetime
- t.column "updated_at", :datetime
- t.column "hits", :integer, :default => 0
- t.column "sticky", :integer, :default => 0
- t.column "posts_count", :integer, :default => 0
- t.column "replied_at", :datetime
- t.column "locked", :boolean, :default => false
- t.column "replied_by", :integer
- t.column "last_post_id", :integer
- end
+# add_index "posts", ["forum_id", "created_at"], :name => "index_posts_on_forum_id"
+# add_index "posts", ["user_id", "created_at"], :name => "index_posts_on_user_id"
+#
+# create_table "topics", :force => true do |t|
+# t.column "forum_id", :integer
+# t.column "user_id", :integer
+# t.column "title", :string
+# t.column "created_at", :datetime
+# t.column "updated_at", :datetime
+# t.column "hits", :integer, :default => 0
+# t.column "sticky", :integer, :default => 0
+# t.column "posts_count", :integer, :default => 0
+# t.column "replied_at", :datetime
+# t.column "locked", :boolean, :default => false
+# t.column "replied_by", :integer
+# t.column "last_post_id", :integer
+# end
- add_index "topics", ["forum_id"], :name => "index_topics_on_forum_id"
- add_index "topics", ["forum_id", "sticky", "replied_at"], :name => "index_topics_on_sticky_and_replied_at"
- add_index "topics", ["forum_id", "replied_at"], :name => "index_topics_on_forum_id_and_replied_at"
+# add_index "topics", ["forum_id"], :name => "index_topics_on_forum_id"
+# add_index "topics", ["forum_id", "sticky", "replied_at"], :name => "index_topics_on_sticky_and_replied_at"
+# add_index "topics", ["forum_id", "replied_at"], :name => "index_topics_on_forum_id_and_replied_at"
- add_column :users, :posts_count, :integer, :default => 0
+# add_column :users, :posts_count, :integer, :default => 0
add_column :users, :last_seen_at, :datetime
end
def self.down
- drop_table :forums
- drop_table :moderatorships
- drop_table :monitorships
- drop_table :posts
- drop_table :topics
-
- remove_column :users, :posts_count
+# drop_table :forums
+# drop_table :moderatorships
+# drop_table :monitorships
+# drop_table :posts
+# drop_table :topics
+#
+# remove_column :users, :posts_count
remove_column :users, :last_seen_at
end
end
Modified: trunk/db/migrate/022_create_downloads.rb (2716 => 2717)
--- trunk/db/migrate/022_create_downloads.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/022_create_downloads.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,19 +1,19 @@
class CreateDownloads < ActiveRecord::Migration
def self.up
- create_table :downloads do |t|
- t.column :contribution_id, :integer
- t.column :user_id, :integer
- t.column :created_at, :datetime
- end
+# create_table :downloads do |t|
+# t.column :contribution_id, :integer
+# t.column :user_id, :integer
+# t.column :created_at, :datetime
+# end
- add_column :contributions, :downloads_count, :integer, :default => 0
+# add_column :contributions, :downloads_count, :integer, :default => 0
add_column :users, :downloads_count, :integer, :default => 0
end
def self.down
- drop_table :downloads
+# drop_table :downloads
- remove_column :contributions, :downloads_count
- remove_column :users, :downloads_count
+# remove_column :contributions, :downloads_count
+# remove_column :users, :downloads_count
end
end
Modified: trunk/db/migrate/023_create_viewings.rb (2716 => 2717)
--- trunk/db/migrate/023_create_viewings.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/023_create_viewings.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -6,14 +6,14 @@
t.column :created_at, :datetime
end
- add_column :contributions, :viewings_count, :integer, :default => 0
+# add_column :contributions, :viewings_count, :integer, :default => 0
add_column :users, :viewings_count, :integer, :default => 0
end
def self.down
drop_table :viewings
- remove_column :contributions, :viewings_count
+# remove_column :contributions, :viewings_count
remove_column :users, :viewings_count
end
end
Modified: trunk/db/migrate/028_modify_policies.rb (2716 => 2717)
--- trunk/db/migrate/028_modify_policies.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/028_modify_policies.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,12 +1,12 @@
class ModifyPolicies < ActiveRecord::Migration
def self.up
- add_column :policies, :share_mode, :integer
- add_column :policies, :update_mode, :integer
+# add_column :policies, :share_mode, :integer
+# add_column :policies, :update_mode, :integer
end
def self.down
- remove_column :policies, :share_mode
- remove_column :policies, :update_mode
+# remove_column :policies, :share_mode
+# remove_column :policies, :update_mode
end
end
Modified: trunk/db/migrate/029_modify_blobs.rb (2716 => 2717)
--- trunk/db/migrate/029_modify_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/029_modify_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,12 +1,12 @@
class ModifyBlobs < ActiveRecord::Migration
def self.up
- add_column :blobs, :title, :string
- add_column :blobs, :description, :text
+# add_column :blobs, :title, :string
+# add_column :blobs, :description, :text
end
def self.down
- remove_column :blobs, :title
- remove_column :blobs, :description
+# remove_column :blobs, :title
+# remove_column :blobs, :description
end
end
Modified: trunk/db/migrate/030_add_license_to_blobs.rb (2716 => 2717)
--- trunk/db/migrate/030_add_license_to_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/030_add_license_to_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,10 +1,10 @@
class AddLicenseToBlobs < ActiveRecord::Migration
def self.up
- add_column :blobs, :license, :string, :limit => 10, :null => false, :default => "by-nd"
+# add_column :blobs, :license, :string, :limit => 10, :null => false, :default => "by-nd"
end
def self.down
- remove_column :blobs, :license
+# remove_column :blobs, :license
end
end
Modified: trunk/db/migrate/031_rename_desc_to_body.rb (2716 => 2717)
--- trunk/db/migrate/031_rename_desc_to_body.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/031_rename_desc_to_body.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,12 +1,12 @@
class RenameDescToBody < ActiveRecord::Migration
def self.up
- rename_column :blobs, :description, :body
- add_column :blobs, :body_html, :text
+# rename_column :blobs, :description, :body
+# add_column :blobs, :body_html, :text
end
def self.down
- rename_column :blobs, :body, :description
- remove_column :blobs, :body_html
+# rename_column :blobs, :body, :description
+# remove_column :blobs, :body_html
end
end
Modified: trunk/db/migrate/033_increase_blob_size.rb (2716 => 2717)
--- trunk/db/migrate/033_increase_blob_size.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/033_increase_blob_size.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,16 +1,16 @@
class IncreaseBlobSize < ActiveRecord::Migration
def self.up
- rename_column :blobs, :data, :temp
- add_column :blobs, :data, :binary, :limit => 1073741824
- execute 'UPDATE blobs SET data = ""
- remove_column :blobs, :temp
+# rename_column :blobs, :data, :temp
+# add_column :blobs, :data, :binary, :limit => 1073741824
+# execute 'UPDATE blobs SET data = ""
+# remove_column :blobs, :temp
end
def self.down
- rename_column :blobs, :data, :temp
- add_column :blobs, :data, :binary
- execute 'UPDATE blobs SET data = ""
- remove_column :blobs, :temp
+# rename_column :blobs, :data, :temp
+# add_column :blobs, :data, :binary
+# execute 'UPDATE blobs SET data = ""
+# remove_column :blobs, :temp
end
end
Modified: trunk/db/migrate/034_update_for_new_versioning.rb (2716 => 2717)
--- trunk/db/migrate/034_update_for_new_versioning.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/034_update_for_new_versioning.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,6 +1,6 @@
class UpdateForNewVersioning < ActiveRecord::Migration
def self.up
- rename_column :workflows, :version, :current_version
+# rename_column :workflows, :version, :current_version
# add_column :workflow_versions, :image, :string
# add_column :workflow_versions, :svg, :string
@@ -8,7 +8,7 @@
end
def self.down
- rename_column :workflows, :current_version, :version
+# rename_column :workflows, :current_version, :version
# remove_column :workflow_versions, :image
# remove_column :workflow_versions, :svg
Modified: trunk/db/migrate/035_increase_workflow_size.rb (2716 => 2717)
--- trunk/db/migrate/035_increase_workflow_size.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/035_increase_workflow_size.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,22 +1,22 @@
class IncreaseWorkflowSize < ActiveRecord::Migration
def self.up
- rename_column :workflows, :scufl, :temp
- add_column :workflows, :scufl, :binary, :limit => 1073741824
- execute 'UPDATE workflows SET scufl = temp'
- remove_column :workflows, :temp
+# rename_column :workflows, :scufl, :temp
+# add_column :workflows, :scufl, :binary, :limit => 1073741824
+# execute 'UPDATE workflows SET scufl = temp'
+# remove_column :workflows, :temp
- execute 'ALTER TABLE workflow_versions CHANGE COLUMN scufl scufl LONGBLOB'
+# execute 'ALTER TABLE workflow_versions CHANGE COLUMN scufl scufl LONGBLOB'
end
def self.down
- rename_column :workflows, :scufl, :temp
- add_column :workflows, :scufl, :binary
- execute 'UPDATE workflows SET scufl = temp'
- remove_column :workflows, :temp
+# rename_column :workflows, :scufl, :temp
+# add_column :workflows, :scufl, :binary
+# execute 'UPDATE workflows SET scufl = temp'
+# remove_column :workflows, :temp
- execute 'ALTER TABLE workflow_versions CHANGE COLUMN scufl scufl BLOB'
+# execute 'ALTER TABLE workflow_versions CHANGE COLUMN scufl scufl BLOB'
end
end
Modified: trunk/db/migrate/041_add_updated_at_to_forums.rb (2716 => 2717)
--- trunk/db/migrate/041_add_updated_at_to_forums.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/041_add_updated_at_to_forums.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -6,30 +6,30 @@
class AddUpdatedAtToForums < ActiveRecord::Migration
def self.up
- add_column :forums, :updated_at, :datetime
+# add_column :forums, :updated_at, :datetime
- ActiveRecord::Base.record_timestamps = false
+# ActiveRecord::Base.record_timestamps = false
- begin
- Forum.find_all.each do |forum|
- forum.updated_at = forum.contribution.updated_at
- forum.save
- end
- rescue
- end
+# begin
+# Forum.find_all.each do |forum|
+# forum.updated_at = forum.contribution.updated_at
+# forum.save
+# end
+# rescue
+# end
- Contribution.find_all.each do |c|
- if c.updated_at < c.contributable.updated_at
- c.updated_at = c.contributable.updated_at
- c.save
- end
- end
+# Contribution.find_all.each do |c|
+# if c.updated_at < c.contributable.updated_at
+# c.updated_at = c.contributable.updated_at
+# c.save
+# end
+# end
- ActiveRecord::Base.record_timestamps = true
+# ActiveRecord::Base.record_timestamps = true
end
def self.down
- remove_column :forums, :updated_at
+# remove_column :forums, :updated_at
end
end
Modified: trunk/db/migrate/046_add_type_to_workflows.rb (2716 => 2717)
--- trunk/db/migrate/046_add_type_to_workflows.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/046_add_type_to_workflows.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -2,16 +2,16 @@
class AddTypeToWorkflows < ActiveRecord::Migration
def self.up
- add_column :workflows, :content_type, :string
- add_column :workflow_versions, :content_type, :string
+# add_column :workflows, :content_type, :string
+# add_column :workflow_versions, :content_type, :string
- # Currently, all workflows are scufl workflows
- execute 'UPDATE workflows SET content_type = "application/vnd.taverna.scufl+xml"'
- execute 'UPDATE workflow_versions SET content_type = "application/vnd.taverna.scufl+xml"'
+# # Currently, all workflows are scufl workflows
+# execute 'UPDATE workflows SET content_type = "application/vnd.taverna.scufl+xml"'
+# execute 'UPDATE workflow_versions SET content_type = "application/vnd.taverna.scufl+xml"'
end
def self.down
- remove_column :workflows, :content_type
- remove_column :workflow_versions, :content_type
+# remove_column :workflows, :content_type
+# remove_column :workflow_versions, :content_type
end
end
Modified: trunk/db/migrate/049_create_packs.rb (2716 => 2717)
--- trunk/db/migrate/049_create_packs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/049_create_packs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,20 +1,20 @@
class CreatePacks < ActiveRecord::Migration
def self.up
- create_table :packs do |t|
- t.column :contributor_id, :integer
- t.column :contributor_type, :string
-
- t.column :title, :string
-
- t.column :description, :text
- t.column :description_html, :text
-
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :packs do |t|
+# t.column :contributor_id, :integer
+# t.column :contributor_type, :string
+#
+# t.column :title, :string
+#
+# t.column :description, :text
+# t.column :description_html, :text
+#
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
end
def self.down
- drop_table :packs
+# drop_table :packs
end
end
Modified: trunk/db/migrate/050_create_pack_contributable_entries.rb (2716 => 2717)
--- trunk/db/migrate/050_create_pack_contributable_entries.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/050_create_pack_contributable_entries.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,22 +1,22 @@
class CreatePackContributableEntries < ActiveRecord::Migration
def self.up
- create_table :pack_contributable_entries do |t|
- t.column :pack_id, :integer, :null => false
-
- t.column :contributable_id, :integer, :null => false
- t.column :contributable_version, :integer
- t.column :contributable_type, :string, :null => false
-
- t.column :comment, :text
-
- t.column :user_id, :integer, :null => false
-
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :pack_contributable_entries do |t|
+# t.column :pack_id, :integer, :null => false
+#
+# t.column :contributable_id, :integer, :null => false
+# t.column :contributable_version, :integer
+# t.column :contributable_type, :string, :null => false
+#
+# t.column :comment, :text
+#
+# t.column :user_id, :integer, :null => false
+#
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
end
def self.down
- drop_table :pack_contributable_entries
+# drop_table :pack_contributable_entries
end
end
Modified: trunk/db/migrate/051_create_pack_remote_entries.rb (2716 => 2717)
--- trunk/db/migrate/051_create_pack_remote_entries.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/051_create_pack_remote_entries.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,23 +1,23 @@
class CreatePackRemoteEntries < ActiveRecord::Migration
def self.up
- create_table :pack_remote_entries do |t|
- t.column :pack_id, :integer, :null => false
-
- t.column :title, :string, :null => false
-
- t.column :uri, :string, :null => false
- t.column :alternate_uri, :string
-
- t.column :comment, :text
-
- t.column :user_id, :integer, :null => false
-
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :pack_remote_entries do |t|
+# t.column :pack_id, :integer, :null => false
+#
+# t.column :title, :string, :null => false
+#
+# t.column :uri, :string, :null => false
+# t.column :alternate_uri, :string
+#
+# t.column :comment, :text
+#
+# t.column :user_id, :integer, :null => false
+#
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
end
def self.down
- drop_table :pack_remote_entries
+# drop_table :pack_remote_entries
end
end
Modified: trunk/db/migrate/053_modify_blobs_for_content_blobs.rb (2716 => 2717)
--- trunk/db/migrate/053_modify_blobs_for_content_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/053_modify_blobs_for_content_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,9 +1,9 @@
class ModifyBlobsForContentBlobs < ActiveRecord::Migration
def self.up
- add_column :blobs, :content_blob_id, :integer
+# add_column :blobs, :content_blob_id, :integer
end
def self.down
- remove_column :blobs, :content_blob_id
+# remove_column :blobs, :content_blob_id
end
end
Modified: trunk/db/migrate/054_move_blob_data_to_content_blobs.rb (2716 => 2717)
--- trunk/db/migrate/054_move_blob_data_to_content_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/054_move_blob_data_to_content_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,17 +1,17 @@
class MoveBlobDataToContentBlobs < ActiveRecord::Migration
def self.up
- Blob.find(:all).each do |b|
- b.content_blob = ContentBlob.new(:data ="" b.data)
- b.save
- end
+# Blob.find(:all).each do |b|
+# b.content_blob = ContentBlob.new(:data ="" b.data)
+# b.save
+# end
- remove_column :blobs, :data
+# remove_column :blobs, :data
end
def self.down
- add_column :blobs, :data, :binary, :limit => 1073741824
+# add_column :blobs, :data, :binary, :limit => 1073741824
- execute 'UPDATE blobs,content_blobs SET blobs.data = "" WHERE blobs.content_blob_id = content_blobs.id'
+# execute 'UPDATE blobs,content_blobs SET blobs.data = "" WHERE blobs.content_blob_id = content_blobs.id'
end
end
Modified: trunk/db/migrate/055_modify_workflows_and_workflow_versions_for_content_blobs.rb (2716 => 2717)
--- trunk/db/migrate/055_modify_workflows_and_workflow_versions_for_content_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/055_modify_workflows_and_workflow_versions_for_content_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,11 +1,11 @@
class ModifyWorkflowsAndWorkflowVersionsForContentBlobs < ActiveRecord::Migration
def self.up
- add_column :workflows, :content_blob_id, :integer
- add_column :workflow_versions, :content_blob_id, :integer
+# add_column :workflows, :content_blob_id, :integer
+# add_column :workflow_versions, :content_blob_id, :integer
end
def self.down
- remove_column :workflows, :content_blob_id
- remove_column :workflow_versions, :content_blob_id
+# remove_column :workflows, :content_blob_id
+# remove_column :workflow_versions, :content_blob_id
end
end
Modified: trunk/db/migrate/056_move_scufl_data_to_content_blobs.rb (2716 => 2717)
--- trunk/db/migrate/056_move_scufl_data_to_content_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/056_move_scufl_data_to_content_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,41 +1,41 @@
class MoveScuflDataToContentBlobs < ActiveRecord::Migration
def self.up
- ActiveRecord::Base.record_timestamps = false
+# ActiveRecord::Base.record_timestamps = false
- Workflow.find(:all).each do |w|
+# Workflow.find(:all).each do |w|
- w.versions.each do |wv|
- wv.content_blob = ContentBlob.new(:data ="" wv.scufl)
- wv.save
- end
+# w.versions.each do |wv|
+# wv.content_blob = ContentBlob.new(:data ="" wv.scufl)
+# wv.save
+# end
- current = w.find_version(w.current_version)
- w.content_blob = current.content_blob
+# current = w.find_version(w.current_version)
+# w.content_blob = current.content_blob
- w.save
- end
+# w.save
+# end
- remove_column :workflows, :scufl
- remove_column :workflow_versions, :scufl
+# remove_column :workflows, :scufl
+# remove_column :workflow_versions, :scufl
- ActiveRecord::Base.record_timestamps = true
+# ActiveRecord::Base.record_timestamps = true
end
def self.down
- ActiveRecord::Base.record_timestamps = false
+# ActiveRecord::Base.record_timestamps = false
- add_column :workflows, :scufl, :binary, :limit => 1073741824
- add_column :workflow_versions, :scufl, :binary, :limit => 1073741824
+# add_column :workflows, :scufl, :binary, :limit => 1073741824
+# add_column :workflow_versions, :scufl, :binary, :limit => 1073741824
- execute 'UPDATE workflows,content_blobs SET workflows.scufl = content_blobs.data WHERE workflows.content_blob_id = content_blobs.id'
- execute 'UPDATE workflow_versions,content_blobs SET workflow_versions.scufl = content_blobs.data WHERE workflow_versions.content_blob_id = content_blobs.id'
+# execute 'UPDATE workflows,content_blobs SET workflows.scufl = content_blobs.data WHERE workflows.content_blob_id = content_blobs.id'
+# execute 'UPDATE workflow_versions,content_blobs SET workflow_versions.scufl = content_blobs.data WHERE workflow_versions.content_blob_id = content_blobs.id'
- Workflow.find(:all).each do |w|
- w.versions.each do |wv|
- wv.content_blob.destroy
- end
- end
+# Workflow.find(:all).each do |w|
+# w.versions.each do |wv|
+# wv.content_blob.destroy
+# end
+# end
- ActiveRecord::Base.record_timestamps = true
+# ActiveRecord::Base.record_timestamps = true
end
end
Modified: trunk/db/migrate/066_add_file_ext_to_workflow.rb (2716 => 2717)
--- trunk/db/migrate/066_add_file_ext_to_workflow.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/066_add_file_ext_to_workflow.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,15 +1,15 @@
class AddFileExtToWorkflow < ActiveRecord::Migration
def self.up
- add_column :workflows, :file_ext, :string
- add_column :workflow_versions, :file_ext, :string
+# add_column :workflows, :file_ext, :string
+# add_column :workflow_versions, :file_ext, :string
# Currently, we assume that all workflows are scufl workflows!
- execute 'UPDATE workflows SET file_ext = "xml"'
- execute 'UPDATE workflow_versions SET file_ext = "xml"'
+# execute 'UPDATE workflows SET file_ext = "xml"'
+# execute 'UPDATE workflow_versions SET file_ext = "xml"'
end
def self.down
- remove_column :workflows, :file_ext
- remove_column :workflow_versions, :file_ext
+# remove_column :workflows, :file_ext
+# remove_column :workflow_versions, :file_ext
end
end
Modified: trunk/db/migrate/067_add_last_edited_by_to_workflows.rb (2716 => 2717)
--- trunk/db/migrate/067_add_last_edited_by_to_workflows.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/067_add_last_edited_by_to_workflows.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,14 +1,14 @@
class AddLastEditedByToWorkflows < ActiveRecord::Migration
def self.up
- add_column :workflows, :last_edited_by, :string
- add_column :workflow_versions, :last_edited_by, :string
+# add_column :workflows, :last_edited_by, :string
+# add_column :workflow_versions, :last_edited_by, :string
- execute 'UPDATE workflows SET last_edited_by=contributor_id'
- execute 'UPDATE workflow_versions SET last_edited_by=contributor_id'
+# execute 'UPDATE workflows SET last_edited_by=contributor_id'
+# execute 'UPDATE workflow_versions SET last_edited_by=contributor_id'
end
def self.down
- remove_column :workflows, :last_edited_by
- remove_column :workflow_versions, :last_edited_by
+# remove_column :workflows, :last_edited_by
+# remove_column :workflow_versions, :last_edited_by
end
end
Modified: trunk/db/migrate/068_remove_savage_beast.rb (2716 => 2717)
--- trunk/db/migrate/068_remove_savage_beast.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/068_remove_savage_beast.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -7,78 +7,78 @@
def self.up
- Contribution.find(:all).select do |c| c.contributable_type == 'Forum' end.each do |c|
- c.destroy
- end
+# Contribution.find(:all).select do |c| c.contributable_type == 'Forum' end.each do |c|
+# c.destroy
+# end
- drop_table :forums
- drop_table :moderatorships
- drop_table :monitorships
- drop_table :posts
- drop_table :topics
-
- remove_column :users, :posts_count
+# drop_table :forums
+# drop_table :moderatorships
+# drop_table :monitorships
+# drop_table :posts
+# drop_table :topics
+#
+# remove_column :users, :posts_count
end
def self.down
- create_table "forums", :force => true do |t|
- t.column "name", :string
- t.column "contributor_id", :integer
- t.column "contributor_type", :string
- t.column "description", :string
- t.column "topics_count", :integer, :default => 0
- t.column "posts_count", :integer, :default => 0
- t.column "position", :integer
- t.column "description_html", :text
- end
+# create_table "forums", :force => true do |t|
+# t.column "name", :string
+# t.column "contributor_id", :integer
+# t.column "contributor_type", :string
+# t.column "description", :string
+# t.column "topics_count", :integer, :default => 0
+# t.column "posts_count", :integer, :default => 0
+# t.column "position", :integer
+# t.column "description_html", :text
+# end
- create_table "moderatorships", :force => true do |t|
- t.column "forum_id", :integer
- t.column "user_id", :integer
- end
+# create_table "moderatorships", :force => true do |t|
+# t.column "forum_id", :integer
+# t.column "user_id", :integer
+# end
- add_index "moderatorships", ["forum_id"], :name => "index_moderatorships_on_forum_id"
+# add_index "moderatorships", ["forum_id"], :name => "index_moderatorships_on_forum_id"
- create_table "monitorships", :force => true do |t|
- t.column "topic_id", :integer
- t.column "user_id", :integer
- t.column "active", :boolean, :default => true
- end
+# create_table "monitorships", :force => true do |t|
+# t.column "topic_id", :integer
+# t.column "user_id", :integer
+# t.column "active", :boolean, :default => true
+# end
- create_table "posts", :force => true do |t|
- t.column "user_id", :integer
- t.column "topic_id", :integer
- t.column "body", :text
- t.column "created_at", :datetime
- t.column "updated_at", :datetime
- t.column "forum_id", :integer
- t.column "body_html", :text
- end
+# create_table "posts", :force => true do |t|
+# t.column "user_id", :integer
+# t.column "topic_id", :integer
+# t.column "body", :text
+# t.column "created_at", :datetime
+# t.column "updated_at", :datetime
+# t.column "forum_id", :integer
+# t.column "body_html", :text
+# end
- add_index "posts", ["forum_id", "created_at"], :name => "index_posts_on_forum_id"
- add_index "posts", ["user_id", "created_at"], :name => "index_posts_on_user_id"
-
- create_table "topics", :force => true do |t|
- t.column "forum_id", :integer
- t.column "user_id", :integer
- t.column "title", :string
- t.column "created_at", :datetime
- t.column "updated_at", :datetime
- t.column "hits", :integer, :default => 0
- t.column "sticky", :integer, :default => 0
- t.column "posts_count", :integer, :default => 0
- t.column "replied_at", :datetime
- t.column "locked", :boolean, :default => false
- t.column "replied_by", :integer
- t.column "last_post_id", :integer
- end
+# add_index "posts", ["forum_id", "created_at"], :name => "index_posts_on_forum_id"
+# add_index "posts", ["user_id", "created_at"], :name => "index_posts_on_user_id"
+#
+# create_table "topics", :force => true do |t|
+# t.column "forum_id", :integer
+# t.column "user_id", :integer
+# t.column "title", :string
+# t.column "created_at", :datetime
+# t.column "updated_at", :datetime
+# t.column "hits", :integer, :default => 0
+# t.column "sticky", :integer, :default => 0
+# t.column "posts_count", :integer, :default => 0
+# t.column "replied_at", :datetime
+# t.column "locked", :boolean, :default => false
+# t.column "replied_by", :integer
+# t.column "last_post_id", :integer
+# end
- add_index "topics", ["forum_id"], :name => "index_topics_on_forum_id"
- add_index "topics", ["forum_id", "sticky", "replied_at"], :name => "index_topics_on_sticky_and_replied_at"
- add_index "topics", ["forum_id", "replied_at"], :name => "index_topics_on_forum_id_and_replied_at"
+# add_index "topics", ["forum_id"], :name => "index_topics_on_forum_id"
+# add_index "topics", ["forum_id", "sticky", "replied_at"], :name => "index_topics_on_sticky_and_replied_at"
+# add_index "topics", ["forum_id", "replied_at"], :name => "index_topics_on_forum_id_and_replied_at"
- add_column :users, :posts_count, :integer, :default => 0
+# add_column :users, :posts_count, :integer, :default => 0
end
end
Modified: trunk/db/migrate/069_add_user_agent_to_viewings_and_downloads.rb (2716 => 2717)
--- trunk/db/migrate/069_add_user_agent_to_viewings_and_downloads.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/069_add_user_agent_to_viewings_and_downloads.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -8,11 +8,11 @@
def self.up
add_column :viewings, :user_agent, :string, :default => nil
- add_column :downloads, :user_agent, :string, :default => nil
+# add_column :downloads, :user_agent, :string, :default => nil
end
def self.down
remove_column :viewings, :user_agent
- remove_column :downloads, :user_agent
+# remove_column :downloads, :user_agent
end
end
Modified: trunk/db/migrate/070_add_accessed_from_site_to_viewings_and_downloads.rb (2716 => 2717)
--- trunk/db/migrate/070_add_accessed_from_site_to_viewings_and_downloads.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/070_add_accessed_from_site_to_viewings_and_downloads.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -7,11 +7,11 @@
def self.up
add_column :viewings, :accessed_from_site, :boolean, :default => false
- add_column :downloads, :accessed_from_site, :boolean, :default => false
+# add_column :downloads, :accessed_from_site, :boolean, :default => false
end
def self.down
remove_column :viewings, :accessed_from_site
- remove_column :downloads, :accessed_from_site
+# remove_column :downloads, :accessed_from_site
end
end
Modified: trunk/db/migrate/072_remove_public_protected_flags.rb (2716 => 2717)
--- trunk/db/migrate/072_remove_public_protected_flags.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/072_remove_public_protected_flags.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,19 +1,19 @@
class RemovePublicProtectedFlags < ActiveRecord::Migration
def self.up
- remove_column :policies, :download_public
- remove_column :policies, :edit_public
- remove_column :policies, :view_public
- remove_column :policies, :download_protected
- remove_column :policies, :edit_protected
- remove_column :policies, :view_protected
+# remove_column :policies, :download_public
+# remove_column :policies, :edit_public
+# remove_column :policies, :view_public
+# remove_column :policies, :download_protected
+# remove_column :policies, :edit_protected
+# remove_column :policies, :view_protected
end
def self.down
- add_column :policies, :download_public, :boolean, :default => true
- add_column :policies, :edit_public, :boolean, :default => false
- add_column :policies, :view_public, :boolean, :default => true
- add_column :policies, :download_protected, :boolean, :default => false
- add_column :policies, :edit_protected, :boolean, :default => false
- add_column :policies, :view_protected, :boolean, :default => false
+# add_column :policies, :download_public, :boolean, :default => true
+# add_column :policies, :edit_public, :boolean, :default => false
+# add_column :policies, :view_public, :boolean, :default => true
+# add_column :policies, :download_protected, :boolean, :default => false
+# add_column :policies, :edit_protected, :boolean, :default => false
+# add_column :policies, :view_protected, :boolean, :default => false
end
end
Modified: trunk/db/migrate/076_create_content_types.rb (2716 => 2717)
--- trunk/db/migrate/076_create_content_types.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/076_create_content_types.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,111 +5,111 @@
class CreateContentTypes < ActiveRecord::Migration
def self.up
- create_table :content_types do |t|
- t.column :user_id, :integer
- t.column :title, :string
- t.column :description, :text
- t.column :description_html, :text
- t.column :mime_type, :string
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :content_types do |t|
+# t.column :user_id, :integer
+# t.column :title, :string
+# t.column :description, :text
+# t.column :description_html, :text
+# t.column :mime_type, :string
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
- add_column :workflows, :content_type_id, :integer
- add_column :workflow_versions, :content_type_id, :integer
- add_column :blobs, :content_type_id, :integer
+# add_column :workflows, :content_type_id, :integer
+# add_column :workflow_versions, :content_type_id, :integer
+# add_column :blobs, :content_type_id, :integer
# Create ContentType records for workflows with processors
- u = User.find_by_username(Conf.admins.first)
- if (u.blank?)
- uid = 1
- else
- uid = u.id
- end
+# u = User.find_by_username(Conf.admins.first)
+# if (u.blank?)
+# uid = 1
+# else
+# uid = u.id
+# end
- taverna_1 = ContentType.create(:title => 'Taverna 1', :mime_type => 'application/vnd.taverna.scufl+xml', :user_id => uid)
- taverna_2 = ContentType.create(:title => 'Taverna 2 beta', :mime_type => 'application/vnd.taverna.t2flow+xml', :user_id => uid)
- trident_x = ContentType.create(:title => 'Trident (XOML)', :mime_type => 'application/xaml+xml', :user_id => uid)
- trident_p = ContentType.create(:title => 'Trident (Package)', :mime_type => 'application/octet-stream', :user_id => uid)
+# taverna_1 = ContentType.create(:title => 'Taverna 1', :mime_type => 'application/vnd.taverna.scufl+xml', :user_id => uid)
+# taverna_2 = ContentType.create(:title => 'Taverna 2 beta', :mime_type => 'application/vnd.taverna.t2flow+xml', :user_id => uid)
+# trident_x = ContentType.create(:title => 'Trident (XOML)', :mime_type => 'application/xaml+xml', :user_id => uid)
+# trident_p = ContentType.create(:title => 'Trident (Package)', :mime_type => 'application/octet-stream', :user_id => uid)
- # Create ContentType entries for the existing workflows
+# # Create ContentType entries for the existing workflows
- workflow_type_to_content_type_id = {}
+# workflow_type_to_content_type_id = {}
- Workflow.find(:all).map do |w|
- w.attributes["content_type"] end.uniq.each do |entry|
+# Workflow.find(:all).map do |w|
+# w.attributes["content_type"] end.uniq.each do |entry|
- mime_type = 'application/octet-stream'
+# mime_type = 'application/octet-stream'
- if entry == 'application/vnd.taverna.scufl+xml'
- workflow_type_to_content_type_id[entry] = taverna_1.id
- next
- end
+# if entry == 'application/vnd.taverna.scufl+xml'
+# workflow_type_to_content_type_id[entry] = taverna_1.id
+# next
+# end
- if entry == 'taverna2beta'
- workflow_type_to_content_type_id[entry] = taverna_2.id
- next
- end
+# if entry == 'taverna2beta'
+# workflow_type_to_content_type_id[entry] = taverna_2.id
+# next
+# end
- if entry == 'application/xaml+xml'
- workflow_type_to_content_type_id[entry] = trident_x.id
- next
- end
+# if entry == 'application/xaml+xml'
+# workflow_type_to_content_type_id[entry] = trident_x.id
+# next
+# end
- if entry == 'trident_opc'
- workflow_type_to_content_type_id[entry] = trident_p.id
- next
- end
+# if entry == 'trident_opc'
+# workflow_type_to_content_type_id[entry] = trident_p.id
+# next
+# end
- ft = ContentType.create(:user_id => uid, :title => entry, :mime_type => 'application/octet-stream')
+# ft = ContentType.create(:user_id => uid, :title => entry, :mime_type => 'application/octet-stream')
- workflow_type_to_content_type_id[entry] = ft.id
- end
+# workflow_type_to_content_type_id[entry] = ft.id
+# end
- # Create ContentType entries for the existing blobs
+# # Create ContentType entries for the existing blobs
- blob_type_to_content_type_id = {}
+# blob_type_to_content_type_id = {}
- Blob.find(:all).map do |b|
- b.attributes["content_type"].strip end.uniq.each do |entry|
- if !blob_type_to_content_type_id[entry]
- ft = ContentType.create(:user_id => uid, :mime_type => entry, :title => entry)
+# Blob.find(:all).map do |b|
+# b.attributes["content_type"].strip end.uniq.each do |entry|
+# if !blob_type_to_content_type_id[entry]
+# ft = ContentType.create(:user_id => uid, :mime_type => entry, :title => entry)
- blob_type_to_content_type_id[entry] = ft.id
- end
- end
+# blob_type_to_content_type_id[entry] = ft.id
+# end
+# end
- # Set the content_type_id for the existing workflows and blobs
+# # Set the content_type_id for the existing workflows and blobs
- Workflow.find(:all).each do |w|
- execute("UPDATE workflows SET content_type_id = #{workflow_type_to_content_type_id[w.attributes["content_type"]]} WHERE id = #{w.id}")
+# Workflow.find(:all).each do |w|
+# execute("UPDATE workflows SET content_type_id = #{workflow_type_to_content_type_id[w.attributes["content_type"]]} WHERE id = #{w.id}")
- w.versions.each do |v|
- execute("UPDATE workflow_versions SET content_type_id = #{workflow_type_to_content_type_id[v.attributes["content_type"]]} WHERE id = #{v.id}")
- end
- end
+# w.versions.each do |v|
+# execute("UPDATE workflow_versions SET content_type_id = #{workflow_type_to_content_type_id[v.attributes["content_type"]]} WHERE id = #{v.id}")
+# end
+# end
- Blob.find(:all).each do |b|
- execute("UPDATE blobs SET content_type_id = #{blob_type_to_content_type_id[b.attributes["content_type"].strip]} WHERE id = #{b.id}")
- end
+# Blob.find(:all).each do |b|
+# execute("UPDATE blobs SET content_type_id = #{blob_type_to_content_type_id[b.attributes["content_type"].strip]} WHERE id = #{b.id}")
+# end
- remove_column :workflows, :content_type
- remove_column :workflow_versions, :content_type
- remove_column :blobs, :content_type
+# remove_column :workflows, :content_type
+# remove_column :workflow_versions, :content_type
+# remove_column :blobs, :content_type
end
def self.down
- add_column :workflows, :content_type, :string
- add_column :workflow_versions, :content_type, :string
- add_column :blobs, :content_type, :string
+# add_column :workflows, :content_type, :string
+# add_column :workflow_versions, :content_type, :string
+# add_column :blobs, :content_type, :string
- remove_column :workflows, :content_type_id
- remove_column :workflow_versions, :content_type_id
- remove_column :blobs, :content_type_id
+# remove_column :workflows, :content_type_id
+# remove_column :workflow_versions, :content_type_id
+# remove_column :blobs, :content_type_id
- drop_table :content_types
+# drop_table :content_types
end
end
Modified: trunk/db/migrate/080_add_license_id_to_workflows_and_blobs.rb (2716 => 2717)
--- trunk/db/migrate/080_add_license_id_to_workflows_and_blobs.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/080_add_license_id_to_workflows_and_blobs.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,37 +1,37 @@
class AddLicenseIdToWorkflowsAndBlobs < ActiveRecord::Migration
def self.up
#Need to rename columns so that license method and license field do not get confused
- rename_column :workflows, :license, :license_name
- rename_column :blobs, :license, :license_name
+# rename_column :workflows, :license, :license_name
+# rename_column :blobs, :license, :license_name
+#
+# add_column :workflows, :license_id, :integer, :default => nil
+# add_column :blobs, :license_id, :integer, :default => nil
- add_column :workflows, :license_id, :integer, :default => nil
- add_column :blobs, :license_id, :integer, :default => nil
-
- Workflow.find(:all).each do |w|
- execute("UPDATE workflows SET license_id = #{License.find(:first,:conditions=>[ 'unique_name = ?', w.license_name ]).id } WHERE id = #{w.id}")
- end
- Blob.find(:all).each do |b|
- execute("UPDATE blobs SET license_id = #{License.find(:first,:conditions=>[ 'unique_name = ?', b.license_name ]).id } WHERE id = #{b.id}")
- end
- remove_column :workflows, :license_name
- remove_column :blobs, :license_name
+# Workflow.find(:all).each do |w|
+# execute("UPDATE workflows SET license_id = #{License.find(:first,:conditions=>[ 'unique_name = ?', w.license_name ]).id } WHERE id = #{w.id}")
+# end
+# Blob.find(:all).each do |b|
+# execute("UPDATE blobs SET license_id = #{License.find(:first,:conditions=>[ 'unique_name = ?', b.license_name ]).id } WHERE id = #{b.id}")
+# end
+# remove_column :workflows, :license_name
+# remove_column :blobs, :license_name
end
def self.down
- add_column :workflows, :license, :string,
- :limit => 10, :null => false,
- :default => "by-sa"
-
- add_column :blobs, :license, :string,
- :limit => 10, :null => false,
- :default => "by-sa"
- Workflow.find(:all).each do |w|
- execute("UPDATE workflows SET license = '#{License.find(w.license_id).unique_name }' WHERE id = #{w.id}")
- end
- Blob.find(:all).each do |b|
- execute("UPDATE blobs SET license = '#{License.find(b.license_id).unique_name }' WHERE id = #{b.id}")
- end
- remove_column :workflows, :license_id
- remove_column :blobs, :license_id
+# add_column :workflows, :license, :string,
+# :limit => 10, :null => false,
+# :default => "by-sa"
+#
+# add_column :blobs, :license, :string,
+# :limit => 10, :null => false,
+# :default => "by-sa"
+# Workflow.find(:all).each do |w|
+# execute("UPDATE workflows SET license = '#{License.find(w.license_id).unique_name }' WHERE id = #{w.id}")
+# end
+# Blob.find(:all).each do |b|
+# execute("UPDATE blobs SET license = '#{License.find(b.license_id).unique_name }' WHERE id = #{b.id}")
+# end
+# remove_column :workflows, :license_id
+# remove_column :blobs, :license_id
end
-end
\ No newline at end of file
+end
Modified: trunk/db/migrate/081_add_controlled_vocab.rb (2716 => 2717)
--- trunk/db/migrate/081_add_controlled_vocab.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/081_add_controlled_vocab.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -5,14 +5,14 @@
class AddControlledVocab < ActiveRecord::Migration
def self.up
- create_table :vocabularies do |t|
- t.column :user_id, :integer
- t.column :title, :string
- t.column :description, :text
- t.column :description_html, :text
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- end
+# create_table :vocabularies do |t|
+# t.column :user_id, :integer
+# t.column :title, :string
+# t.column :description, :text
+# t.column :description_html, :text
+# t.column :created_at, :datetime
+# t.column :updated_at, :datetime
+# end
add_column :tags, :vocabulary_id, :integer
add_column :tags, :description, :text
@@ -22,7 +22,7 @@
end
def self.down
- drop_table :vocabularies
+# drop_table :vocabularies
remove_column :tags, :vocabulary_id
remove_column :tags, :description
Modified: trunk/db/migrate/086_rename_indexes_to_automatic_names.rb (2716 => 2717)
--- trunk/db/migrate/086_rename_indexes_to_automatic_names.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/086_rename_indexes_to_automatic_names.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -21,8 +21,8 @@
add_index "bookmarks", ["user_id"]
add_index "comments", ["user_id"]
- add_index "contributions", ["contributable_id", "contributable_type"]
- add_index "contributions", ["contributor_id", "contributor_type"]
+# add_index "contributions", ["contributable_id", "contributable_type"]
+# add_index "contributions", ["contributor_id", "contributor_type"]
add_index "friendships", ["friend_id"]
add_index "friendships", ["user_id"]
add_index "memberships", ["network_id"]
@@ -31,7 +31,7 @@
add_index "permissions", ["policy_id"]
add_index "ratings", ["user_id"]
add_index "reviews", ["user_id"]
- add_index "workflow_versions", ["workflow_id"]
+# add_index "workflow_versions", ["workflow_id"]
end
def self.down
Modified: trunk/db/migrate/087_add_indexes_to_viewings_downloads.rb (2716 => 2717)
--- trunk/db/migrate/087_add_indexes_to_viewings_downloads.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/087_add_indexes_to_viewings_downloads.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -2,14 +2,14 @@
def self.up
add_index :viewings, ["contribution_id"]
- add_index :downloads, ["contribution_id"]
+# add_index :downloads, ["contribution_id"]
end
def self.down
remove_index :viewings, ["contribution_id"]
- remove_index :downloads, ["contribution_id"]
+# remove_index :downloads, ["contribution_id"]
end
end
Modified: trunk/db/migrate/089_remove_network_relationships.rb (2716 => 2717)
--- trunk/db/migrate/089_remove_network_relationships.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/db/migrate/089_remove_network_relationships.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -1,15 +1,15 @@
class RemoveNetworkRelationships < ActiveRecord::Migration
def self.up
- drop_table :relationships
+# drop_table :relationships
end
def self.down
- create_table "relationships", :force => true do |t|
- t.column "network_id", :integer
- t.column "relation_id", :integer
- t.column "created_at", :datetime
- t.column "accepted_at", :datetime
- end
+# create_table "relationships", :force => true do |t|
+# t.column "network_id", :integer
+# t.column "relation_id", :integer
+# t.column "created_at", :datetime
+# t.column "accepted_at", :datetime
+# end
end
end
Modified: trunk/vendor/plugins/structured_data/lib/auto_migrate.rb (2716 => 2717)
--- trunk/vendor/plugins/structured_data/lib/auto_migrate.rb 2011-10-06 06:11:29 UTC (rev 2716)
+++ trunk/vendor/plugins/structured_data/lib/auto_migrate.rb 2011-10-11 10:18:22 UTC (rev 2717)
@@ -10,7 +10,7 @@
AUTO_TABLE_NAME = "auto_tables"
SCHEMA = "config/base_schema.xml"
SCHEMA_D = "config/schema.d"
- COLUMN_ATTRIBUTES = ['name', 'type', 'default', 'limit']
+ COLUMN_ATTRIBUTES = ['name', 'type', 'default', 'limit', 'null']
BELONGS_TO_ATTRIBUTES = ['polymorphic', 'class_name', 'foreign_key']
HAS_MANY_ATTRIBUTES = ['target', 'through', 'foreign_key', 'source', 'dependent', 'conditions', 'class_name', 'as']
@@ -55,6 +55,14 @@
end
end
+ def self.parse_null(column)
+ case column['null']
+ when 'false'; false
+ when 'true'; true
+ when nil; true
+ end
+ end
+
conn = ActiveRecord::Base.connection
# ensure that the auto_tables table exists
@@ -117,25 +125,41 @@
# add columns
(new_columns - old_columns).each do |column_name|
- default = column_default(new_tables[table_name][:columns][column_name])
- conn.add_column(table_name, column_name, new_tables[table_name][:columns][column_name]["type"].to_sym, :default => default, :limit => new_tables[table_name][:columns][column_name]['limit'])
+
+ column = new_tables[table_name][:columns][column_name]
+
+ default = column_default(column)
+ null = parse_null(column)
+ conn.add_column(table_name, column_name, column["type"].to_sym, :default => default, :limit => column['limit'],
+ :null => null)
end
# modify existing columns
(old_columns & new_columns).each do |column_name|
+ column = new_tables[table_name][:columns][column_name]
+
old_default = old_column_info[column_name].default
- new_default = column_default(new_tables[table_name][:columns][column_name])
+ new_default = column_default(column)
old_default = old_default.to_s unless old_default.nil?
new_default = new_default.to_s unless new_default.nil?
old_type = old_column_info[column_name].type
- new_type = new_tables[table_name][:columns][column_name]['type'].to_sym
+ new_type = column['type'].to_sym
- if (old_default != new_default) || (old_type != new_type)
- conn.change_column(table_name.to_sym, column_name.to_sym, new_type, :default => new_default)
+ old_null = old_column_info[column_name].null
+ new_null = parse_null(column)
+
+ if (old_default != new_default) || (old_type != new_type) || (old_null != new_null)
+
+ if column['type'] == 'boolean'
+ new_default = 0 if new_default == "false"
+ new_default = 1 if new_default == "true"
+ end
+
+ conn.change_column(table_name.to_sym, column_name.to_sym, new_type, :default => new_default, :null => new_null)
end
end