prick 0.4.0 → 0.5.0

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/TODO +7 -0
  4. data/exe/prick +95 -33
  5. data/lib/ext/fileutils.rb +7 -0
  6. data/lib/prick.rb +5 -3
  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 -18
  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 +199 -0
  16. data/lib/prick/project.rb +277 -0
  17. data/lib/prick/rdbms.rb +2 -1
  18. data/lib/prick/schema.rb +5 -10
  19. data/lib/prick/state.rb +129 -74
  20. data/lib/prick/version.rb +41 -28
  21. data/share/diff/diff.after-tables.sql +4 -0
  22. data/share/diff/diff.before-tables.sql +4 -0
  23. data/share/diff/diff.tables.sql +8 -0
  24. data/share/migration/diff.tables.sql +8 -0
  25. data/share/{release_migration → migration}/features.yml +0 -0
  26. data/share/migration/migrate.sql +3 -0
  27. data/share/{release_migration → migration}/migrate.yml +3 -0
  28. data/share/migration/tables.sql +3 -0
  29. data/share/{schemas → schema/schema}/build.yml +0 -0
  30. data/share/{schemas → schema/schema}/prick/build.yml +0 -0
  31. data/share/schema/schema/prick/data.sql +7 -0
  32. data/share/{schemas → schema/schema}/prick/schema.sql +0 -0
  33. data/share/{schemas → schema/schema}/prick/tables.sql +2 -2
  34. data/share/{schemas → schema/schema}/public/.keep +0 -0
  35. data/share/{schemas → schema/schema}/public/build.yml +0 -0
  36. data/share/{schemas → schema/schema}/public/schema.sql +0 -0
  37. data/test_refactor +34 -0
  38. metadata +22 -20
  39. data/file +0 -0
  40. data/lib/prick/build.rb +0 -376
  41. data/lib/prick/migra.rb +0 -22
  42. data/share/feature_migration/diff.sql +0 -2
  43. data/share/feature_migration/migrate.sql +0 -2
  44. data/share/release_migration/diff.sql +0 -3
  45. data/share/release_migration/migrate.sql +0 -5
  46. data/share/schemas/prick/data.sql +0 -7
@@ -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
-