prick 0.19.0 → 0.20.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +10 -4
  3. data/README.md +7 -7
  4. data/Rakefile +3 -1
  5. data/TODO +13 -11
  6. data/bin/console +2 -1
  7. data/doc/build-yml.txt +14 -0
  8. data/exe/prick +237 -19
  9. data/lib/builder/batch.rb +147 -0
  10. data/lib/builder/builder.rb +122 -0
  11. data/lib/builder/node.rb +189 -0
  12. data/lib/builder/node_pool.rb +105 -0
  13. data/lib/builder/parser.rb +120 -0
  14. data/lib/local/command.rb +193 -0
  15. data/lib/{prick → local}/git.rb +148 -22
  16. data/lib/local/timer.rb +98 -0
  17. data/lib/prick/constants.rb +54 -66
  18. data/lib/prick/diff.rb +28 -18
  19. data/lib/prick/prick_version.rb +161 -0
  20. data/lib/prick/state.rb +80 -165
  21. data/lib/prick/version.rb +2 -163
  22. data/lib/prick.rb +38 -24
  23. data/lib/share/init/.gitignore +10 -0
  24. data/lib/share/init/.prick-context +2 -0
  25. data/lib/share/init/.rspec +3 -0
  26. data/{share/schema/schema/public → lib/share/init/migration}/.keep +0 -0
  27. data/lib/share/init/prick.yml +6 -0
  28. data/lib/share/init/schema/.keep +0 -0
  29. data/lib/share/init/schema/build.yml +2 -0
  30. data/lib/share/init/schema/prick/.keep +0 -0
  31. data/lib/share/init/schema/prick/build.yml +5 -0
  32. data/lib/share/init/schema/prick/data.sql +6 -0
  33. data/{share/schema → lib/share/init}/schema/prick/tables.sql +2 -3
  34. data/lib/share/init/schema/public/.keep +0 -0
  35. data/lib/share/init/spec/prick_helper.rb +1 -0
  36. data/lib/share/init/spec/prick_spec.rb +6 -0
  37. data/lib/share/init/spec/spec_helper.rb +50 -0
  38. data/lib/share/migrate/migration/build.yml +4 -0
  39. data/lib/share/migrate/migration/diff.after-tables.sql +0 -0
  40. data/lib/share/migrate/migration/diff.before-tables.sql +0 -0
  41. data/lib/share/migrate/migration/diff.tables.sql +0 -0
  42. data/lib/subcommand/prick-build.rb +55 -0
  43. data/lib/subcommand/prick-create.rb +78 -0
  44. data/lib/subcommand/prick-drop.rb +25 -0
  45. data/lib/subcommand/prick-fox.rb +62 -0
  46. data/lib/subcommand/prick-init.rb +46 -0
  47. data/lib/subcommand/prick-make.rb +202 -0
  48. data/lib/subcommand/prick-migrate.rb +37 -0
  49. data/lib/subcommand/prick-release.rb +23 -0
  50. data/lib/subcommand/prick-setup.rb +20 -0
  51. data/lib/subcommand/prick-teardown.rb +18 -0
  52. data/prick.gemspec +32 -21
  53. metadata +95 -76
  54. data/.gitignore +0 -29
  55. data/.travis.yml +0 -7
  56. data/doc/create_release.txt +0 -17
  57. data/doc/flow.txt +0 -98
  58. data/doc/migra +0 -1
  59. data/doc/migrations.txt +0 -172
  60. data/doc/notes.txt +0 -116
  61. data/doc/prick.txt +0 -114
  62. data/doc/sh.prick +0 -316
  63. data/lib/ext/algorithm.rb +0 -14
  64. data/lib/ext/fileutils.rb +0 -26
  65. data/lib/ext/forward_method.rb +0 -18
  66. data/lib/ext/pg.rb +0 -18
  67. data/lib/ext/shortest_path.rb +0 -44
  68. data/lib/prick/archive.rb +0 -124
  69. data/lib/prick/branch.rb +0 -265
  70. data/lib/prick/builder.rb +0 -246
  71. data/lib/prick/cache.rb +0 -34
  72. data/lib/prick/command.rb +0 -104
  73. data/lib/prick/database.rb +0 -82
  74. data/lib/prick/dsort.rb +0 -151
  75. data/lib/prick/ensure.rb +0 -119
  76. data/lib/prick/exceptions.rb +0 -25
  77. data/lib/prick/head.rb +0 -189
  78. data/lib/prick/migration.rb +0 -70
  79. data/lib/prick/program.rb +0 -287
  80. data/lib/prick/project.rb +0 -626
  81. data/lib/prick/rdbms.rb +0 -137
  82. data/lib/prick/schema.rb +0 -27
  83. data/lib/prick/share.rb +0 -64
  84. data/libexec/strip-comments +0 -33
  85. data/make_releases +0 -72
  86. data/make_schema +0 -10
  87. data/share/diff/diff.after-tables.sql +0 -4
  88. data/share/diff/diff.before-tables.sql +0 -4
  89. data/share/diff/diff.tables.sql +0 -8
  90. data/share/features/diff.sql +0 -2
  91. data/share/features/feature/diff.sql +0 -2
  92. data/share/features/feature/migrate.sql +0 -2
  93. data/share/features/features.sql +0 -2
  94. data/share/features/features.yml +0 -2
  95. data/share/features/migrations.sql +0 -4
  96. data/share/gitignore +0 -2
  97. data/share/migration/diff.tables.sql +0 -8
  98. data/share/migration/features.yml +0 -6
  99. data/share/migration/migrate.sql +0 -3
  100. data/share/migration/migrate.yml +0 -8
  101. data/share/migration/tables.sql +0 -3
  102. data/share/schema/build.yml +0 -14
  103. data/share/schema/schema/build.yml +0 -3
  104. data/share/schema/schema/prick/build.yml +0 -14
  105. data/share/schema/schema/prick/data.sql +0 -7
  106. data/share/schema/schema/prick/schema.sql +0 -3
  107. data/share/schema/schema/public/build.yml +0 -13
  108. data/share/schema/schema.sql +0 -3
  109. data/test_assorted +0 -192
  110. data/test_feature +0 -112
  111. data/test_refactor +0 -34
  112. data/test_single_dev +0 -83
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-19 00:00:00.000000000 Z
11
+ date: 2022-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: shellopts
14
+ name: semantic
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0.pre.14
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.0.pre.14
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: semantic
28
+ name: indented_io
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: indented_io
42
+ name: constrain
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: boolean
56
+ name: forward_to
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: constrain
70
+ name: bootsnap
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,13 +81,13 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: developer_exceptions
84
+ name: ruby-prof
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
- type: :runtime
90
+ type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
@@ -122,6 +122,48 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: boolean
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: developer_exceptions
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: shellopts
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 2.0.23
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 2.0.23
125
167
  description: A release control and management system for postgresql
