mince_migrator 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.
- checksums.yaml +4 -4
- data/README.md +15 -43
- data/lib/mince_migrator/migration.rb +3 -5
- data/lib/mince_migrator/version.rb +1 -1
- metadata +2 -18
- data/spec/support/db/a_second_migration.rb +0 -24
- data/spec/support/db/a_second_migration_2.rb +0 -24
- data/spec/support/db/create_seeded_admin_users.rb +0 -24
- data/spec/support/db/first_migration.rb +0 -24
- data/spec/support/db/first_migration_2.rb +0 -24
- data/spec/support/db/first_migration_3.rb +0 -24
- data/spec/support/db/first_migration_4.rb +0 -24
- data/spec/support/db/name_of_migration.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4970ab56e20586bbb6fbed75b96da905fe44cfaf
|
4
|
+
data.tar.gz: 4db88ed335467034f71816032f5f827aa4fda33a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69a6683c1d5256fccb9c2e2a185a872654c264d1691b0f1436c318cb76b45cd2ba466b49026d2e0bf3fa22d9ac89fa9116d0b0a6bb01a0a3b84dbbc3c19bd74f
|
7
|
+
data.tar.gz: 628239e0af4352fc1e3f57eff9aa03be78d5b5870f4754e14b68193919cee429af475fac2e586ed3e84090ee88bcedd77ce7de7686fb454b26b29aa736fe1672
|
data/README.md
CHANGED
@@ -5,62 +5,34 @@
|
|
5
5
|
Mince Migrator is a library that provides a way to run database
|
6
6
|
migrations for your ruby applications.
|
7
7
|
|
8
|
-
##
|
8
|
+
## 1. Install
|
9
9
|
|
10
10
|
$ gem install mince_migrator
|
11
11
|
|
12
|
-
##
|
12
|
+
## 2. Use
|
13
13
|
|
14
|
-
|
14
|
+
$ mince_migrator create Load admin users
|
15
|
+
# Implement your migration by opening db/migration/load_admin_users.rb
|
16
|
+
$ mince_migrator run Load admin users
|
15
17
|
|
16
|
-
|
18
|
+
## 3. Learn more
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
The output of creating the migration will tell you where the migration was created.
|
21
|
-
|
22
|
-
Implement the `run` method with the behavior of your migration.
|
23
|
-
|
24
|
-
### Run your single migration
|
25
|
-
|
26
|
-
$ mince_migrator run "Load admin users"
|
27
|
-
|
28
|
-
### Revert your single migration
|
29
|
-
|
30
|
-
$ mince_migrator revert "Load admin users"
|
31
|
-
|
32
|
-
### Run all migrations that have not yet been ran
|
33
|
-
|
34
|
-
$ mince_migrator run_all
|
35
|
-
|
36
|
-
### View all migrations
|
37
|
-
|
38
|
-
*My favorite!*
|
39
|
-
|
40
|
-
$ mince_migrator list
|
41
|
-
|
42
|
-
### Check the status of a migration
|
43
|
-
|
44
|
-
$ mince_migrator show "Load admin users"
|
45
|
-
|
46
|
-
### View all available commands
|
47
|
-
|
48
|
-
$ mince_migrator --help
|
20
|
+
For more info, view the [home page](http://coffeencoke.github.io/mince_migrator/).
|
49
21
|
|
50
22
|
## Contributing
|
51
23
|
|
52
24
|
1. Fork it
|
53
|
-
2. Create
|
54
|
-
3. Commit
|
55
|
-
4. Push
|
56
|
-
5. Create
|
25
|
+
2. Create feature branch (`git checkout -b my-new-feature`)
|
26
|
+
3. Commit changes (`git commit -am 'Add some feature'`)
|
27
|
+
4. Push the branch (`git push origin my-new-feature`)
|
28
|
+
5. Create Pull Request
|
57
29
|
|
58
30
|
## Bonus contributions!
|
59
31
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
32
|
+
* Talk with me first
|
33
|
+
* Make all commits stable
|
34
|
+
* Include tests
|
35
|
+
* Update documentation for your added feature
|
64
36
|
|
65
37
|
Special Thanks to [@davetron5000](https://github.com/davetron5000) for writing [gli](https://github.com/davetron5000/gli)
|
66
38
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'debugger'
|
2
|
-
|
3
1
|
module MinceMigrator
|
4
2
|
require_relative 'migrations/file'
|
5
3
|
require_relative 'ran_migration'
|
@@ -56,9 +54,9 @@ module MinceMigrator
|
|
56
54
|
|
57
55
|
def self.new_from_file(file)
|
58
56
|
new(
|
59
|
-
klass: file.klass,
|
60
|
-
name: file.name,
|
61
|
-
relative_path: file.full_relative_path,
|
57
|
+
klass: file.klass,
|
58
|
+
name: file.name,
|
59
|
+
relative_path: file.full_relative_path,
|
62
60
|
path: file.full_path
|
63
61
|
)
|
64
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mince_migrator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Simpson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mince
|
@@ -243,14 +243,6 @@ files:
|
|
243
243
|
- spec/integration/reverting_a_migration_spec.rb
|
244
244
|
- spec/integration/running_a_migration_spec.rb
|
245
245
|
- spec/integration_helper.rb
|
246
|
-
- spec/support/db/a_second_migration.rb
|
247
|
-
- spec/support/db/a_second_migration_2.rb
|
248
|
-
- spec/support/db/create_seeded_admin_users.rb
|
249
|
-
- spec/support/db/first_migration.rb
|
250
|
-
- spec/support/db/first_migration_2.rb
|
251
|
-
- spec/support/db/first_migration_3.rb
|
252
|
-
- spec/support/db/first_migration_4.rb
|
253
|
-
- spec/support/db/name_of_migration.rb
|
254
246
|
- spec/support/invalid_interface_migration.rb
|
255
247
|
- spec/support/not_a_migration.rb
|
256
248
|
- spec/support/test_migration.rb
|
@@ -299,14 +291,6 @@ test_files:
|
|
299
291
|
- spec/integration/reverting_a_migration_spec.rb
|
300
292
|
- spec/integration/running_a_migration_spec.rb
|
301
293
|
- spec/integration_helper.rb
|
302
|
-
- spec/support/db/a_second_migration.rb
|
303
|
-
- spec/support/db/a_second_migration_2.rb
|
304
|
-
- spec/support/db/create_seeded_admin_users.rb
|
305
|
-
- spec/support/db/first_migration.rb
|
306
|
-
- spec/support/db/first_migration_2.rb
|
307
|
-
- spec/support/db/first_migration_3.rb
|
308
|
-
- spec/support/db/first_migration_4.rb
|
309
|
-
- spec/support/db/name_of_migration.rb
|
310
294
|
- spec/support/invalid_interface_migration.rb
|
311
295
|
- spec/support/not_a_migration.rb
|
312
296
|
- spec/support/test_migration.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module ASecondMigration
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module ASecondMigration2
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module CreateSeededAdminUsers
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module FirstMigration
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module FirstMigration2
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module FirstMigration3
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module FirstMigration4
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module MinceMigrator
|
2
|
-
module Migrations
|
3
|
-
require 'time'
|
4
|
-
|
5
|
-
module NameOfMigration
|
6
|
-
def self.run
|
7
|
-
# Actual migration goes here
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.revert
|
11
|
-
# In case you need to revert this one migration
|
12
|
-
end
|
13
|
-
|
14
|
-
# So you can change the order to run more easily
|
15
|
-
def self.time_created
|
16
|
-
Time.parse "2013-03-28 05:03:26 UTC"
|
17
|
-
end
|
18
|
-
|
19
|
-
module Temporary
|
20
|
-
# Migration dependent classes go here
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|