From 9a139d204c2174e73ab0d9fb1162b95181585a2d Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 31 Jul 2007 13:18:12 +0000 Subject: [PATCH] r266@sede: terceiro | 2007-07-29 23:39:51 -0300 reordering migrations --- db/migrate/001_add_design_support.rb | 28 ++++++++++++++++++++++++++++ db/migrate/001_create_virtual_communities.rb | 15 --------------- db/migrate/002_create_virtual_communities.rb | 15 +++++++++++++++ db/migrate/003_create_domains.rb | 13 ------------- db/migrate/003_create_profiles.rb | 32 ++++++++++++++++++++++++++++++++ db/migrate/004_acts_as_taggable_migration.rb | 28 ---------------------------- db/migrate/004_create_domains.rb | 13 +++++++++++++ db/migrate/005_acts_as_taggable_migration.rb | 28 ++++++++++++++++++++++++++++ db/migrate/005_add_design_support.rb | 28 ---------------------------- 9 files changed, 116 insertions(+), 84 deletions(-) create mode 100644 db/migrate/001_add_design_support.rb delete mode 100644 db/migrate/001_create_virtual_communities.rb create mode 100644 db/migrate/002_create_virtual_communities.rb delete mode 100644 db/migrate/003_create_domains.rb create mode 100644 db/migrate/003_create_profiles.rb delete mode 100644 db/migrate/004_acts_as_taggable_migration.rb create mode 100644 db/migrate/004_create_domains.rb create mode 100644 db/migrate/005_acts_as_taggable_migration.rb delete mode 100644 db/migrate/005_add_design_support.rb diff --git a/db/migrate/001_add_design_support.rb b/db/migrate/001_add_design_support.rb new file mode 100644 index 0000000..5cb45dc --- /dev/null +++ b/db/migrate/001_add_design_support.rb @@ -0,0 +1,28 @@ +class AddDesignSupport < ActiveRecord::Migration + def self.up + + create_table :design_boxes do |t| + t.column :name, :string + t.column :title, :string + t.column :number, :integer + t.column :owner_type, :string + t.column :owner_id, :integer + end + + create_table :design_blocks do |t| + t.column :name, :string + t.column :title, :string + t.column :box_id, :integer + t.column :position, :integer + t.column :type, :string + t.column :helper, :string + end + + end + + def self.down + drop_table :design_boxes + drop_table :design_blocks + end + +end diff --git a/db/migrate/001_create_virtual_communities.rb b/db/migrate/001_create_virtual_communities.rb deleted file mode 100644 index f93c8ad..0000000 --- a/db/migrate/001_create_virtual_communities.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateVirtualCommunities < ActiveRecord::Migration - def self.up - create_table :virtual_communities do |t| - t.column :name, :string - t.column :is_default, :boolean - t.column :settings, :text - t.column :design_data, :text - end - VirtualCommunity.create(:name => 'Default Virtual Community', :is_default => true) - end - - def self.down - drop_table :virtual_communities - end -end diff --git a/db/migrate/002_create_virtual_communities.rb b/db/migrate/002_create_virtual_communities.rb new file mode 100644 index 0000000..f93c8ad --- /dev/null +++ b/db/migrate/002_create_virtual_communities.rb @@ -0,0 +1,15 @@ +class CreateVirtualCommunities < ActiveRecord::Migration + def self.up + create_table :virtual_communities do |t| + t.column :name, :string + t.column :is_default, :boolean + t.column :settings, :text + t.column :design_data, :text + end + VirtualCommunity.create(:name => 'Default Virtual Community', :is_default => true) + end + + def self.down + drop_table :virtual_communities + end +end diff --git a/db/migrate/003_create_domains.rb b/db/migrate/003_create_domains.rb deleted file mode 100644 index 233ccb1..0000000 --- a/db/migrate/003_create_domains.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateDomains < ActiveRecord::Migration - def self.up - create_table :domains do |t| - t.column :name, :string - t.column :owner_type, :string - t.column :owner_id, :integer - end - end - - def self.down - drop_table :domains - end -end diff --git a/db/migrate/003_create_profiles.rb b/db/migrate/003_create_profiles.rb new file mode 100644 index 0000000..d9ba365 --- /dev/null +++ b/db/migrate/003_create_profiles.rb @@ -0,0 +1,32 @@ +class CreateProfiles < ActiveRecord::Migration + def self.up + create_table :profiles do |t| + t.column :name, :string + t.column :type, :string + t.column :identifier, :string + t.column :virtual_community_id, :integer + t.column :flexible_template_template, :string, :default => "default" + t.column :flexible_template_theme, :string, :default => "default" + t.column :flexible_template_icon_theme, :string, :default => "default" + t.column :active, :boolean, :default => "false" + + #person fields + t.column :user_id, :integer + + #enterprise fields + t.column :address, :string + t.column :contact_phone, :string + t.column :contact_person, :string + t.column :acronym, :string + t.column :foundation_year, :integer, :limit => 4 + t.column :legal_form, :string + t.column :economic_activity, :string + t.column :management_information, :string + + end + end + + def self.down + drop_table :profiles + end +end diff --git a/db/migrate/004_acts_as_taggable_migration.rb b/db/migrate/004_acts_as_taggable_migration.rb deleted file mode 100644 index 85d4a5d..0000000 --- a/db/migrate/004_acts_as_taggable_migration.rb +++ /dev/null @@ -1,28 +0,0 @@ -class ActsAsTaggableMigration < ActiveRecord::Migration - def self.up - create_table :tags do |t| - t.column :name, :string - t.column :parent_id, :integer - t.column :pending, :boolean, :default => false - end - - create_table :taggings do |t| - t.column :tag_id, :integer - t.column :taggable_id, :integer - - # You should make sure that the column created is - # long enough to store the required class names. - t.column :taggable_type, :string - - t.column :created_at, :datetime - end - - add_index :taggings, :tag_id - add_index :taggings, [:taggable_id, :taggable_type] - end - - def self.down - drop_table :taggings - drop_table :tags - end -end diff --git a/db/migrate/004_create_domains.rb b/db/migrate/004_create_domains.rb new file mode 100644 index 0000000..233ccb1 --- /dev/null +++ b/db/migrate/004_create_domains.rb @@ -0,0 +1,13 @@ +class CreateDomains < ActiveRecord::Migration + def self.up + create_table :domains do |t| + t.column :name, :string + t.column :owner_type, :string + t.column :owner_id, :integer + end + end + + def self.down + drop_table :domains + end +end diff --git a/db/migrate/005_acts_as_taggable_migration.rb b/db/migrate/005_acts_as_taggable_migration.rb new file mode 100644 index 0000000..85d4a5d --- /dev/null +++ b/db/migrate/005_acts_as_taggable_migration.rb @@ -0,0 +1,28 @@ +class ActsAsTaggableMigration < ActiveRecord::Migration + def self.up + create_table :tags do |t| + t.column :name, :string + t.column :parent_id, :integer + t.column :pending, :boolean, :default => false + end + + create_table :taggings do |t| + t.column :tag_id, :integer + t.column :taggable_id, :integer + + # You should make sure that the column created is + # long enough to store the required class names. + t.column :taggable_type, :string + + t.column :created_at, :datetime + end + + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type] + end + + def self.down + drop_table :taggings + drop_table :tags + end +end diff --git a/db/migrate/005_add_design_support.rb b/db/migrate/005_add_design_support.rb deleted file mode 100644 index 5cb45dc..0000000 --- a/db/migrate/005_add_design_support.rb +++ /dev/null @@ -1,28 +0,0 @@ -class AddDesignSupport < ActiveRecord::Migration - def self.up - - create_table :design_boxes do |t| - t.column :name, :string - t.column :title, :string - t.column :number, :integer - t.column :owner_type, :string - t.column :owner_id, :integer - end - - create_table :design_blocks do |t| - t.column :name, :string - t.column :title, :string - t.column :box_id, :integer - t.column :position, :integer - t.column :type, :string - t.column :helper, :string - end - - end - - def self.down - drop_table :design_boxes - drop_table :design_blocks - end - -end -- libgit2 0.21.2