126
168
  email:
127
169
  - claus.l.rasmussen@gmail.com
@@ -130,83 +172,60 @@ executables:
130
172
  extensions: []
131
173
  extra_rdoc_files: []
132
174
  files:
133
- - ".gitignore"
134
175
  - ".rspec"
135
176
  - ".ruby-version"
136
- - ".travis.yml"
137
177
  - Gemfile
138
178
  - README.md
139
179
  - Rakefile
140
180
  - TODO
141
181
  - bin/console
142
182
  - bin/setup
143
- - doc/create_release.txt
144
- - doc/flow.txt
145
- - doc/migra
146
- - doc/migrations.txt
147
- - doc/notes.txt
148
- - doc/prick.txt
149
- - doc/sh.prick
183
+ - doc/build-yml.txt
150
184
  - exe/prick
151
- - lib/ext/algorithm.rb
152
- - lib/ext/fileutils.rb
153
- - lib/ext/forward_method.rb
154
- - lib/ext/pg.rb
155
- - lib/ext/shortest_path.rb
185
+ - lib/builder/batch.rb
186
+ - lib/builder/builder.rb
187
+ - lib/builder/node.rb
188
+ - lib/builder/node_pool.rb
189
+ - lib/builder/parser.rb
190
+ - lib/local/command.rb
191
+ - lib/local/git.rb
192
+ - lib/local/timer.rb
156
193
  - lib/prick.rb
