prick 0.3.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/TODO +7 -0
- data/exe/prick +235 -163
- data/lib/ext/fileutils.rb +7 -0
- data/lib/prick.rb +7 -5
- data/lib/prick/builder.rb +31 -8
- data/lib/prick/cache.rb +34 -0
- data/lib/prick/constants.rb +106 -54
- data/lib/prick/database.rb +26 -20
- data/lib/prick/diff.rb +103 -25
- data/lib/prick/git.rb +31 -9
- data/lib/prick/head.rb +183 -0
- data/lib/prick/migration.rb +41 -181
- data/lib/prick/program.rb +255 -0
- data/lib/prick/project.rb +264 -0
- data/lib/prick/rdbms.rb +3 -12
- data/lib/prick/schema.rb +6 -11
- data/lib/prick/state.rb +129 -74
- data/lib/prick/version.rb +41 -28
- data/prick.gemspec +3 -1
- data/share/diff/diff.after-tables.sql +4 -0
- data/share/diff/diff.before-tables.sql +4 -0
- data/share/diff/diff.tables.sql +8 -0
- data/share/migration/diff.tables.sql +8 -0
- data/share/{release_migration → migration}/features.yml +0 -0
- data/share/migration/migrate.sql +3 -0
- data/share/{release_migration → migration}/migrate.yml +3 -0
- data/share/migration/tables.sql +3 -0
- data/share/{schemas → schema/schema}/build.yml +0 -0
- data/share/{schemas → schema/schema}/prick/build.yml +0 -0
- data/share/schema/schema/prick/data.sql +7 -0
- data/share/{schemas → schema/schema}/prick/schema.sql +0 -0
- data/share/{schemas → schema/schema}/prick/tables.sql +2 -2
- data/share/{schemas → schema/schema}/public/.keep +0 -0
- data/share/{schemas → schema/schema}/public/build.yml +0 -0
- data/share/{schemas → schema/schema}/public/schema.sql +0 -0
- data/test_refactor +34 -0
- metadata +23 -21
- data/file +0 -0
- data/lib/prick/build.rb +0 -376
- data/lib/prick/migra.rb +0 -22
- data/share/feature_migration/diff.sql +0 -2
- data/share/feature_migration/migrate.sql +0 -2
- data/share/release_migration/diff.sql +0 -3
- data/share/release_migration/migrate.sql +0 -5
- data/share/schemas/prick/data.sql +0 -7
data/lib/prick/migra.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
module Prick
|
3
|
-
module Migra
|
4
|
-
def self.migrate(from_name, to_name, file)
|
5
|
-
args = urls(from_name, to_name).join(" ")
|
6
|
-
options = OPTIONS.join(" ")
|
7
|
-
Command.command %(
|
8
|
-
status=0
|
9
|
-
migra #{options} #{args} >#{file} || { status=$?; }
|
10
|
-
[ $status = 2 ] || exit 1
|
11
|
-
)
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
OPTIONS = %w(--unsafe --with-privileges)
|
16
|
-
|
17
|
-
def self.urls(*args)
|
18
|
-
args = Array(args).flatten
|
19
|
-
args.map { |name| "postgresql:///#{name}" }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|