Commit f0111e6480fb942a48789e28b942d11a92750a38
1 parent
66331e33
Exists in
master
and in
28 other branches
ActionItem85: renumbering migrations
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@683 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
16 changed files
with
157 additions
and
157 deletions
Show diff stats
... | ... | @@ -0,0 +1,40 @@ |
1 | +module Comatose | |
2 | + class Page < ActiveRecord::Base | |
3 | + set_table_name 'comatose_pages' | |
4 | + acts_as_versioned :if_changed => [:title, :slug, :keywords, :body] | |
5 | + end | |
6 | +end | |
7 | + | |
8 | +class AddComatoseSupport < ActiveRecord::Migration | |
9 | + | |
10 | + # Schema for Comatose version 0.7+ | |
11 | + def self.up | |
12 | + create_table :comatose_pages do |t| | |
13 | + t.column "parent_id", :integer | |
14 | + t.column "full_path", :text, :default => '' | |
15 | + t.column "title", :string, :limit => 255 | |
16 | + t.column "slug", :string, :limit => 255 | |
17 | + t.column "keywords", :string, :limit => 255 | |
18 | + t.column "body", :text | |
19 | + t.column "filter_type", :string, :limit => 25, :default => "[No Filter]" | |
20 | + t.column "author", :string, :limit => 255 | |
21 | + t.column "position", :integer, :default => 0 | |
22 | + t.column "version", :integer | |
23 | + t.column "updated_on", :datetime | |
24 | + t.column "created_on", :datetime | |
25 | + | |
26 | + # added for STI in noosfero | |
27 | + t.column 'type', :string | |
28 | + | |
29 | + end | |
30 | + Comatose::Page.create_versioned_table | |
31 | + puts "Creating the default 'Home Page'..." | |
32 | + Comatose::Page.create!( :title=>'Home Page', :body=>"h1. Welcome\n\nYour content goes here...", :author=>'System' ) | |
33 | + end | |
34 | + | |
35 | + def self.down | |
36 | + Comatose::Page.drop_versioned_table | |
37 | + drop_table :comatose_pages | |
38 | + end | |
39 | + | |
40 | +end | ... | ... |
db/migrate/008_add_comatose_support.rb
... | ... | @@ -1,40 +0,0 @@ |
1 | -module Comatose | |
2 | - class Page < ActiveRecord::Base | |
3 | - set_table_name 'comatose_pages' | |
4 | - acts_as_versioned :if_changed => [:title, :slug, :keywords, :body] | |
5 | - end | |
6 | -end | |
7 | - | |
8 | -class AddComatoseSupport < ActiveRecord::Migration | |
9 | - | |
10 | - # Schema for Comatose version 0.7+ | |
11 | - def self.up | |
12 | - create_table :comatose_pages do |t| | |
13 | - t.column "parent_id", :integer | |
14 | - t.column "full_path", :text, :default => '' | |
15 | - t.column "title", :string, :limit => 255 | |
16 | - t.column "slug", :string, :limit => 255 | |
17 | - t.column "keywords", :string, :limit => 255 | |
18 | - t.column "body", :text | |
19 | - t.column "filter_type", :string, :limit => 25, :default => "[No Filter]" | |
20 | - t.column "author", :string, :limit => 255 | |
21 | - t.column "position", :integer, :default => 0 | |
22 | - t.column "version", :integer | |
23 | - t.column "updated_on", :datetime | |
24 | - t.column "created_on", :datetime | |
25 | - | |
26 | - # added for STI in noosfero | |
27 | - t.column 'type', :string | |
28 | - | |
29 | - end | |
30 | - Comatose::Page.create_versioned_table | |
31 | - puts "Creating the default 'Home Page'..." | |
32 | - Comatose::Page.create!( :title=>'Home Page', :body=>"h1. Welcome\n\nYour content goes here...", :author=>'System' ) | |
33 | - end | |
34 | - | |
35 | - def self.down | |
36 | - Comatose::Page.drop_versioned_table | |
37 | - drop_table :comatose_pages | |
38 | - end | |
39 | - | |
40 | -end |
... | ... | @@ -0,0 +1,18 @@ |
1 | +class CreateOrganizationInfos < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :organization_infos do |t| | |
4 | + t.column :organization_id, :integer | |
5 | + t.column :contact_person, :string | |
6 | + t.column :acronym, :string | |
7 | + t.column :foundation_year, :integer, :limit => 4 | |
8 | + t.column :legal_form, :string | |
9 | + t.column :economic_activity, :string | |
10 | + t.column :management_information, :string | |
11 | + t.column :validated, :boolean, :default => false | |
12 | + end | |
13 | + end | |
14 | + | |
15 | + def self.down | |
16 | + drop_table :organization_infos | |
17 | + end | |
18 | +end | ... | ... |
... | ... | @@ -0,0 +1,13 @@ |
1 | +class CreateFriendships < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :friendships do |t| | |
4 | + t.column :person_id, :integer | |
5 | + t.column :friend_id, :integer | |
6 | + t.column :created_at, :datetime | |
7 | + end | |
8 | + end | |
9 | + | |
10 | + def self.down | |
11 | + drop_table :friendships | |
12 | + end | |
13 | +end | ... | ... |
db/migrate/010_create_organization_infos.rb
... | ... | @@ -1,18 +0,0 @@ |
1 | -class CreateOrganizationInfos < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :organization_infos do |t| | |
4 | - t.column :organization_id, :integer | |
5 | - t.column :contact_person, :string | |
6 | - t.column :acronym, :string | |
7 | - t.column :foundation_year, :integer, :limit => 4 | |
8 | - t.column :legal_form, :string | |
9 | - t.column :economic_activity, :string | |
10 | - t.column :management_information, :string | |
11 | - t.column :validated, :boolean, :default => false | |
12 | - end | |
13 | - end | |
14 | - | |
15 | - def self.down | |
16 | - drop_table :organization_infos | |
17 | - end | |
18 | -end |
... | ... | @@ -0,0 +1,16 @@ |
1 | +class CreatePersonInfos < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :person_infos do |t| | |
4 | + t.column :name, :string | |
5 | + t.column :photo, :text | |
6 | + t.column :address, :text | |
7 | + t.column :contact_information, :text | |
8 | + | |
9 | + t.column :person_id, :integer | |
10 | + end | |
11 | + end | |
12 | + | |
13 | + def self.down | |
14 | + drop_table :person_infos | |
15 | + end | |
16 | +end | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +class CreateCategories < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :categories do |t| | |
4 | + t.column :name, :string | |
5 | + t.column :slug, :string | |
6 | + t.column :path, :text, :default => '' | |
7 | + | |
8 | + t.column :display_color, :integer | |
9 | + | |
10 | + t.column :environment_id, :integer | |
11 | + t.column :parent_id, :integer | |
12 | + t.column :type, :string | |
13 | + end | |
14 | + end | |
15 | + | |
16 | + def self.down | |
17 | + drop_table :categories | |
18 | + end | |
19 | +end | ... | ... |
db/migrate/011_create_friendships.rb
... | ... | @@ -1,13 +0,0 @@ |
1 | -class CreateFriendships < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :friendships do |t| | |
4 | - t.column :person_id, :integer | |
5 | - t.column :friend_id, :integer | |
6 | - t.column :created_at, :datetime | |
7 | - end | |
8 | - end | |
9 | - | |
10 | - def self.down | |
11 | - drop_table :friendships | |
12 | - end | |
13 | -end |
... | ... | @@ -0,0 +1,18 @@ |
1 | +class CreateTasks < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :tasks do |t| | |
4 | + t.column :data, :text | |
5 | + t.column :status, :integer | |
6 | + t.column :end_date, :date | |
7 | + | |
8 | + t.column :requestor_id, :integer | |
9 | + t.column :target_id, :integer | |
10 | + | |
11 | + t.column :code, :string, :limit => 40 | |
12 | + end | |
13 | + end | |
14 | + | |
15 | + def self.down | |
16 | + drop_table :tasks | |
17 | + end | |
18 | +end | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +class AccessControlMigration < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :roles do |t| | |
4 | + t.column :name, :string | |
5 | + t.column :permissions, :string | |
6 | + end | |
7 | + | |
8 | + create_table :role_assignments do |t| | |
9 | + t.column :accessor_id, :integer | |
10 | + t.column :accessor_type, :string | |
11 | + t.column :resource_id, :integer | |
12 | + t.column :resource_type, :string | |
13 | + t.column :role_id, :integer | |
14 | + end | |
15 | + end | |
16 | + | |
17 | + def self.down | |
18 | + drop_table :roles | |
19 | + drop_table :role_assignments | |
20 | + end | |
21 | +end | ... | ... |
db/migrate/013_create_person_infos.rb
... | ... | @@ -1,16 +0,0 @@ |
1 | -class CreatePersonInfos < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :person_infos do |t| | |
4 | - t.column :name, :string | |
5 | - t.column :photo, :text | |
6 | - t.column :address, :text | |
7 | - t.column :contact_information, :text | |
8 | - | |
9 | - t.column :person_id, :integer | |
10 | - end | |
11 | - end | |
12 | - | |
13 | - def self.down | |
14 | - drop_table :person_infos | |
15 | - end | |
16 | -end |
... | ... | @@ -0,0 +1,12 @@ |
1 | +class CreateRegionValidatorsTable < ActiveRecord::Migration | |
2 | + def self.up | |
3 | + create_table :region_validators, :id => false do |t| | |
4 | + t.column :region_id, :integer | |
5 | + t.column :organization_id, :integer | |
6 | + end | |
7 | + end | |
8 | + | |
9 | + def self.down | |
10 | + drop_table :region_validators | |
11 | + end | |
12 | +end | ... | ... |
db/migrate/016_create_categories.rb
... | ... | @@ -1,19 +0,0 @@ |
1 | -class CreateCategories < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :categories do |t| | |
4 | - t.column :name, :string | |
5 | - t.column :slug, :string | |
6 | - t.column :path, :text, :default => '' | |
7 | - | |
8 | - t.column :display_color, :integer | |
9 | - | |
10 | - t.column :environment_id, :integer | |
11 | - t.column :parent_id, :integer | |
12 | - t.column :type, :string | |
13 | - end | |
14 | - end | |
15 | - | |
16 | - def self.down | |
17 | - drop_table :categories | |
18 | - end | |
19 | -end |
db/migrate/017_create_tasks.rb
... | ... | @@ -1,18 +0,0 @@ |
1 | -class CreateTasks < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :tasks do |t| | |
4 | - t.column :data, :text | |
5 | - t.column :status, :integer | |
6 | - t.column :end_date, :date | |
7 | - | |
8 | - t.column :requestor_id, :integer | |
9 | - t.column :target_id, :integer | |
10 | - | |
11 | - t.column :code, :string, :limit => 40 | |
12 | - end | |
13 | - end | |
14 | - | |
15 | - def self.down | |
16 | - drop_table :tasks | |
17 | - end | |
18 | -end |
db/migrate/018_access_control_migration.rb
... | ... | @@ -1,21 +0,0 @@ |
1 | -class AccessControlMigration < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :roles do |t| | |
4 | - t.column :name, :string | |
5 | - t.column :permissions, :string | |
6 | - end | |
7 | - | |
8 | - create_table :role_assignments do |t| | |
9 | - t.column :accessor_id, :integer | |
10 | - t.column :accessor_type, :string | |
11 | - t.column :resource_id, :integer | |
12 | - t.column :resource_type, :string | |
13 | - t.column :role_id, :integer | |
14 | - end | |
15 | - end | |
16 | - | |
17 | - def self.down | |
18 | - drop_table :roles | |
19 | - drop_table :role_assignments | |
20 | - end | |
21 | -end |
db/migrate/019_create_region_validators_table.rb
... | ... | @@ -1,12 +0,0 @@ |
1 | -class CreateRegionValidatorsTable < ActiveRecord::Migration | |
2 | - def self.up | |
3 | - create_table :region_validators, :id => false do |t| | |
4 | - t.column :region_id, :integer | |
5 | - t.column :organization_id, :integer | |
6 | - end | |
7 | - end | |
8 | - | |
9 | - def self.down | |
10 | - drop_table :region_validators | |
11 | - end | |
12 | -end |