157
- - lib/prick/archive.rb
158
- - lib/prick/branch.rb
159
- - lib/prick/builder.rb
160
- - lib/prick/cache.rb
161
- - lib/prick/command.rb
162
194
  - lib/prick/constants.rb
163
- - lib/prick/database.rb
164
195
  - lib/prick/diff.rb
165
- - lib/prick/dsort.rb
166
- - lib/prick/ensure.rb
167
- - lib/prick/exceptions.rb
168
- - lib/prick/git.rb
169
- - lib/prick/head.rb
170
- - lib/prick/migration.rb
171
- - lib/prick/program.rb
172
- - lib/prick/project.rb
173
- - lib/prick/rdbms.rb
174
- - lib/prick/schema.rb
175
- - lib/prick/share.rb
196
+ - lib/prick/prick_version.rb
176
197
  - lib/prick/state.rb
177
198
  - lib/prick/version.rb
178
- - libexec/strip-comments
179
- - make_releases
180
- - make_schema
199
+ - lib/share/init/.gitignore
200
+ - lib/share/init/.prick-context
201
+ - lib/share/init/.rspec
202
+ - lib/share/init/migration/.keep
203
+ - lib/share/init/prick.yml
204
+ - lib/share/init/schema/.keep
205
+ - lib/share/init/schema/build.yml
206
+ - lib/share/init/schema/prick/.keep
207
+ - lib/share/init/schema/prick/build.yml
208
+ - lib/share/init/schema/prick/data.sql
209
+ - lib/share/init/schema/prick/tables.sql
210
+ - lib/share/init/schema/public/.keep
211
+ - lib/share/init/spec/prick_helper.rb
212
+ - lib/share/init/spec/prick_spec.rb
213
+ - lib/share/init/spec/spec_helper.rb
214
+ - lib/share/migrate/migration/build.yml
215
+ - lib/share/migrate/migration/diff.after-tables.sql
216
+ - lib/share/migrate/migration/diff.before-tables.sql
217
+ - lib/share/migrate/migration/diff.tables.sql
218
+ - lib/subcommand/prick-build.rb
219
+ - lib/subcommand/prick-create.rb
220
+ - lib/subcommand/prick-drop.rb
221
+ - lib/subcommand/prick-fox.rb
222
+ - lib/subcommand/prick-init.rb
223
+ - lib/subcommand/prick-make.rb
224
+ - lib/subcommand/prick-migrate.rb
225
+ - lib/subcommand/prick-release.rb
226
+ - lib/subcommand/prick-setup.rb
227
+ - lib/subcommand/prick-teardown.rb
181
228
  - prick.gemspec
182
- - share/diff/diff.after-tables.sql
183
- - share/diff/diff.before-tables.sql
184
- - share/diff/diff.tables.sql
185
- - share/features/diff.sql
186
- - share/features/feature/diff.sql
187
- - share/features/feature/migrate.sql
188
- - share/features/features.sql
189
- - share/features/features.yml
190
- - share/features/migrations.sql
191
- - share/gitignore
192
- - share/migration/diff.tables.sql
193
- - share/migration/features.yml
194
- - share/migration/migrate.sql
195
- - share/migration/migrate.yml
196
- - share/migration/tables.sql
197
- - share/schema/build.yml
198
- - share/schema/schema.sql
199
- - share/schema/schema/build.yml
200
- - share/schema/schema/prick/build.yml
201
- - share/schema/schema/prick/data.sql
202
- - share/schema/schema/prick/schema.sql
203
- - share/schema/schema/prick/tables.sql
204
- - share/schema/schema/public/.keep
205
- - share/schema/schema/public/build.yml
206
- - test_assorted
207
- - test_feature
208
- - test_refactor
209
- - test_single_dev
210
229
  homepage: http://www.nowhere.com/
211
230
  licenses: []
212
231
  metadata: {}
@@ -218,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
237
  requirements:
219
238
  - - ">="
220
239
  - !ruby/object:Gem::Version
221
- version: 2.7.1
240
+ version: '0'
222
241
  required_rubygems_version: !ruby/object:Gem::Requirement
223
242
  requirements:
224
243
  - - ">="
