migrant 1.5.0 → 2.0.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -29
  3. data/.rspec +2 -0
  4. data/.travis.yml +8 -5
  5. data/Gemfile +3 -4
  6. data/LICENSE.txt +21 -0
  7. data/{README.rdoc → README.md} +57 -57
  8. data/Rakefile +4 -31
  9. data/VERSION +1 -1
  10. data/lib/dsl/data_type.rb +5 -1
  11. data/lib/dsl/data_types/primitives.rb +11 -0
  12. data/lib/generators/templates/change_migration.erb +1 -1
  13. data/lib/generators/templates/create_migration.erb +1 -1
  14. data/lib/generators/templates/create_migration.rb +1 -1
  15. data/lib/migrant/migration_generator.rb +10 -6
  16. data/lib/migrant/model_extensions.rb +1 -1
  17. data/lib/migrant/schema.rb +0 -2
  18. data/lib/railtie.rb +2 -2
  19. data/lib/tasks/db.rake +0 -6
  20. data/migrant.gemspec +30 -31
  21. metadata +63 -193
  22. data/.rvmrc +0 -1
  23. data/LICENSE +0 -20
  24. data/lib/simple_object.rb +0 -13
  25. data/test/additional_models/review.rb +0 -11
  26. data/test/helper.rb +0 -64
  27. data/test/rails_app/.gitignore +0 -4
  28. data/test/rails_app/README +0 -256
  29. data/test/rails_app/Rakefile +0 -7
  30. data/test/rails_app/app/controllers/application_controller.rb +0 -3
  31. data/test/rails_app/app/helpers/application_helper.rb +0 -2
  32. data/test/rails_app/app/models/business.rb +0 -25
  33. data/test/rails_app/app/models/business_category.rb +0 -6
  34. data/test/rails_app/app/models/category.rb +0 -10
  35. data/test/rails_app/app/models/chameleon.rb +0 -5
  36. data/test/rails_app/app/models/customer.rb +0 -9
  37. data/test/rails_app/app/models/non_migrant_model.rb +0 -3
  38. data/test/rails_app/app/models/user.rb +0 -8
  39. data/test/rails_app/app/views/layouts/application.html.erb +0 -14
  40. data/test/rails_app/config.ru +0 -4
  41. data/test/rails_app/config/application.rb +0 -16
  42. data/test/rails_app/config/boot.rb +0 -13
  43. data/test/rails_app/config/database.yml +0 -7
  44. data/test/rails_app/config/environment.rb +0 -5
  45. data/test/rails_app/config/environments/development.rb +0 -26
  46. data/test/rails_app/config/environments/production.rb +0 -49
  47. data/test/rails_app/config/environments/test.rb +0 -35
  48. data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -7
  49. data/test/rails_app/config/initializers/inflections.rb +0 -10
  50. data/test/rails_app/config/initializers/mime_types.rb +0 -5
  51. data/test/rails_app/config/initializers/secret_token.rb +0 -7
  52. data/test/rails_app/config/initializers/session_store.rb +0 -8
  53. data/test/rails_app/config/locales/en.yml +0 -5
  54. data/test/rails_app/config/routes.rb +0 -58
  55. data/test/rails_app/db/seeds.rb +0 -7
  56. data/test/rails_app/lib/tasks/.gitkeep +0 -0
  57. data/test/rails_app/public/404.html +0 -26
  58. data/test/rails_app/public/422.html +0 -26
  59. data/test/rails_app/public/500.html +0 -26
  60. data/test/rails_app/script/rails +0 -6
  61. data/test/rails_app/test/performance/browsing_test.rb +0 -9
  62. data/test/rails_app/test/test_helper.rb +0 -13
  63. data/test/rails_app/vendor/plugins/.gitkeep +0 -0
  64. data/test/test_data_schema.rb +0 -108
  65. data/test/test_migration_generator.rb +0 -251
  66. data/test/test_validations.rb +0 -49
  67. data/test/test_zzz_performance.rb +0 -13
  68. data/test/verified_output/migrations/added_incompatible_spot_and_deleted_spots.rb +0 -11
  69. data/test/verified_output/migrations/business_id.rb +0 -10
  70. data/test/verified_output/migrations/businesses_indexed_name.rb +0 -8
  71. data/test/verified_output/migrations/chameleons_added_new_longer_spots_and_moved_new_spots.rb +0 -15
  72. data/test/verified_output/migrations/create_business_categories.rb +0 -14
  73. data/test/verified_output/migrations/create_businesses.rb +0 -31
  74. data/test/verified_output/migrations/create_categories.rb +0 -13
  75. data/test/verified_output/migrations/create_chameleons.rb +0 -11
  76. data/test/verified_output/migrations/create_reviews.rb +0 -18
  77. data/test/verified_output/migrations/create_users.rb +0 -19
  78. data/test/verified_output/migrations/created_at.rb +0 -11
  79. data/test/verified_output/migrations/deleted_incompatible_spot.rb +0 -9
  80. data/test/verified_output/migrations/deleted_spots.rb +0 -9
  81. data/test/verified_output/migrations/estimated_value_notes.rb +0 -11
  82. data/test/verified_output/migrations/landline.rb +0 -9
  83. data/test/verified_output/migrations/modified_verified.rb +0 -9
  84. data/test/verified_output/migrations/renamed_old_spots.rb +0 -9
@@ -1,8 +0,0 @@
1
- class ChangedBusinessesIndexedName < ActiveRecord::Migration
2
- def self.up
3
- add_index :businesses, :name
4
- end
5
-
6
- def self.down
7
- end
8
- end
@@ -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,13 +0,0 @@
1
- class CreateCategories < ActiveRecord::Migration
2
- def self.up
3
- create_table :categories do |t|
4
- t.string :title
5
- t.string :summary
6
- end
7
- add_index :categories, :title
8
- end
9
-
10
- def self.down
11
- drop_table :categories
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- class CreateChameleons < ActiveRecord::Migration
2
- def self.up
3
- create_table :chameleons do |t|
4
- t.string :spots
5
- end
6
- end
7
-
8
- def self.down
9
- drop_table :chameleons
10
- end
11
- 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,9 +0,0 @@
1
- class ChangedChameleonsDeletedIncompatibleSpot < ActiveRecord::Migration
2
- def self.up
3
- remove_column :chameleons, :incompatible_spot
4
- end
5
-
6
- def self.down
7
- add_column :chameleons, :incompatible_spot, :integer, :limit=>nil
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class ChangedChameleonsDeletedSpots < ActiveRecord::Migration
2
- def self.up
3
- remove_column :chameleons, :spots
4
- end
5
-
6
- def self.down
7
- add_column :chameleons, :spots, :string, :limit=>255
8
- end
9
- 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 ChangedBusinessesModifiedLandline < ActiveRecord::Migration
2
- def self.up
3
- change_column :businesses, :landline, :text
4
- end
5
-
6
- def self.down
7
- change_column :businesses, :landline, :string, :limit=>255, :default=>nil
8
- end
9
- 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
@@ -1,9 +0,0 @@
1
- class ChangedChameleonsRenamedOldSpots < ActiveRecord::Migration
2
- def self.up
3
- rename_column :chameleons, :old_spots, :new_spots
4
- end
5
-
6
- def self.down
7
- rename_column :chameleons, :new_spots, :old_spots
8
- end
9
- end