migrant 1.5.0 → 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -29
- data/.rspec +2 -0
- data/.travis.yml +8 -5
- data/Gemfile +3 -4
- data/LICENSE.txt +21 -0
- data/{README.rdoc → README.md} +57 -57
- data/Rakefile +4 -31
- data/VERSION +1 -1
- data/lib/dsl/data_type.rb +5 -1
- data/lib/dsl/data_types/primitives.rb +11 -0
- data/lib/generators/templates/change_migration.erb +1 -1
- data/lib/generators/templates/create_migration.erb +1 -1
- data/lib/generators/templates/create_migration.rb +1 -1
- data/lib/migrant/migration_generator.rb +10 -6
- data/lib/migrant/model_extensions.rb +1 -1
- data/lib/migrant/schema.rb +0 -2
- data/lib/railtie.rb +2 -2
- data/lib/tasks/db.rake +0 -6
- data/migrant.gemspec +30 -31
- metadata +63 -193
- data/.rvmrc +0 -1
- data/LICENSE +0 -20
- data/lib/simple_object.rb +0 -13
- data/test/additional_models/review.rb +0 -11
- data/test/helper.rb +0 -64
- data/test/rails_app/.gitignore +0 -4
- data/test/rails_app/README +0 -256
- data/test/rails_app/Rakefile +0 -7
- data/test/rails_app/app/controllers/application_controller.rb +0 -3
- data/test/rails_app/app/helpers/application_helper.rb +0 -2
- data/test/rails_app/app/models/business.rb +0 -25
- data/test/rails_app/app/models/business_category.rb +0 -6
- data/test/rails_app/app/models/category.rb +0 -10
- data/test/rails_app/app/models/chameleon.rb +0 -5
- data/test/rails_app/app/models/customer.rb +0 -9
- data/test/rails_app/app/models/non_migrant_model.rb +0 -3
- data/test/rails_app/app/models/user.rb +0 -8
- data/test/rails_app/app/views/layouts/application.html.erb +0 -14
- data/test/rails_app/config.ru +0 -4
- data/test/rails_app/config/application.rb +0 -16
- data/test/rails_app/config/boot.rb +0 -13
- data/test/rails_app/config/database.yml +0 -7
- data/test/rails_app/config/environment.rb +0 -5
- data/test/rails_app/config/environments/development.rb +0 -26
- data/test/rails_app/config/environments/production.rb +0 -49
- data/test/rails_app/config/environments/test.rb +0 -35
- data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails_app/config/initializers/inflections.rb +0 -10
- data/test/rails_app/config/initializers/mime_types.rb +0 -5
- data/test/rails_app/config/initializers/secret_token.rb +0 -7
- data/test/rails_app/config/initializers/session_store.rb +0 -8
- data/test/rails_app/config/locales/en.yml +0 -5
- data/test/rails_app/config/routes.rb +0 -58
- data/test/rails_app/db/seeds.rb +0 -7
- data/test/rails_app/lib/tasks/.gitkeep +0 -0
- data/test/rails_app/public/404.html +0 -26
- data/test/rails_app/public/422.html +0 -26
- data/test/rails_app/public/500.html +0 -26
- data/test/rails_app/script/rails +0 -6
- data/test/rails_app/test/performance/browsing_test.rb +0 -9
- data/test/rails_app/test/test_helper.rb +0 -13
- data/test/rails_app/vendor/plugins/.gitkeep +0 -0
- data/test/test_data_schema.rb +0 -108
- data/test/test_migration_generator.rb +0 -251
- data/test/test_validations.rb +0 -49
- data/test/test_zzz_performance.rb +0 -13
- data/test/verified_output/migrations/added_incompatible_spot_and_deleted_spots.rb +0 -11
- data/test/verified_output/migrations/business_id.rb +0 -10
- data/test/verified_output/migrations/businesses_indexed_name.rb +0 -8
- data/test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb +0 -15
- data/test/verified_output/migrations/create_business_categories.rb +0 -14
- data/test/verified_output/migrations/create_businesses.rb +0 -31
- data/test/verified_output/migrations/create_categories.rb +0 -13
- data/test/verified_output/migrations/create_chameleons.rb +0 -11
- data/test/verified_output/migrations/create_reviews.rb +0 -18
- data/test/verified_output/migrations/create_users.rb +0 -19
- data/test/verified_output/migrations/created_at.rb +0 -11
- data/test/verified_output/migrations/deleted_incompatible_spot.rb +0 -9
- data/test/verified_output/migrations/deleted_spots.rb +0 -9
- data/test/verified_output/migrations/estimated_value_notes.rb +0 -11
- data/test/verified_output/migrations/landline.rb +0 -9
- data/test/verified_output/migrations/modified_verified.rb +0 -9
- data/test/verified_output/migrations/renamed_old_spots.rb +0 -9
data/test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
class ChangedChameleonsAddedNewLongerSpotsAndMovedNewSpots < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :chameleons, :new_longer_spots, :text
|
4
|
-
puts "-- copy data from :new_spots to :new_longer_spots"
|
5
|
-
Chameleon.update_all("new_longer_spots = new_spots")
|
6
|
-
remove_column :chameleons, :new_spots
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.down
|
10
|
-
add_column :chameleons, :new_spots, :string, :limit=>255
|
11
|
-
puts "-- copy data from :new_longer_spots to :new_spots"
|
12
|
-
Chameleon.update_all("new_spots = new_longer_spots")
|
13
|
-
remove_column :chameleons, :new_longer_spots
|
14
|
-
end
|
15
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class CreateBusinessCategories < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :business_categories do |t|
|
4
|
-
t.integer :business_id
|
5
|
-
t.integer :category_id
|
6
|
-
end
|
7
|
-
add_index :business_categories, :business_id
|
8
|
-
add_index :business_categories, :category_id
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.down
|
12
|
-
drop_table :business_categories
|
13
|
-
end
|
14
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
class CreateBusinesses < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :businesses do |t|
|
4
|
-
t.integer :user_id
|
5
|
-
t.string :owner_type
|
6
|
-
t.integer :owner_id
|
7
|
-
t.string :name
|
8
|
-
t.string :website
|
9
|
-
t.text :address
|
10
|
-
t.string :summary
|
11
|
-
t.text :description
|
12
|
-
t.string :landline
|
13
|
-
t.string :mobile
|
14
|
-
t.integer :operating_days
|
15
|
-
t.datetime :date_established
|
16
|
-
t.datetime :next_sale
|
17
|
-
t.date :date_registered
|
18
|
-
t.boolean :verified
|
19
|
-
t.string :location, :limit=>127
|
20
|
-
t.text :awards
|
21
|
-
t.text :managers
|
22
|
-
end
|
23
|
-
add_index :businesses, :user_id
|
24
|
-
add_index :businesses, [:owner_type, :owner_id]
|
25
|
-
add_index :businesses, :owner_id
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.down
|
29
|
-
drop_table :businesses
|
30
|
-
end
|
31
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class CreateReviews < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :reviews do |t|
|
4
|
-
t.integer :business_id
|
5
|
-
t.integer :user_id
|
6
|
-
t.string :name
|
7
|
-
t.integer :rating
|
8
|
-
t.text :body
|
9
|
-
t.integer :views
|
10
|
-
end
|
11
|
-
add_index :reviews, :business_id
|
12
|
-
add_index :reviews, :user_id
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
drop_table :reviews
|
17
|
-
end
|
18
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class CreateUsers < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :users do |t|
|
4
|
-
t.string :name
|
5
|
-
t.string :email
|
6
|
-
t.integer :category_id
|
7
|
-
t.string :encrypted_password, :limit=>48
|
8
|
-
t.string :password_salt, :limit=>42
|
9
|
-
t.decimal :money_spent, :precision=>10, :scale=>2
|
10
|
-
t.decimal :money_gifted, :precision=>10, :scale=>2
|
11
|
-
t.float :average_rating
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.down
|
17
|
-
drop_table :users
|
18
|
-
end
|
19
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class ChangedBusinessesAddedCreatedAtUpdatedAt < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :businesses, :updated_at, :datetime
|
4
|
-
add_column :businesses, :created_at, :datetime
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.down
|
8
|
-
remove_column :businesses, :updated_at
|
9
|
-
remove_column :businesses, :created_at
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class ChangedBusinessesAddedEstimatedValueNotes < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :businesses, :estimated_value, :float
|
4
|
-
add_column :businesses, :notes, :string
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.down
|
8
|
-
remove_column :businesses, :estimated_value
|
9
|
-
remove_column :businesses, :notes
|
10
|
-
end
|
11
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class ChangedBusinessesModifiedVerifiedDefaultedToTrue < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
change_column :businesses, :verified, :boolean, :default=>true
|
4
|
-
end
|
5
|
-
|
6
|
-
def self.down
|
7
|
-
change_column :businesses, :verified, :boolean, :limit=>nil, :default=>false
|
8
|
-
end
|
9
|
-
end
|