data_plan 1.0.1 → 1.0.2

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 (2) hide show
  1. data/README +32 -25
  2. metadata +3 -3
data/README CHANGED
@@ -5,21 +5,13 @@ with Rails too.
5
5
 
6
6
  == Usage
7
7
 
8
- Before use in Sinatra, install 'sinatra-activerecord' gem.
9
- It extends Sinatra with extension methods and Rake tasks for dealing with
10
- an SQL database using the ActiveRecord ORM.
11
- Follow it's instructions and create a Rakefile with migration commands.
12
- After that you can invoke 'rake db:create_migration' and get migrations.
8
+ Create db/plan.rb file and write desired db schema in it according to
9
+ Rails's schema.rb syntax. Of course, you can update plan.rb anytime later.
13
10
 
14
- And then, magic begins.
15
- * Add to Rakefile:
16
- require 'data_plan/generators/migration/sinatra'
17
- * Create db/plan.rb file and describe desired db schema in it.
18
-
19
- Now, when you create a migration, DataPlan will find and put all
11
+ When you create a migration, DataPlan will find and put all
20
12
  differencies between plan.rb and your current database schema!
21
- That's it, you get migration code for free. You can migrate immediately,
22
- or add some more tweaks to your migration, or something else.
13
+ That's it, you get migration code automatically. You can migrate
14
+ immediately, or add some more tweaks to your migration, or something else.
23
15
 
24
16
  Why is it great?
25
17
  * You have the one place (plan.rb) where you write db schema and
@@ -29,29 +21,46 @@ change_column, add_column, etc. You just write the schema in plan.rb
29
21
  file and get migrations code for free.
30
22
 
31
23
  Nice bonus: migrations are automatically named (of course you may override
32
- name suggested).
24
+ name suggested). So you just call 'rake db:create_migration' without
25
+ NAME=... argument and get the migration name for free too.
26
+
27
+ == How to install
28
+
29
+ Before use with Sinatra, install 'sinatra-activerecord' gem.
30
+ It extends Sinatra with extension methods and Rake tasks for dealing with
31
+ an SQL database using the ActiveRecord ORM.
32
+ Follow it's instructions and create a Rakefile with migration commands.
33
+ After that you can invoke 'rake db:create_migration' and get migrations.
34
+
35
+ * Install the gem:
36
+ gem install data_plan
37
+ * Add to Rakefile:
38
+ require 'data_plan/generators/migration/sinatra'
33
39
 
34
40
  == How to use with Rails
41
+
42
+ Yes, you can use DataPlan in Rails too. But it better to use not
43
+ like a gem, and instead directly copy to your application.
44
+
35
45
  Copy from the gem the folder
36
- GEMROOT/lib/data_plan/generators/migration/*
46
+ DATAPLANGEMROOT/lib/data_plan/generators/migration/*
37
47
  to the Rails project as follows:
38
48
  YOURAPPROOT/lib/generators/migration/*
49
+
39
50
  Thats it, Data Plan now in your rails app,
40
51
  and you can invoke 'script/generate migration'
41
52
  and get migrations auto-generated as described above.
42
53
 
43
- == How to install
44
-
45
- gem install data_plan
46
-
47
54
  == Ruby versions
48
- Because Sinatra-ActiveRecord works only with Ruby 1.9, DataPlan works with 1.9 for Sinatra.
49
- For Rails, it should work both for 1.8 and 1.9.
50
- Only (Sinatra-ActiveRecord 1.1.2 + ruby 1.9) and (Rails 2.3 + ruby 1.8) was tested.
55
+
56
+ Because Sinatra-ActiveRecord works only with Ruby 1.9, DataPlan works
57
+ with 1.9 for Sinatra. For Rails, it should work both for 1.8 and 1.9.
58
+ Only (Sinatra-ActiveRecord 1.1.2 + ruby 1.9) and (Rails 2.3 + ruby 1.8)
59
+ were tested.
51
60
 
52
61
  == Todo
53
62
 
54
- Indices are partially supported at the moment.
63
+ Indices are partially supported at the moment. But seems they work ;-)
55
64
 
56
65
  == Changelog
57
66
 
@@ -60,12 +69,10 @@ Workaround on views. Thanks to Cyril Boswell.
60
69
  == Legal
61
70
 
62
71
  Found a bug? Fix it and email pull request to me: pavel.vasev@gmail.com
63
-
64
72
  Want to add a feature? Implement it and email the patch!
65
73
 
66
74
  Pavel Vasev [ pavel.vasev@gmail.com ]
67
75
 
68
-
69
76
  Released under the MIT license (included)
70
77
 
71
78
  p.s. Schema-Definition plugin is hugely based on Auto-Migrations by PJ Hyett
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_plan
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pavel Vasev