Commit 9a139d204c2174e73ab0d9fb1162b95181585a2d
1 parent
5210a465
Exists in
master
and in
22 other branches
r266@sede: terceiro | 2007-07-29 23:39:51 -0300
reordering migrations git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@270 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
9 changed files
with
116 additions
and
84 deletions
Show diff stats
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +class AddDesignSupport < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + | ||
4 | + create_table :design_boxes do |t| | ||
5 | + t.column :name, :string | ||
6 | + t.column :title, :string | ||
7 | + t.column :number, :integer | ||
8 | + t.column :owner_type, :string | ||
9 | + t.column :owner_id, :integer | ||
10 | + end | ||
11 | + | ||
12 | + create_table :design_blocks do |t| | ||
13 | + t.column :name, :string | ||
14 | + t.column :title, :string | ||
15 | + t.column :box_id, :integer | ||
16 | + t.column :position, :integer | ||
17 | + t.column :type, :string | ||
18 | + t.column :helper, :string | ||
19 | + end | ||
20 | + | ||
21 | + end | ||
22 | + | ||
23 | + def self.down | ||
24 | + drop_table :design_boxes | ||
25 | + drop_table :design_blocks | ||
26 | + end | ||
27 | + | ||
28 | +end |
db/migrate/001_create_virtual_communities.rb
@@ -1,15 +0,0 @@ | @@ -1,15 +0,0 @@ | ||
1 | -class CreateVirtualCommunities < ActiveRecord::Migration | ||
2 | - def self.up | ||
3 | - create_table :virtual_communities do |t| | ||
4 | - t.column :name, :string | ||
5 | - t.column :is_default, :boolean | ||
6 | - t.column :settings, :text | ||
7 | - t.column :design_data, :text | ||
8 | - end | ||
9 | - VirtualCommunity.create(:name => 'Default Virtual Community', :is_default => true) | ||
10 | - end | ||
11 | - | ||
12 | - def self.down | ||
13 | - drop_table :virtual_communities | ||
14 | - end | ||
15 | -end |
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +class CreateVirtualCommunities < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + create_table :virtual_communities do |t| | ||
4 | + t.column :name, :string | ||
5 | + t.column :is_default, :boolean | ||
6 | + t.column :settings, :text | ||
7 | + t.column :design_data, :text | ||
8 | + end | ||
9 | + VirtualCommunity.create(:name => 'Default Virtual Community', :is_default => true) | ||
10 | + end | ||
11 | + | ||
12 | + def self.down | ||
13 | + drop_table :virtual_communities | ||
14 | + end | ||
15 | +end |
db/migrate/003_create_domains.rb
@@ -1,13 +0,0 @@ | @@ -1,13 +0,0 @@ | ||
1 | -class CreateDomains < ActiveRecord::Migration | ||
2 | - def self.up | ||
3 | - create_table :domains do |t| | ||
4 | - t.column :name, :string | ||
5 | - t.column :owner_type, :string | ||
6 | - t.column :owner_id, :integer | ||
7 | - end | ||
8 | - end | ||
9 | - | ||
10 | - def self.down | ||
11 | - drop_table :domains | ||
12 | - end | ||
13 | -end |
@@ -0,0 +1,32 @@ | @@ -0,0 +1,32 @@ | ||
1 | +class CreateProfiles < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + create_table :profiles do |t| | ||
4 | + t.column :name, :string | ||
5 | + t.column :type, :string | ||
6 | + t.column :identifier, :string | ||
7 | + t.column :virtual_community_id, :integer | ||
8 | + t.column :flexible_template_template, :string, :default => "default" | ||
9 | + t.column :flexible_template_theme, :string, :default => "default" | ||
10 | + t.column :flexible_template_icon_theme, :string, :default => "default" | ||
11 | + t.column :active, :boolean, :default => "false" | ||
12 | + | ||
13 | + #person fields | ||
14 | + t.column :user_id, :integer | ||
15 | + | ||
16 | + #enterprise fields | ||
17 | + t.column :address, :string | ||
18 | + t.column :contact_phone, :string | ||
19 | + t.column :contact_person, :string | ||
20 | + t.column :acronym, :string | ||
21 | + t.column :foundation_year, :integer, :limit => 4 | ||
22 | + t.column :legal_form, :string | ||
23 | + t.column :economic_activity, :string | ||
24 | + t.column :management_information, :string | ||
25 | + | ||
26 | + end | ||
27 | + end | ||
28 | + | ||
29 | + def self.down | ||
30 | + drop_table :profiles | ||
31 | + end | ||
32 | +end |
db/migrate/004_acts_as_taggable_migration.rb
@@ -1,28 +0,0 @@ | @@ -1,28 +0,0 @@ | ||
1 | -class ActsAsTaggableMigration < ActiveRecord::Migration | ||
2 | - def self.up | ||
3 | - create_table :tags do |t| | ||
4 | - t.column :name, :string | ||
5 | - t.column :parent_id, :integer | ||
6 | - t.column :pending, :boolean, :default => false | ||
7 | - end | ||
8 | - | ||
9 | - create_table :taggings do |t| | ||
10 | - t.column :tag_id, :integer | ||
11 | - t.column :taggable_id, :integer | ||
12 | - | ||
13 | - # You should make sure that the column created is | ||
14 | - # long enough to store the required class names. | ||
15 | - t.column :taggable_type, :string | ||
16 | - | ||
17 | - t.column :created_at, :datetime | ||
18 | - end | ||
19 | - | ||
20 | - add_index :taggings, :tag_id | ||
21 | - add_index :taggings, [:taggable_id, :taggable_type] | ||
22 | - end | ||
23 | - | ||
24 | - def self.down | ||
25 | - drop_table :taggings | ||
26 | - drop_table :tags | ||
27 | - end | ||
28 | -end |
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +class CreateDomains < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + create_table :domains do |t| | ||
4 | + t.column :name, :string | ||
5 | + t.column :owner_type, :string | ||
6 | + t.column :owner_id, :integer | ||
7 | + end | ||
8 | + end | ||
9 | + | ||
10 | + def self.down | ||
11 | + drop_table :domains | ||
12 | + end | ||
13 | +end |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +class ActsAsTaggableMigration < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + create_table :tags do |t| | ||
4 | + t.column :name, :string | ||
5 | + t.column :parent_id, :integer | ||
6 | + t.column :pending, :boolean, :default => false | ||
7 | + end | ||
8 | + | ||
9 | + create_table :taggings do |t| | ||
10 | + t.column :tag_id, :integer | ||
11 | + t.column :taggable_id, :integer | ||
12 | + | ||
13 | + # You should make sure that the column created is | ||
14 | + # long enough to store the required class names. | ||
15 | + t.column :taggable_type, :string | ||
16 | + | ||
17 | + t.column :created_at, :datetime | ||
18 | + end | ||
19 | + | ||
20 | + add_index :taggings, :tag_id | ||
21 | + add_index :taggings, [:taggable_id, :taggable_type] | ||
22 | + end | ||
23 | + | ||
24 | + def self.down | ||
25 | + drop_table :taggings | ||
26 | + drop_table :tags | ||
27 | + end | ||
28 | +end |
db/migrate/005_add_design_support.rb
@@ -1,28 +0,0 @@ | @@ -1,28 +0,0 @@ | ||
1 | -class AddDesignSupport < ActiveRecord::Migration | ||
2 | - def self.up | ||
3 | - | ||
4 | - create_table :design_boxes do |t| | ||
5 | - t.column :name, :string | ||
6 | - t.column :title, :string | ||
7 | - t.column :number, :integer | ||
8 | - t.column :owner_type, :string | ||
9 | - t.column :owner_id, :integer | ||
10 | - end | ||
11 | - | ||
12 | - create_table :design_blocks do |t| | ||
13 | - t.column :name, :string | ||
14 | - t.column :title, :string | ||
15 | - t.column :box_id, :integer | ||
16 | - t.column :position, :integer | ||
17 | - t.column :type, :string | ||
18 | - t.column :helper, :string | ||
19 | - end | ||
20 | - | ||
21 | - end | ||
22 | - | ||
23 | - def self.down | ||
24 | - drop_table :design_boxes | ||
25 | - drop_table :design_blocks | ||
26 | - end | ||
27 | - | ||
28 | -end |