prick 0.3.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/TODO +7 -0
  4. data/exe/prick +235 -163
  5. data/lib/ext/fileutils.rb +7 -0
  6. data/lib/prick.rb +7 -5
  7. data/lib/prick/builder.rb +31 -8
  8. data/lib/prick/cache.rb +34 -0
  9. data/lib/prick/constants.rb +106 -54
  10. data/lib/prick/database.rb +26 -20
  11. data/lib/prick/diff.rb +103 -25
  12. data/lib/prick/git.rb +31 -9
  13. data/lib/prick/head.rb +183 -0
  14. data/lib/prick/migration.rb +41 -181
  15. data/lib/prick/program.rb +255 -0
  16. data/lib/prick/project.rb +264 -0
  17. data/lib/prick/rdbms.rb +3 -12
  18. data/lib/prick/schema.rb +6 -11
  19. data/lib/prick/state.rb +129 -74
  20. data/lib/prick/version.rb +41 -28
  21. data/prick.gemspec +3 -1
  22. data/share/diff/diff.after-tables.sql +4 -0
  23. data/share/diff/diff.before-tables.sql +4 -0
  24. data/share/diff/diff.tables.sql +8 -0
  25. data/share/migration/diff.tables.sql +8 -0
  26. data/share/{release_migration → migration}/features.yml +0 -0
  27. data/share/migration/migrate.sql +3 -0
  28. data/share/{release_migration → migration}/migrate.yml +3 -0
  29. data/share/migration/tables.sql +3 -0
  30. data/share/{schemas → schema/schema}/build.yml +0 -0
  31. data/share/{schemas → schema/schema}/prick/build.yml +0 -0
  32. data/share/schema/schema/prick/data.sql +7 -0
  33. data/share/{schemas → schema/schema}/prick/schema.sql +0 -0
  34. data/share/{schemas → schema/schema}/prick/tables.sql +2 -2
  35. data/share/{schemas → schema/schema}/public/.keep +0 -0
  36. data/share/{schemas → schema/schema}/public/build.yml +0 -0
  37. data/share/{schemas → schema/schema}/public/schema.sql +0 -0
  38. data/test_refactor +34 -0
  39. metadata +23 -21
  40. data/file +0 -0
  41. data/lib/prick/build.rb +0 -376
  42. data/lib/prick/migra.rb +0 -22
  43. data/share/feature_migration/diff.sql +0 -2
  44. data/share/feature_migration/migrate.sql +0 -2
  45. data/share/release_migration/diff.sql +0 -3
  46. data/share/release_migration/migrate.sql +0 -5
  47. 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
@@ -1,2 +0,0 @@
1
- -- Generated by migra(1). Please don't touch. Customize the migration in migrate.sql instead
2
- --
@@ -1,2 +0,0 @@
1
- -- Customize your migrations here
2
- --
@@ -1,3 +0,0 @@
1
- -- Generated by prick(1) via migra(1). Please don't touch. Customize the
2
- -- migration in migrate.sql instead
3
- --
@@ -1,5 +0,0 @@
1
- -- Customize your migrations here
2
- --
3
-
4
- -- Only if no table changes
5
- --\i diff.sql
@@ -1,7 +0,0 @@
1
- -- Auto-generated file. Don't touch
2
- --
3
-
4
- COPY prick.versions (id, custom, major, minor, patch, pre, feature, version) FROM stdin;
5
- 1 \N 0 0 0 \N \N 0.0.0
6
- \.
7
-