ridgepole 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +128 -120
- data/README.md +23 -22
- data/bin/ridgepole +5 -1
- data/gemfiles/activerecord_7.0.gemfile +1 -1
- data/lib/ridgepole/client.rb +1 -1
- data/lib/ridgepole/delta.rb +13 -13
- data/lib/ridgepole/dsl_parser.rb +1 -1
- data/lib/ridgepole/version.rb +1 -1
- data/ridgepole.gemspec +3 -2
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 212f7ac739d81f903fa7df88232f8e17e28b953628d03f9cd9a7c59baa037162
|
4
|
+
data.tar.gz: d61273f751c642076ee08849439b0505f97de16c86426a8f5c8e950a1a661f17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c098c3eb46ba9d00147ec8dc4f2d494ae5a306e30dbce9cb38bc519d5726b1fe514846e7253b3870ed7b7ad4cb23a0e3e338f3755ad98dc6918f1faf25d88b
|
7
|
+
data.tar.gz: 7b18857bdc397b49a31e136032ac38160c369da235af669a442d93d5685ba5aade0fc549a711da3e0654503b669d6d1c70be1789152bbabf4e67ecf9b16974da
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,311 +2,319 @@
|
|
2
2
|
|
3
3
|
## 2.0
|
4
4
|
|
5
|
+
### 2.0.2 (2024/02/25)
|
6
|
+
|
7
|
+
- Fix bug that cannot include single quote in table comment [pull#467](https://github.com/ridgepole/ridgepole/pull/467)
|
8
|
+
|
9
|
+
### 2.0.1 (2023/11/22)
|
10
|
+
|
11
|
+
- Fix renamed_from bug [pull#453](https://github.com/ridgepole/ridgepole/pull/453)
|
12
|
+
|
5
13
|
### 2.0.1 (2023/11/22)
|
6
14
|
|
7
|
-
|
15
|
+
- Fix renamed_from bug [pull#453](https://github.com/ridgepole/ridgepole/pull/453)
|
8
16
|
|
9
17
|
### 2.0.0 (2023/11/10)
|
10
18
|
|
11
|
-
|
19
|
+
- Bump up version.
|
12
20
|
|
13
21
|
### 2.0.0.beta2 (2023/10/26)
|
14
22
|
|
15
|
-
|
16
|
-
|
23
|
+
- Support Rails 7.1 [pull#447](https://github.com/ridgepole/ridgepole/pull/447)
|
24
|
+
- Drop Rails 6.0 support [pull#440](https://github.com/ridgepole/ridgepole/pull/440)
|
17
25
|
|
18
26
|
### 2.0.0.beta (2023/10/22)
|
19
27
|
|
20
|
-
|
21
|
-
|
28
|
+
- Support Rails 7.1 [pull#441](https://github.com/ridgepole/ridgepole/pull/441)
|
29
|
+
- Drop Rails 6.0 support [pull#440](https://github.com/ridgepole/ridgepole/pull/440)
|
22
30
|
|
23
31
|
## 1.2
|
24
32
|
|
25
33
|
### 1.2.1 (2023/07/29)
|
26
34
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
35
|
+
- Support `t.enum` [pull#405](https://github.com/ridgepole/ridgepole/pull/405)
|
36
|
+
- Fix timestamps with index behavior [pull#428](https://github.com/ridgepole/ridgepole/pull/428)
|
37
|
+
- Fix broken `DEFAULT CURRENT_TIMESTAMP` spec [pull#420](https://github.com/ridgepole/ridgepole/pull/420)
|
38
|
+
- Add Ruby 3.2 to CI matrix [pull#419](https://github.com/ridgepole/ridgepole/pull/419)
|
31
39
|
|
32
40
|
### 1.2.0 (2022/09/24)
|
33
41
|
|
34
|
-
|
35
|
-
|
36
|
-
|
42
|
+
- Updated supported column types [pull#399](https://github.com/ridgepole/ridgepole/pull/399) [pull#400](https://github.com/ridgepole/ridgepole/pull/400)
|
43
|
+
- Support check constraint [pull#393](https://github.com/ridgepole/ridgepole/pull/393) [pull#397](https://github.com/ridgepole/ridgepole/pull/397)
|
44
|
+
- Drop suport Rails 5.x [pull#395](https://github.com/ridgepole/ridgepole/pull/395)
|
37
45
|
|
38
46
|
## 1.1
|
39
47
|
|
40
48
|
### 1.1.0 (2022/06/18)
|
41
49
|
|
42
|
-
|
50
|
+
- Revert partitioning support [pull#392](https://github.com/ridgepole/ridgepole/pull/392)
|
43
51
|
|
44
52
|
## 1.0
|
45
53
|
|
46
54
|
### 1.0.7 (2022/06/09)
|
47
55
|
|
48
|
-
|
56
|
+
- Normalize list partition values for PostgreSQL [pull#389](https://github.com/ridgepole/ridgepole/pull/389)
|
49
57
|
|
50
58
|
### 1.0.6 (2022/06/06)
|
51
59
|
|
52
|
-
|
60
|
+
- Support Hash partition for PostgreSQL [pull#387](https://github.com/ridgepole/ridgepole/pull/387)
|
53
61
|
|
54
62
|
### 1.0.5 (2022/06/05)
|
55
63
|
|
56
|
-
|
64
|
+
- Support DEFAULT partition for PostgreSQL [pull#386](https://github.com/ridgepole/ridgepole/pull/386)
|
57
65
|
|
58
66
|
### 1.0.4 (2022/03/28)
|
59
67
|
|
60
|
-
|
68
|
+
- Add warning for generated column [pull#382](https://github.com/ridgepole/ridgepole/pull/382)
|
61
69
|
|
62
70
|
### 1.0.3 (2022/02/12)
|
63
71
|
|
64
|
-
|
72
|
+
- Support Rails 7.0.2 [pull#380](https://github.com/ridgepole/ridgepole/pull/380)
|
65
73
|
|
66
74
|
### 1.0.2 (2022/02/06)
|
67
75
|
|
68
|
-
|
69
|
-
|
76
|
+
- Add support for partitioning ([pull#374](https://github.com/ridgepole/ridgepole/pull/374))
|
77
|
+
- Suppress warning of table option differences ([pull#378](https://github.com/ridgepole/ridgepole/pull/378))
|
70
78
|
|
71
79
|
### 1.0.1 (2022/01/15)
|
72
80
|
|
73
|
-
|
74
|
-
|
75
|
-
|
81
|
+
- Fix code for RuboCop 1.24.1
|
82
|
+
- Fix PostgreSQL spec for Rails 7.0
|
83
|
+
- Update ERBh gem (for development)
|
76
84
|
|
77
85
|
### 1.0.0 (2021/12/19)
|
78
86
|
|
79
|
-
|
80
|
-
|
87
|
+
- Support Rails 7.0
|
88
|
+
- `--skip-drop-table` by default ([pull#363](https://github.com/ridgepole/ridgepole/pull/363))
|
81
89
|
|
82
90
|
## 0.9
|
83
91
|
|
84
92
|
### 0.9.6
|
85
93
|
|
86
|
-
|
94
|
+
- Fix malformed error ([pull#362](https://github.com/ridgepole/ridgepole/pull/362))
|
87
95
|
|
88
96
|
### 0.9.5
|
89
97
|
|
90
|
-
|
98
|
+
- Call `super` in `disable_table_options.rb` ([pull#357](https://github.com/ridgepole/ridgepole/pull/357))
|
91
99
|
|
92
100
|
### 0.9.4
|
93
101
|
|
94
|
-
|
102
|
+
- Fix `--alter-extra` option for unique index ([pull#356](https://github.com/ridgepole/ridgepole/pull/356))
|
95
103
|
|
96
104
|
### 0.9.3
|
97
105
|
|
98
|
-
|
106
|
+
- Fix `limit` option for `t.integer` ([pull#354](https://github.com/ridgepole/ridgepole/pull/354))
|
99
107
|
|
100
108
|
### 0.9.2
|
101
109
|
|
102
|
-
|
110
|
+
- Support `t.column index option` ([pull#353](https://github.com/ridgepole/ridgepole/pull/353))
|
103
111
|
|
104
112
|
### 0.9.1
|
105
113
|
|
106
|
-
|
114
|
+
- Support `t.foreign_key` ([pull#348](https://github.com/ridgepole/ridgepole/pull/348))
|
107
115
|
|
108
116
|
### 0.9.0
|
109
117
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
118
|
+
- Remove `--mysql-use-alter` option ([pull#330](https://github.com/ridgepole/ridgepole/pull/330))
|
119
|
+
- Add `--table-hash-options` option ([pull#331](https://github.com/ridgepole/ridgepole/pull/331))
|
120
|
+
- Support Rails 6.1 ([pull#323](https://github.com/ridgepole/ridgepole/pull/323))
|
121
|
+
- Disable Rails 5.0 support ([pull#335](https://github.com/ridgepole/ridgepole/pull/335))
|
122
|
+
- Fix PK AUTO_INCREMENT change bug ([pull#334](https://github.com/ridgepole/ridgepole/pull/334))
|
115
123
|
|
116
124
|
## 0.8
|
117
125
|
|
118
126
|
### 0.8.13
|
119
127
|
|
120
|
-
|
128
|
+
- Support `serial` and `bigserial` column types ([pull#321](https://github.com/ridgepole/ridgepole/pull/321))
|
121
129
|
|
122
130
|
### 0.8.12
|
123
131
|
|
124
|
-
|
132
|
+
- Pluralize column specified by `references` ([pull#317](https://github.com/ridgepole/ridgepole/pull/317))
|
125
133
|
|
126
134
|
### 0.8.11
|
127
135
|
|
128
|
-
|
129
|
-
|
136
|
+
- Fix FK index check support multiple PK ([pull#315](https://github.com/ridgepole/ridgepole/pull/315))
|
137
|
+
- Support t.reference() foreign_key option ([pull#316](https://github.com/ridgepole/ridgepole/pull/316))
|
130
138
|
|
131
139
|
### 0.8.10
|
132
140
|
|
133
|
-
|
141
|
+
- Raise an error if an InnoDB column has a foreign key but no index ([pull#310](https://github.com/ridgepole/ridgepole/pull/310))
|
134
142
|
|
135
143
|
### 0.8.9
|
136
144
|
|
137
|
-
|
138
|
-
|
145
|
+
- Fix unexpected differences on text types and blob types on Rails 6 ([pull#306](https://github.com/ridgepole/ridgepole/pull/306))
|
146
|
+
- Fix unexpected warning when a foreign key is added on the primary key ([pull#307](https://github.com/ridgepole/ridgepole/pull/307))
|
139
147
|
|
140
148
|
### 0.8.8
|
141
149
|
|
142
|
-
|
150
|
+
- Fix keyword arguments warnings in Ruby 2.7 ([pull#303](https://github.com/ridgepole/ridgepole/pull/303))
|
143
151
|
|
144
152
|
### 0.8.7
|
145
153
|
|
146
|
-
|
154
|
+
- Support `require_relative` ([pull#298](https://github.com/ridgepole/ridgepole/pull/298))
|
147
155
|
|
148
156
|
### 0.8.6
|
149
157
|
|
150
|
-
|
158
|
+
- Support multiple databases feature ([pull#297](https://github.com/ridgepole/ridgepole/pull/297))
|
151
159
|
|
152
160
|
### 0.8.5
|
153
161
|
|
154
|
-
|
162
|
+
- Improve warning message on table options ([pull#291](https://github.com/ridgepole/ridgepole/pull/291))
|
155
163
|
|
156
164
|
### 0.8.4
|
157
165
|
|
158
|
-
|
166
|
+
- Display a warning if an InnoDB table doesn't have any indexes on a column where it has a foreign key ([pull#290](https://github.com/ridgepole/ridgepole/pull/290))
|
159
167
|
|
160
168
|
### 0.8.3
|
161
169
|
|
162
|
-
|
170
|
+
- Fix "topological sort failed" error ([pull#287](https://github.com/ridgepole/ridgepole/pull/287))
|
163
171
|
|
164
172
|
### 0.8.2
|
165
173
|
|
166
|
-
|
174
|
+
- Support `postgres://` schema ([pull#285](https://github.com/ridgepole/ridgepole/pull/285))
|
167
175
|
|
168
176
|
### 0.8.1
|
169
177
|
|
170
|
-
|
178
|
+
- Drop tables in an order considering foreign key constraints ([pull#284](https://github.com/ridgepole/ridgepole/pull/284))
|
171
179
|
|
172
180
|
### 0.8.0
|
173
181
|
|
174
|
-
|
182
|
+
- Support Rails 6.0
|
175
183
|
|
176
184
|
## 0.7
|
177
185
|
|
178
186
|
### 0.7.8
|
179
187
|
|
180
|
-
|
188
|
+
- Fix for `add_foreign_key(..., column: ,,,)` ([pull#278](https://github.com/ridgepole/ridgepole/pull/278))
|
181
189
|
|
182
190
|
### 0.7.7
|
183
191
|
|
184
|
-
|
192
|
+
- Support URI query string ([pull#273](https://github.com/ridgepole/ridgepole/pull/273))
|
185
193
|
|
186
194
|
### 0.7.6
|
187
195
|
|
188
|
-
|
189
|
-
|
196
|
+
- Fix database url check ([pull#266](https://github.com/ridgepole/ridgepole/pull/266))
|
197
|
+
- Add ignore option ([pull#267](https://github.com/ridgepole/ridgepole/pull/267))
|
190
198
|
|
191
199
|
### 0.7.5
|
192
200
|
|
193
|
-
|
194
|
-
|
195
|
-
|
201
|
+
- Fix polymorphic options ([pull#263](https://github.com/ridgepole/ridgepole/pull/263))
|
202
|
+
- Fix `--mysql-use-alter` option ([pull#246](https://github.com/ridgepole/ridgepole/pull/264))
|
203
|
+
- Fix Database URI parsing ([pull#265](https://github.com/ridgepole/ridgepole/pull/265))
|
196
204
|
|
197
205
|
### 0.7.4
|
198
206
|
|
199
|
-
|
207
|
+
- Fix `add_foreign_key` options ([issue#250](https://github.com/ridgepole/ridgepole/issues/250))
|
200
208
|
|
201
209
|
### 0.7.3
|
202
210
|
|
203
|
-
|
204
|
-
|
205
|
-
|
211
|
+
- Add `--mysql-change-table-comment option` ([pull#166](https://github.com/ridgepole/ridgepole/pull/166))
|
212
|
+
- Refactoring with RuboCop
|
213
|
+
- Support primary key adding/dropping ([issue#246](https://github.com/ridgepole/ridgepole/issues/246))
|
206
214
|
|
207
215
|
### 0.7.2
|
208
216
|
|
209
|
-
|
217
|
+
- Support Rails 5.2
|
210
218
|
|
211
219
|
### 0.7.1
|
212
220
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
221
|
+
- Remove `--reverse` option
|
222
|
+
- Add `--allow-pk-change` option
|
223
|
+
- Add `--create-table-with-index` option
|
224
|
+
- Add `--mysql-dump-auto-increment` option (`rails >= 5.1`)
|
217
225
|
|
218
226
|
### 0.7.0
|
219
227
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
228
|
+
- Remove Rails 4.x support
|
229
|
+
- Add Rails 5.1 support
|
230
|
+
- Remove `--enable-mysql-awesome` option
|
231
|
+
- Add `--skip-drop-table` option
|
232
|
+
- Support foreign key without name
|
233
|
+
- Support MySQL JSON Type and Generated Columns
|
234
|
+
- Add `--mysql-change-table-options` option
|
235
|
+
- Pass config from env
|
236
|
+
- Fix change fk order
|
237
|
+
- Add `--check-relation-type` option
|
238
|
+
- Add `--skip-column-comment-change` option
|
239
|
+
- Add `--default-bigint-limit` option
|
240
|
+
- Add `--ignore-table-comment` option
|
233
241
|
|
234
242
|
## 0.6
|
235
243
|
|
236
244
|
### 0.6.6
|
237
245
|
|
238
|
-
|
239
|
-
|
240
|
-
|
246
|
+
- Use `t.column` for migration ([pull#114](https://github.com/ridgepole/ridgepole/pull/114))
|
247
|
+
- Support DATABASE_URL format ([pull#118](https://github.com/ridgepole/ridgepole/pull/118))
|
248
|
+
- Add Ruby2.4 CI ([pull#119](https://github.com/ridgepole/ridgepole/pull/119))
|
241
249
|
|
242
250
|
### 0.6.5
|
243
251
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
252
|
+
- Fix rails version `'>= 4.2', '< 6'`
|
253
|
+
- Support new types ([pull#84](https://github.com/ridgepole/ridgepole/pull/84))
|
254
|
+
- Support `default: -> { ... }` ([pull#85](https://github.com/ridgepole/ridgepole/pull/85))
|
255
|
+
- Support DDL Comment (Rails5 only)
|
256
|
+
- Output schema diff when pass `--verbose`
|
257
|
+
- Support composite primary key (Rails5 only / [pull#97](https://github.com/ridgepole/ridgepole/pull/97))
|
250
258
|
|
251
259
|
### 0.6.4
|
252
260
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
261
|
+
- Execute sql using external script ([pull#56](https://github.com/ridgepole/ridgepole/pull/56))
|
262
|
+
- Add `--mysql-use-alter` option
|
263
|
+
- Add `--alter-extra` option
|
264
|
+
- Add `--dump-with-default-fk-name` option
|
265
|
+
- Support `t.index` ([pull#64](https://github.com/ridgepole/ridgepole/pull/64))
|
266
|
+
- Remove migration_comments
|
267
|
+
- Fix foreign key apply order
|
260
268
|
|
261
269
|
### 0.6.3
|
262
270
|
|
263
|
-
|
264
|
-
|
265
|
-
|
271
|
+
- Fix `default` option ([pull#48](https://github.com/ridgepole/ridgepole/pull/48))
|
272
|
+
- Add `--enable-migration-comments` option ([pull#50](https://github.com/ridgepole/ridgepole/pull/50))
|
273
|
+
- Disable `rename_table_indexes`
|
266
274
|
|
267
275
|
### 0.6.1
|
268
276
|
|
269
|
-
|
277
|
+
- Support [PostgreSQL columns](https://github.com/winebarrel/rails/blob/v4.2.1/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L79)
|
270
278
|
|
271
279
|
### 0.6.0
|
272
280
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
+
- Fix rails version `~> 4.2.1`
|
282
|
+
- Disable following libraries support:
|
283
|
+
- activerecord-mysql-unsigned
|
284
|
+
- migration_comments
|
285
|
+
- foreigner
|
286
|
+
- Disable sqlite support
|
287
|
+
- Add PostgreSQL test
|
288
|
+
- Remove `--mysql-awesome-unsigned-pk` option
|
281
289
|
|
282
290
|
## 0.5
|
283
291
|
|
284
292
|
### 0.5.2
|
285
293
|
|
286
|
-
|
287
|
-
|
288
|
-
|
294
|
+
- Add `--enable-mysql-awesome` option ([activerecord-mysql-awesome](https://github.com/kamipo/activerecord-mysql-awesome) is required `>= 0.0.3`)
|
295
|
+
- It is not possible to enable both `--enable-mysql-awesome` and `--enable-migration-comments`, `--enable-mysql-awesome` and `--enable-mysql-unsigned`, `--enable-mysql-awesome` and `--enable-mysql-pkdump`
|
296
|
+
- Fix foreigner version `<= 1.7.1`
|
289
297
|
|
290
298
|
### 0.5.1
|
291
299
|
|
292
|
-
|
293
|
-
|
300
|
+
- Add `--enable-migration-comments` option ([migration_comments](https://github.com/pinnymz/migration_comments) is required)
|
301
|
+
- Fix rails version `< 4.2.0`
|
294
302
|
|
295
303
|
### 0.5.0
|
296
304
|
|
297
|
-
|
305
|
+
- Fix `activerecord-mysql-unsigned` version: `~> 0.3.1`
|
298
306
|
|
299
307
|
## 0.4
|
300
308
|
|
301
309
|
### 0.4.12
|
302
310
|
|
303
|
-
|
311
|
+
- Fix `activerecord-mysql-unsigned` version: `~> 0.2.0`
|
304
312
|
|
305
313
|
### 0.4.11
|
306
314
|
|
307
|
-
|
315
|
+
- Add `--enable-mysql-pkdump` option.
|
308
316
|
|
309
317
|
### 0.4.8
|
310
318
|
|
311
|
-
|
312
|
-
|
319
|
+
- `activerecord-mysql-unsigned` is now optional. Please pass `--enable-mysql-unsigned` after you install [activerecord-mysql-unsigned](https://github.com/waka/activerecord-mysql-unsigned) if you want to use.
|
320
|
+
- Please pass `--enable-foreigner` after you install [foreigner](https://github.com/matthuhiggins/foreigner) if you want to use the foreign key.
|
data/README.md
CHANGED
@@ -9,28 +9,28 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
9
9
|
[![Build Status](https://github.com/ridgepole/ridgepole/workflows/test/badge.svg?branch=1.2)](https://github.com/ridgepole/ridgepole/actions)
|
10
10
|
[![Coverage Status](https://coveralls.io/repos/github/ridgepole/ridgepole/badge.svg?branch=1.2)](https://coveralls.io/github/ridgepole/ridgepole?branch=1.2)
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
*
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
|
25
|
-
* ActiveRecord 6.1
|
26
|
-
|
27
|
-
|
28
|
-
*
|
29
|
-
|
30
|
-
|
31
|
-
*
|
32
|
-
|
33
|
-
|
12
|
+
> [!note]
|
13
|
+
> * ridgepole v2.0.0
|
14
|
+
> * Support Trilogy (cf. https://github.com/ridgepole/ridgepole/pull/447)
|
15
|
+
> * Support Rails 7.1 (cf. https://github.com/ridgepole/ridgepole/pull/441)
|
16
|
+
> * Drop support AcriveRecord 6.0 (cf. https://github.com/ridgepole/ridgepole/pull/440)
|
17
|
+
> * Drop support ActiveRecord 5.x in ridgepole v1.2.0.
|
18
|
+
> * Partitioning is no longer supported in ridgepole v1.1.0.
|
19
|
+
> * ActiveRecord 7.x has some incompatible changes. If you get unintended differences in `datetime` columns consider changing `precision`:
|
20
|
+
> * Add `precision: nil` for columns that previously had no `precision` specified (cf. https://github.com/ridgepole/ridgepole/issues/381)
|
21
|
+
> * Remove `precision: 6` from columns that previously had `precision: 6` specified explicitly (cf. https://github.com/ridgepole/ridgepole/issues/406)
|
22
|
+
> * For ActiveRecord 7.x series, please use AcriveRecord 7.0.2 or higher / Ridgepole 1.0.3 or higher.
|
23
|
+
> * cf. https://github.com/ridgepole/ridgepole/pull/380
|
24
|
+
> * ActiveRecord 6.1 is supported in ridgepole v0.9, but the ActiveRecord dump has been changed, so there is a difference between ActiveRecord 5.x/6.0 format.
|
25
|
+
> * **If you use ActiveRecord 6.1, please modify Schemafile format**.
|
26
|
+
> * cf. https://github.com/ridgepole/ridgepole/pull/323
|
27
|
+
> * `DROP TABLE` is skipped by default in v1.0 and later versions.
|
28
|
+
> * If you want to `DROP TABLE`, please pass `--drop-table`.
|
29
|
+
> * cf. https://github.com/ridgepole/ridgepole/pull/363
|
30
|
+
> * In Rails 7.0, the output of dumper is different from Rails 6.
|
31
|
+
> * cf. https://github.com/rails/rails/issues/43909
|
32
|
+
> * cf. https://github.com/rails/rails/commit/c2a6f618d22cca4d9b7be7fa7652e7aac509350c#diff-55f41513f027a3d219629f475f03c2d1105ca55c5093d691e1b3dc4710c6cc0b
|
33
|
+
> * SQLite does not support.
|
34
34
|
|
35
35
|
## Installation
|
36
36
|
|
@@ -96,6 +96,7 @@ Usage: ridgepole [options]
|
|
96
96
|
--debug
|
97
97
|
--[no-]color
|
98
98
|
-v, --version
|
99
|
+
-h, --help
|
99
100
|
```
|
100
101
|
|
101
102
|
## Usage
|
data/bin/ridgepole
CHANGED
@@ -155,10 +155,14 @@ ARGV.options do |opt|
|
|
155
155
|
opt.on('', '--debug') { options[:debug] = true }
|
156
156
|
opt.on('', '--[no-]color') { |v| options[:color] = v }
|
157
157
|
|
158
|
-
opt.
|
158
|
+
opt.on_tail('-v', '--version') do
|
159
159
|
puts opt.ver
|
160
160
|
exit
|
161
161
|
end
|
162
|
+
opt.on_tail('-h', '--help') do
|
163
|
+
puts opt
|
164
|
+
exit
|
165
|
+
end
|
162
166
|
|
163
167
|
opt.parse!
|
164
168
|
|
data/lib/ridgepole/client.rb
CHANGED
@@ -29,7 +29,7 @@ module Ridgepole
|
|
29
29
|
|
30
30
|
logger.verbose_info('# Parse DSL')
|
31
31
|
expected_definition, expected_execute = @parser.parse(dsl, opts)
|
32
|
-
expected_definition.
|
32
|
+
expected_definition.each_value do |definition|
|
33
33
|
merge_table_options(definition)
|
34
34
|
end
|
35
35
|
logger.verbose_info('# Load tables')
|
data/lib/ridgepole/delta.rb
CHANGED
@@ -250,19 +250,19 @@ create_table(#{table_name.inspect}, #{inspect_options_include_default_proc(optio
|
|
250
250
|
end
|
251
251
|
|
252
252
|
unless (check_constraints = attrs[:check_constraints] || {}).empty?
|
253
|
-
check_constraints.
|
253
|
+
check_constraints.each_value do |check_constraint_attrs|
|
254
254
|
append_add_check_constraint(table_name, check_constraint_attrs, buf, true)
|
255
255
|
end
|
256
256
|
end
|
257
257
|
|
258
258
|
unless (exclusion_constraints = attrs[:exclusion_constraints] || {}).empty?
|
259
|
-
exclusion_constraints.
|
259
|
+
exclusion_constraints.each_value do |exclusion_constraint_attrs|
|
260
260
|
append_add_exclusion_constraint(table_name, exclusion_constraint_attrs, buf, true)
|
261
261
|
end
|
262
262
|
end
|
263
263
|
|
264
264
|
unless (unique_constraints = attrs[:unique_constraints] || {}).empty?
|
265
|
-
unique_constraints.
|
265
|
+
unique_constraints.each_value do |unique_constraint_attrs|
|
266
266
|
append_add_unique_constraint(table_name, unique_constraint_attrs, buf, true)
|
267
267
|
end
|
268
268
|
end
|
@@ -280,7 +280,7 @@ end
|
|
280
280
|
end
|
281
281
|
|
282
282
|
unless (foreign_keys = attrs[:foreign_keys] || {}).empty?
|
283
|
-
foreign_keys.
|
283
|
+
foreign_keys.each_value do |foreign_key_attrs|
|
284
284
|
append_add_foreign_key(table_name, foreign_key_attrs, post_buf_for_fk, @options)
|
285
285
|
end
|
286
286
|
end
|
@@ -308,7 +308,7 @@ drop_table(#{table_name.inspect})
|
|
308
308
|
def append_change_table_options(table_name, table_options, buf)
|
309
309
|
# XXX: MySQL only
|
310
310
|
buf.puts(<<-RUBY)
|
311
|
-
execute "ALTER TABLE #{ActiveRecord::Base.connection.quote_table_name(table_name)} #{table_options}"
|
311
|
+
execute "ALTER TABLE #{ActiveRecord::Base.connection.quote_table_name(table_name)} #{table_options.dump[1..-2]}"
|
312
312
|
RUBY
|
313
313
|
|
314
314
|
buf.puts
|
@@ -506,11 +506,11 @@ remove_index(#{table_name.inspect}, #{target})
|
|
506
506
|
end
|
507
507
|
|
508
508
|
def append_change_foreign_keys(table_name, delta, pre_buf_for_fk, post_buf_for_fk, options)
|
509
|
-
(delta[:delete] || {}).
|
509
|
+
(delta[:delete] || {}).each_value do |attrs|
|
510
510
|
append_remove_foreign_key(table_name, attrs, pre_buf_for_fk, options)
|
511
511
|
end
|
512
512
|
|
513
|
-
(delta[:add] || {}).
|
513
|
+
(delta[:add] || {}).each_value do |attrs|
|
514
514
|
append_add_foreign_key(table_name, attrs, post_buf_for_fk, options)
|
515
515
|
end
|
516
516
|
end
|
@@ -540,11 +540,11 @@ remove_foreign_key(#{table_name.inspect}, #{target})
|
|
540
540
|
end
|
541
541
|
|
542
542
|
def append_change_check_constraints(table_name, delta, buf)
|
543
|
-
(delta[:delete] || {}).
|
543
|
+
(delta[:delete] || {}).each_value do |attrs|
|
544
544
|
append_remove_check_constraint(table_name, attrs, buf)
|
545
545
|
end
|
546
546
|
|
547
|
-
(delta[:add] || {}).
|
547
|
+
(delta[:add] || {}).each_value do |attrs|
|
548
548
|
append_add_check_constraint(table_name, attrs, buf)
|
549
549
|
end
|
550
550
|
end
|
@@ -574,11 +574,11 @@ remove_check_constraint(#{table_name.inspect}, #{expression.inspect}, **#{attrs_
|
|
574
574
|
end
|
575
575
|
|
576
576
|
def append_change_exclusion_constraints(table_name, delta, buf)
|
577
|
-
(delta[:delete] || {}).
|
577
|
+
(delta[:delete] || {}).each_value do |attrs|
|
578
578
|
append_remove_exclusion_constraint(table_name, attrs, buf)
|
579
579
|
end
|
580
580
|
|
581
|
-
(delta[:add] || {}).
|
581
|
+
(delta[:add] || {}).each_value do |attrs|
|
582
582
|
append_add_exclusion_constraint(table_name, attrs, buf)
|
583
583
|
end
|
584
584
|
end
|
@@ -608,11 +608,11 @@ remove_exclusion_constraint(#{table_name.inspect}, #{expression.inspect}, **#{at
|
|
608
608
|
end
|
609
609
|
|
610
610
|
def append_change_unique_constraints(table_name, delta, buf)
|
611
|
-
(delta[:delete] || {}).
|
611
|
+
(delta[:delete] || {}).each_value do |attrs|
|
612
612
|
append_remove_unique_constraint(table_name, attrs, buf)
|
613
613
|
end
|
614
614
|
|
615
|
-
(delta[:add] || {}).
|
615
|
+
(delta[:add] || {}).each_value do |attrs|
|
616
616
|
append_add_unique_constraint(table_name, attrs, buf)
|
617
617
|
end
|
618
618
|
end
|
data/lib/ridgepole/dsl_parser.rb
CHANGED
@@ -34,7 +34,7 @@ module Ridgepole
|
|
34
34
|
return unless attrs[:foreign_keys]
|
35
35
|
return unless attrs[:options][:options]&.include?('ENGINE=InnoDB')
|
36
36
|
|
37
|
-
attrs[:foreign_keys].
|
37
|
+
attrs[:foreign_keys].each_value do |foreign_key_attrs|
|
38
38
|
fk_index = foreign_key_attrs[:options][:column] || "#{foreign_key_attrs[:to_table].singularize}_id"
|
39
39
|
next if attrs[:indices]&.any? { |_k, v| v[:column_name].first == fk_index }
|
40
40
|
# NOTE: For composite primary keys, the first column of the primary key is used as the foreign key index
|
data/lib/ridgepole/version.rb
CHANGED
data/ridgepole.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency 'diffy'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'appraisal', '>= 2.2.0'
|
31
|
+
spec.add_development_dependency 'bigdecimal'
|
31
32
|
spec.add_development_dependency 'bundler'
|
32
33
|
spec.add_development_dependency 'erbh', '>= 0.2.1'
|
33
34
|
spec.add_development_dependency 'hash_modern_inspect', '>= 0.1.1'
|
@@ -36,9 +37,9 @@ Gem::Specification.new do |spec|
|
|
36
37
|
spec.add_development_dependency 'pg'
|
37
38
|
spec.add_development_dependency 'rake'
|
38
39
|
spec.add_development_dependency 'rspec', '>= 3.0.0'
|
39
|
-
spec.add_development_dependency 'rspec-match_fuzzy', '>= 0.
|
40
|
+
spec.add_development_dependency 'rspec-match_fuzzy', '>= 0.2.0'
|
40
41
|
spec.add_development_dependency 'rspec-match_ruby', '>= 0.1.3'
|
41
|
-
spec.add_development_dependency 'rubocop', '1.
|
42
|
+
spec.add_development_dependency 'rubocop', '1.60.2'
|
42
43
|
spec.add_development_dependency 'rubocop-rake', '>= 0.5.1'
|
43
44
|
spec.add_development_dependency 'rubocop-rspec', '>= 2.1.0'
|
44
45
|
spec.add_development_dependency 'simplecov'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 2.2.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: bigdecimal
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
61
75
|
- !ruby/object:Gem::Dependency
|
62
76
|
name: bundler
|
63
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,14 +190,14 @@ dependencies:
|
|
176
190
|
requirements:
|
177
191
|
- - ">="
|
178
192
|
- !ruby/object:Gem::Version
|
179
|
-
version: 0.
|
193
|
+
version: 0.2.0
|
180
194
|
type: :development
|
181
195
|
prerelease: false
|
182
196
|
version_requirements: !ruby/object:Gem::Requirement
|
183
197
|
requirements:
|
184
198
|
- - ">="
|
185
199
|
- !ruby/object:Gem::Version
|
186
|
-
version: 0.
|
200
|
+
version: 0.2.0
|
187
201
|
- !ruby/object:Gem::Dependency
|
188
202
|
name: rspec-match_ruby
|
189
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,14 +218,14 @@ dependencies:
|
|
204
218
|
requirements:
|
205
219
|
- - '='
|
206
220
|
- !ruby/object:Gem::Version
|
207
|
-
version: 1.
|
221
|
+
version: 1.60.2
|
208
222
|
type: :development
|
209
223
|
prerelease: false
|
210
224
|
version_requirements: !ruby/object:Gem::Requirement
|
211
225
|
requirements:
|
212
226
|
- - '='
|
213
227
|
- !ruby/object:Gem::Version
|
214
|
-
version: 1.
|
228
|
+
version: 1.60.2
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
230
|
name: rubocop-rake
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -348,7 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
362
|
- !ruby/object:Gem::Version
|
349
363
|
version: '0'
|
350
364
|
requirements: []
|
351
|
-
rubygems_version: 3.
|
365
|
+
rubygems_version: 3.5.1
|
352
366
|
signing_key:
|
353
367
|
specification_version: 4
|
354
368
|
summary: Ridgepole is a tool to manage DB schema.
|