data_plan 1.0.2 → 1.0.3
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.
- data/README +14 -6
- metadata +4 -4
data/README
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
== Data Plan
|
2
2
|
|
3
|
-
|
4
|
-
with Rails too.
|
3
|
+
Data Plan migration generator - computes migration code automatically.
|
4
|
+
Works with Sinatra/ActiveRecord and with Rails too.
|
5
5
|
|
6
6
|
== Usage
|
7
7
|
|
8
|
-
Create db/plan.rb file and write desired db schema in it according to
|
9
|
-
Rails's schema.rb syntax.
|
8
|
+
Create db/plan.rb file once and write desired db schema in it according to
|
9
|
+
Rails's schema.rb syntax. Tip: in rails, just copy your schema.rb to plan.rb.
|
10
|
+
Of course, you can update plan.rb anytime later.
|
10
11
|
|
11
|
-
When you create a migration,
|
12
|
+
When you create a migration, this generator will find and put all
|
12
13
|
differencies between plan.rb and your current database schema!
|
13
14
|
That's it, you get migration code automatically. You can migrate
|
14
15
|
immediately, or add some more tweaks to your migration, or something else.
|
@@ -24,6 +25,13 @@ Nice bonus: migrations are automatically named (of course you may override
|
|
24
25
|
name suggested). So you just call 'rake db:create_migration' without
|
25
26
|
NAME=... argument and get the migration name for free too.
|
26
27
|
|
28
|
+
== Example
|
29
|
+
./script/generate migration
|
30
|
+
|
31
|
+
This will look at plan.rb and at current db. If for example plan.rb contains
|
32
|
+
more columns/table/indexes than in db, it will generate migration with
|
33
|
+
corresponding add_column/add_table/add_index commands in it.
|
34
|
+
|
27
35
|
== How to install
|
28
36
|
|
29
37
|
Before use with Sinatra, install 'sinatra-activerecord' gem.
|
@@ -34,7 +42,7 @@ After that you can invoke 'rake db:create_migration' and get migrations.
|
|
34
42
|
|
35
43
|
* Install the gem:
|
36
44
|
gem install data_plan
|
37
|
-
* Add to Rakefile:
|
45
|
+
* Add to Rakefile (after sinatra-activerecord rake commands):
|
38
46
|
require 'data_plan/generators/migration/sinatra'
|
39
47
|
|
40
48
|
== How to use with Rails
|
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:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pavel Vasev
|
@@ -69,6 +69,6 @@ rubyforge_project:
|
|
69
69
|
rubygems_version: 1.8.24
|
70
70
|
signing_key:
|
71
71
|
specification_version: 3
|
72
|
-
summary:
|
72
|
+
summary: Data Plan migration generator - computes migration code automatically. Works with Sinatra/ActiveRecord and with Rails too.
|
73
73
|
test_files: []
|
74
74
|
|