data/.gitignore DELETED
@@ -1,29 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /rdoc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- /spec/tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
13
-
14
- # Ignore auto-generated main file
15
- /main
16
-
17
- # Ignore Gemfile.lock. See https://stackoverflow.com/questions/4151495/should-gemfile-lock-be-included-in-gitignore
18
- /Gemfile.lock
19
-
20
- # Put your personal ignore files in /home/clr/.config/git/ignore
21
-
22
- # Ignore bundle binstubs
23
- /bin/prick
24
-
25
- # Ignore development testing dir
26
- /dir
27
-
28
- # Ignore stove-away directory
29
- /hold
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.6
7
- before_install: gem install bundler -v 1.17.3
@@ -1,17 +0,0 @@
1
-
2
- 0.0.0
3
- feature_a
4
- feature_b
5
- feature_c
6
-
7
-
8
- branch 0.0.1.pre.1
9
- merge feature_a
10
- merge feature_b
11
-
12
-
13
-
14
-
15
-
16
-
17
-
data/doc/flow.txt DELETED
@@ -1,98 +0,0 @@
1
-
2
-
3
- Premises:
4
- o When a feature is developed, the release is not known => Features are
5
- stored in subdirectories of the base version
6
- o Because features are stored in subdirectories of the base version, releases
7
- have to live on separate branches to avoid conflicts when two releases
8
- use the same base version but different features
9
- o As a side-effect a release has a record of previous releases and features
10
- in the features/ directory
11
- o Features are relatively orthogonal and rarely cause conflicts
12
-
13
- o We want to maintain history => Files are not moved around
14
- o We want to support custom releases => Releases lives on branches
15
- o We want to be able to shortcircuit the migration chain
16
- o We want to be able to bring custom releases back into the main line =>
17
- Rebasing lives on separate branches
18
- o We want to support semantic versioning
19
-
20
-
21
- Notes:
22
- o Referring to a tag gives you a point-in-time. Referring to a branch gives
23
- you the newest version
24
- o Two kinds of migrations: Feature migrations on new releases and
25
- jump-migrations between releases
26
-
27
-
28
- Commands
29
- Developer:
30
- prick checkout 0.0.0
31
- prick feature feature_a
32
- prick checkout feature_a-0.0.0
33
- work...work...work
34
- prick commit
35
- prick checkout master
36
-
37
- Release manager:
38
- prick checkout 0.0.0
39
- prick prepare 0.0.1
40
- prick checkout 0.0.1.pre
41
- prick merge feature_a-0.0.0 (or 'prick merge feature_a' using lookup by <feature>-<base_version>)
42
-
43
- Developer:
44
- prick checkout 0.0.0
45
- prick feature feature_b
46
- prick checkout feature_b
47
- work...work...work
48
- prick commit
49
- prick checkout master
50
-
51
- Release manager:
52
- prick merge feature_b (conflicts!)
53
- asks developer to rebase to current tag
54
-
55
- Developer:
56
- prick checkout feature_b
57
- prick rebase 0.0.1.pre
58
- work...work...work
59
- prick commit
60
- prick checkout master
61
-
62
- Release manager:
63
- prick merge feature_b-0.0.1.pre
64
-
65
-
66
- Different models:
67
-
68
- PER-DIRECTORY-MIGRATION (check)
69
- migrations
70
- 0.0.0/
71
- 0.0.1/
72
- ...
73
-
74
- features/ (not 'releases' because features are nested below the base release)
75
- 0.0.0/
76
- migrate.sql (overrides everything, defaults to calling features.sql)
77
- features.sql (list of features in merge-order, maintained by prick)
78
- feature_a/
79
- merge.sql (contains functions, indexes, and other stuff that doesn't require data migration)
80
- migrate.sql (data migrations)
81
- feature_b/
82
- migrate.sql
83
-
84
- 0.0.0-customer/
85
- ...
86
-
87
- 'feature_a' branch:
88
- 0.0.0/
89
- migrate.sql (auto-generated, calls feature_a/migrate.sql)
90
- feature_a/
91
- migrate.sql
92
-
93
-
94
- SHARED-MIGRATION
95
- features/
96
- 0.0.0/
97
- migrate.sql
98
-
data/doc/migra DELETED
@@ -1 +0,0 @@
1
- https://github.com/djrobstep/migra
data/doc/migrations.txt DELETED
@@ -1,172 +0,0 @@
1
-
2
-
3
- Each release lives on a branch of it's own and its history will only show
4
- included features. Development happens on feature branches based on the release
5
-
6
- A release lives on a branch because we want to be able to create more than one
7
- release from a base release with different features and also have a single
8
- migration file with full history
9
-
10
- Features are kept on feature branches and only merged when a release is
11
- created. The migration.sql file for a feature lives in the directory of the
12
- base release. Because each feature use the same migration file, the file
13
- will be merged by git as new features are merged into the release
14
-
15
- If a feature is not included in a release, a new migration can be created -
16
- either using rebase or copy. Rebase is preferred because it maintains history but
17
- copy allows the feature to be included in other releases based on the original
18
-
19
- migrations/
20
- 0.0.0/
21
- migrate.sql
22
- migrate to 0.1.0. We know that because we're on the 0.1.0 branch.
23
- Other releases based on 0.0.0 may have different migration files
24
-
25
- prick build & load can build release files for other branches without
26
- touching the current branch. This is used when creating migrations
27
- 0.1.0/
28
- migrate-0.0.0.sql
29
-
30
- on a feature branch for 0.1.0
31
- 0.0.0/
32
- migrate.sql <- contain migrations for this feature when based on 0.0.0
33
- 0.1.0/
34
- migrate.sql <- contain migrations for this feature when based on 0.1.0
35
-
36
- Problem?
37
- 0.0.0 -> 0.0.1 -> 0.0.2 ->
38
- -> 0.0.1-special -> 0.0.2-special -> 0.0.3
39
-
40
- Der vil være merge conflicts hele vejen ned. Alternativt finde en måde at sige,
41
- at den ene branch vinder. Måske forbyde merge af release branches? Og i stedet
42
- merge features fra den anden branch manuelt? Til slut kan man lave en migration
43
- i hånden fra den anden branch
44
-
45
-
46
-
47
- DEVELOPER ALICE:
48
- create branch alice from 0.0.0
49
- work...work...work
50
- create migration
51
- commit & push
52
-
53
- DEVELOPER BOB:
54
- create branch bob from 0.0.0
55
- work...work...work
56
- create migration
57
- commit & push
58
-
59
- DEVELOPER CHARLOTTE:
60
- create branch charlotte from 0.0.0
61
- work...work...work
62
- create migration
63
- commit & push
64
-
65
- RELEASE MANAGER ERIC:
66
- set base version to 0.0.0
67
- branch to a prerelease 0.1.0. This creates a migration file in the base version
68
- merge branch alice (no conflicts). Migration file is 0.0.0/migrate.sql
69
- merge branch bob. Merges happens to 0.0.0/migrate.sql
70
- mark alice and bob branches as dead
71
- merge branch charlotte (conflicts - rolled back)
72
- adapt migration file 0.0.0->0.1.0
73
- create release 0.1.0
74
- 0.1.0 is now the new master branch
75
-
76
- DEVELOPER CHARLOTTE:
77
- checkout branch charlotte
78
- if 0.0.0 feature is not expected to be included in other 0.0.0 based releases
79
- rebase to 0.1.0 (no conflicts because 0.1.0 doesn't contain a migration file but probably can't run)
80
- else
81
- copy to 0.1.0
82
- end
83
- adapt migration file
84
- commit & push
85
-
86
- Every branch-release will have a trail of previous releases
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
- features/
97
- 0.0.0/
98
- feature_a/
99
- migrate.sql
100
- feature_b/
101
- migrate.sql # Migrate off 0.0.0
102
- 0.1.0/ # Includes feature_a
103
- migrate-0.0.0.sql # Migrate off 0.0.0
104
- feature_b/
105
- migrate.sql # Migrate off 0.1.0
106
-
107
- Creating a "branch"
108
- features/
109
- 0.0.0/
110
- feature_a/
111
- migrate.sql
112
- 0.1.0/
113
- migrate-0.0.0.sql
114
- feature_b/
115
- migrate.sql
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
- .
126
- ├── 0.0.0
127
- │ └── migrate.sql
128
- ├── 0.0.1
129
- │ ├── 0.0.0.sql
130
- │ └── migrate.sql
131
- ├── 0.0.2
132
- │ ├── 0.0.1.sql
133
- │ └── migrate.sql
134
- ├── 0.1.0
135
- │ └── 0.0.1.sql
136
- └── migrate.sql
137
-
138
-
139
- 0.0.0
140
- feature_a
141
- migrate.sql
142
- feature_b
143
- migrate.sql
144
-
145
- 0.0.1
146
- 0.0.0.sql <- 0.0.0/feature_a/migrate.sql
147
-
148
- rebasing feature_b:
149
-
150
- feature_b
151
- migrate.sql
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
- patches/
163
- my-fix-for-something/
164
- schemas/
165
- migrations/
166
- ...
167
- my-friends-fix-for-something-else/
168
- schemas/
169
- migrations/
170
- ...
171
-
172
-
data/doc/notes.txt DELETED
@@ -1,116 +0,0 @@
1
-
2
- Git mv link
3
- https://linuxctl.com/2016/03/git---preserve-history-when-moving-files/
4
-
5
- Upgrade to ruby-2.7
6
- gem update --system
7
- https://github.com/rubygems/rubygems/issues/3284
8
-
9
- Notes
10
- o name defaults to
11
- - the value of the PRICK_DATABASE environment variable
12
- - the name of the current directory
13
-
14
- Directory structure
15
- Prick uses the following directory structure:
16
-
17
- releases/
18
- Contains a <project>-<version>.tar.gz file for each release
19
-
20
- migrations/
21
-
22
- .
23
- ├── 0.0.0
24
- │ └── migrate.sql
25
- ├── 0.0.1
26
- │ ├── 0.0.0.sql
27
- │ └── migrate.sql
28
- ├── 0.0.2
29
- │ ├── 0.0.1.sql
30
- │ └── migrate.sql
31
- ├── 0.1.0
32
- │ └── 0.0.1.sql
33
- └── migrate.sql
34
-
35
- Migration files are the result of merging in migrations from the branches that this
36
- release includes. They are read-only
37
-
38
- When a migration is created, the migration file from the from-release is copied to
39
- to the to-release directory
40
-
41
-
42
-
43
- Each migration directory contains ...
44
- :::here it gets interesting:::
45
- o a file listing individual patches for this release (this keeps the git
46
- log because we don't have to move individual developer's migration
47
- directories around)
48
- o a script for resolving conflicting patches. Another option is to make
49
- a changes patch/ directory and commit them as part of the git-release
50
-
51
- patches/
52
- my-fix-for-something/
53
- schemas/
54
- migrations/
55
- ...
56
- my-friends-fix-for-something-else/
57
- schemas/
58
- migrations/
59
- ...
60
-
61
- schemas/
62
- prick/
63
- Contains the definition of the prick database schema. The schema contains
64
- a VERSIONS table and probably a PATCHES table
65
-
66
- tests/
67
-
68
- current/ -> symlink to a unique directory under patches/
69
-
70
- snapshots/
71
- Like releases but just a copy of the database
72
-
73
- TODO: Keep track of patches in the database when preparing
74
-
75
- Developing
76
- Make your changes to schemas/ and reload often
77
-
78
- You can generate migrations as you go:
79
-
80
- change some definitions
81
- run 'prick generate migration'
82
- modify generated migration file
83
- test
84
- commit
85
-
86
- Preparing
87
- Creates a new database with the version number. The database is loaded with
88
- the content of schemas/
89
-
90
- The release is then built by pulling in patches from individual developers
91
- and list them in a configuration file. Conflicts can be resolved by a script
92
-
93
- Releasing
94
- The content of schemas/ is executed on a fresh database and the result is
95
- dumped to the releases/ directory. This is the only time a release is saved.
96
- A release contains the schema and constant data but not user data
97
-
98
- Migrating
99
- The current database is updated using the scripts in migrations/
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
- Prick
114
- o creates a database and a user at the same time
115
- o creates a 'prick' schema in the database with a versions table
116
- o uses the unversioned database as work space