ridgepole 0.9.6 → 1.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 +9 -1
- data/.simplecov +1 -1
- data/Appraisals +4 -0
- data/CHANGELOG.md +251 -0
- data/README.md +45 -155
- data/bin/ridgepole +83 -85
- data/docker-compose.yml +26 -18
- data/gemfiles/activerecord_7.0.gemfile +7 -0
- data/lib/ridgepole/client.rb +5 -0
- data/lib/ridgepole/delta.rb +22 -0
- data/lib/ridgepole/diff.rb +57 -3
- data/lib/ridgepole/dsl_parser/context.rb +16 -0
- data/lib/ridgepole/execute_expander.rb +4 -1
- data/lib/ridgepole/ext/abstract_adapter/partition_definition.rb +19 -0
- data/lib/ridgepole/ext/abstract_adapter/partition_options.rb +34 -0
- data/lib/ridgepole/ext/abstract_adapter/partitioning.rb +40 -0
- data/lib/ridgepole/ext/abstract_mysql_adapter/partitioning.rb +71 -0
- data/lib/ridgepole/ext/abstract_mysql_adapter/schema_creation.rb +46 -0
- data/lib/ridgepole/ext/postgresql_adapter/partitioning.rb +126 -0
- data/lib/ridgepole/ext/schema_dumper.rb +24 -0
- data/lib/ridgepole/external_sql_executer.rb +11 -13
- data/lib/ridgepole/version.rb +1 -1
- data/lib/ridgepole.rb +3 -0
- data/ridgepole.gemspec +4 -3
- metadata +19 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f2be3783ec61f227ecfe28f6886bd190b3c0d842b70a525c0e875a94b6203da
|
4
|
+
data.tar.gz: 813db605ad690e1e1fc67c35d43c8b8d5ea3f176be5e8231ebf729a4d0e59b39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5298fb7f40541eaa1165119bda5bfad7c97ef0ab32989271abdf58209fb6e8302a0ed48100cd7d8e7b3d9baf38e94b654af7fa8437e6d3d84a0e82023a0edf0f
|
7
|
+
data.tar.gz: 6cd5e1415f034bcc34b803c509c1c3a6603117b008202b97525567a60824c35290871b33e8133fa2bf61e8eb37323c79e2926666d195d35a8b4c35884d1a7193
|
data/.rubocop.yml
CHANGED
@@ -3,7 +3,7 @@ AllCops:
|
|
3
3
|
- "gemfiles/**/*"
|
4
4
|
- "omnibus-ridgepole/**/*"
|
5
5
|
- "vendor/bundle/**/*"
|
6
|
-
TargetRubyVersion: 2.
|
6
|
+
TargetRubyVersion: 2.5
|
7
7
|
NewCops: enable
|
8
8
|
Bundler/OrderedGems:
|
9
9
|
Include:
|
@@ -24,10 +24,18 @@ Layout/LineLength:
|
|
24
24
|
Enabled: false
|
25
25
|
Metrics/MethodLength:
|
26
26
|
Enabled: false
|
27
|
+
Metrics/ModuleLength:
|
28
|
+
Max: 106
|
27
29
|
Metrics/ParameterLists:
|
28
30
|
Enabled: false
|
29
31
|
Metrics/PerceivedComplexity:
|
30
32
|
Enabled: false
|
33
|
+
Naming/MethodName:
|
34
|
+
Exclude:
|
35
|
+
- "lib/ridgepole/ext/abstract_mysql_adapter/schema_creation.rb"
|
36
|
+
Naming/MethodParameterName:
|
37
|
+
Exclude:
|
38
|
+
- "lib/ridgepole/ext/abstract_mysql_adapter/schema_creation.rb"
|
31
39
|
Style/Documentation:
|
32
40
|
Enabled: false
|
33
41
|
Style/GuardClause:
|
data/.simplecov
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,251 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 1.0
|
4
|
+
|
5
|
+
### 1.0.2 (Unreleased)
|
6
|
+
|
7
|
+
* Add support for partitioning ([pull#374](https://github.com/ridgepole/ridgepole/pull/374))
|
8
|
+
* Suppress warning of table option differences ([pull#378](https://github.com/ridgepole/ridgepole/pull/378))
|
9
|
+
|
10
|
+
### 1.0.1 (2022/01/15)
|
11
|
+
|
12
|
+
* Fix code for RuboCop 1.24.1
|
13
|
+
* Fix PostgreSQL spec for Rails 7.0
|
14
|
+
* Update ERBh gem (for development)
|
15
|
+
|
16
|
+
### 1.0.0 (2021/12/19)
|
17
|
+
|
18
|
+
* Support Rails 7.0
|
19
|
+
* `--skip-drop-table` by default ([pull#363](https://github.com/ridgepole/ridgepole/pull/363))
|
20
|
+
|
21
|
+
## 0.9
|
22
|
+
|
23
|
+
### 0.9.6
|
24
|
+
|
25
|
+
* Fix malformed error ([pull#362](https://github.com/ridgepole/ridgepole/pull/362))
|
26
|
+
|
27
|
+
### 0.9.5
|
28
|
+
|
29
|
+
* Call `super` in `disable_table_options.rb` ([pull#357](https://github.com/ridgepole/ridgepole/pull/357))
|
30
|
+
|
31
|
+
### 0.9.4
|
32
|
+
|
33
|
+
* Fix `--alter-extra` option for unique index ([pull#356](https://github.com/ridgepole/ridgepole/pull/356))
|
34
|
+
|
35
|
+
### 0.9.3
|
36
|
+
|
37
|
+
* Fix `limit` option for `t.integer` ([pull#354](https://github.com/ridgepole/ridgepole/pull/354))
|
38
|
+
|
39
|
+
### 0.9.2
|
40
|
+
|
41
|
+
* Support `t.column index option` ([pull#353](https://github.com/ridgepole/ridgepole/pull/353))
|
42
|
+
|
43
|
+
### 0.9.1
|
44
|
+
|
45
|
+
* Support `t.foreign_key` ([pull#348](https://github.com/ridgepole/ridgepole/pull/348))
|
46
|
+
|
47
|
+
### 0.9.0
|
48
|
+
|
49
|
+
* Remove `--mysql-use-alter` option ([pull#330](https://github.com/ridgepole/ridgepole/pull/330))
|
50
|
+
* Add `--table-hash-options` option ([pull#331](https://github.com/ridgepole/ridgepole/pull/331))
|
51
|
+
* Support Rails 6.1 ([pull#323](https://github.com/ridgepole/ridgepole/pull/323))
|
52
|
+
* Disable Rails 5.0 support ([pull#335](https://github.com/ridgepole/ridgepole/pull/335))
|
53
|
+
* Fix PK AUTO_INCREMENT change bug ([pull#334](https://github.com/ridgepole/ridgepole/pull/334))
|
54
|
+
|
55
|
+
## 0.8
|
56
|
+
|
57
|
+
### 0.8.13
|
58
|
+
|
59
|
+
* Support `serial` and `bigserial` column types ([pull#321](https://github.com/ridgepole/ridgepole/pull/321))
|
60
|
+
|
61
|
+
### 0.8.12
|
62
|
+
|
63
|
+
* Pluralize column specified by `references` ([pull#317](https://github.com/ridgepole/ridgepole/pull/317))
|
64
|
+
|
65
|
+
### 0.8.11
|
66
|
+
|
67
|
+
* Fix FK index check support multiple PK ([pull#315](https://github.com/ridgepole/ridgepole/pull/315))
|
68
|
+
* Support t.reference() foreign_key option ([pull#316](https://github.com/ridgepole/ridgepole/pull/316))
|
69
|
+
|
70
|
+
### 0.8.10
|
71
|
+
|
72
|
+
* Raise an error if an InnoDB column has a foreign key but no index ([pull#310](https://github.com/ridgepole/ridgepole/pull/310))
|
73
|
+
|
74
|
+
### 0.8.9
|
75
|
+
|
76
|
+
* Fix unexpected differences on text types and blob types on Rails 6 ([pull#306](https://github.com/ridgepole/ridgepole/pull/306))
|
77
|
+
* Fix unexpected warning when a foreign key is added on the primary key ([pull#307](https://github.com/ridgepole/ridgepole/pull/307))
|
78
|
+
|
79
|
+
### 0.8.8
|
80
|
+
|
81
|
+
* Fix keyword arguments warnings in Ruby 2.7 ([pull#303](https://github.com/ridgepole/ridgepole/pull/303))
|
82
|
+
|
83
|
+
### 0.8.7
|
84
|
+
|
85
|
+
* Support `require_relative` ([pull#298](https://github.com/ridgepole/ridgepole/pull/298))
|
86
|
+
|
87
|
+
### 0.8.6
|
88
|
+
|
89
|
+
* Support multiple databases feature ([pull#297](https://github.com/ridgepole/ridgepole/pull/297))
|
90
|
+
|
91
|
+
### 0.8.5
|
92
|
+
|
93
|
+
* Improve warning message on table options ([pull#291](https://github.com/ridgepole/ridgepole/pull/291))
|
94
|
+
|
95
|
+
### 0.8.4
|
96
|
+
|
97
|
+
* 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))
|
98
|
+
|
99
|
+
### 0.8.3
|
100
|
+
|
101
|
+
* Fix "topological sort failed" error ([pull#287](https://github.com/ridgepole/ridgepole/pull/287))
|
102
|
+
|
103
|
+
### 0.8.2
|
104
|
+
|
105
|
+
* Support `postgres://` schema ([pull#285](https://github.com/ridgepole/ridgepole/pull/285))
|
106
|
+
|
107
|
+
### 0.8.1
|
108
|
+
|
109
|
+
* Drop tables in an order considering foreign key constraints ([pull#284](https://github.com/ridgepole/ridgepole/pull/284))
|
110
|
+
|
111
|
+
### 0.8.0
|
112
|
+
|
113
|
+
* Support Rails 6.0
|
114
|
+
|
115
|
+
## 0.7
|
116
|
+
|
117
|
+
### 0.7.8
|
118
|
+
|
119
|
+
* Fix for `add_foreign_key(..., column: ,,,)` ([pull#278](https://github.com/ridgepole/ridgepole/pull/278))
|
120
|
+
|
121
|
+
### 0.7.7
|
122
|
+
|
123
|
+
* Support URI query string ([pull#273](https://github.com/ridgepole/ridgepole/pull/273))
|
124
|
+
|
125
|
+
### 0.7.6
|
126
|
+
|
127
|
+
* Fix database url check ([pull#266](https://github.com/ridgepole/ridgepole/pull/266))
|
128
|
+
* Add ignore option ([pull#267](https://github.com/ridgepole/ridgepole/pull/267))
|
129
|
+
|
130
|
+
### 0.7.5
|
131
|
+
|
132
|
+
* Fix polymorphic options ([pull#263](https://github.com/ridgepole/ridgepole/pull/263))
|
133
|
+
* Fix `--mysql-use-alter` option ([pull#246](https://github.com/ridgepole/ridgepole/pull/264))
|
134
|
+
* Fix Database URI parsing ([pull#265](https://github.com/ridgepole/ridgepole/pull/265))
|
135
|
+
|
136
|
+
### 0.7.4
|
137
|
+
|
138
|
+
* Fix `add_foreign_key` options ([issue#250](https://github.com/ridgepole/ridgepole/issues/250))
|
139
|
+
|
140
|
+
### 0.7.3
|
141
|
+
|
142
|
+
* Add `--mysql-change-table-comment option` ([pull#166](https://github.com/ridgepole/ridgepole/pull/166))
|
143
|
+
* Refactoring with RuboCop
|
144
|
+
* Support primary key adding/dropping ([issue#246](https://github.com/ridgepole/ridgepole/issues/246))
|
145
|
+
|
146
|
+
### 0.7.2
|
147
|
+
|
148
|
+
* Support Rails 5.2
|
149
|
+
|
150
|
+
### 0.7.1
|
151
|
+
|
152
|
+
* Remove `--reverse` option
|
153
|
+
* Add `--allow-pk-change` option
|
154
|
+
* Add `--create-table-with-index` option
|
155
|
+
* Add `--mysql-dump-auto-increment` option (`rails >= 5.1`)
|
156
|
+
|
157
|
+
### 0.7.0
|
158
|
+
|
159
|
+
* Remove Rails 4.x support
|
160
|
+
* Add Rails 5.1 support
|
161
|
+
* Remove `--enable-mysql-awesome` option
|
162
|
+
* Add `--skip-drop-table` option
|
163
|
+
* Support foreign key without name
|
164
|
+
* Support MySQL JSON Type and Generated Columns
|
165
|
+
* Add `--mysql-change-table-options` option
|
166
|
+
* Pass config from env
|
167
|
+
* Fix change fk order
|
168
|
+
* Add `--check-relation-type` option
|
169
|
+
* Add `--skip-column-comment-change` option
|
170
|
+
* Add `--default-bigint-limit` option
|
171
|
+
* Add `--ignore-table-comment` option
|
172
|
+
|
173
|
+
## 0.6
|
174
|
+
|
175
|
+
### 0.6.6
|
176
|
+
|
177
|
+
* Use `t.column` for migration ([pull#114](https://github.com/ridgepole/ridgepole/pull/114))
|
178
|
+
* Support DATABASE_URL format ([pull#118](https://github.com/ridgepole/ridgepole/pull/118))
|
179
|
+
* Add Ruby2.4 CI ([pull#119](https://github.com/ridgepole/ridgepole/pull/119))
|
180
|
+
|
181
|
+
### 0.6.5
|
182
|
+
|
183
|
+
* Fix rails version `'>= 4.2', '< 6'`
|
184
|
+
* Support new types ([pull#84](https://github.com/ridgepole/ridgepole/pull/84))
|
185
|
+
* Support `default: -> { ... }` ([pull#85](https://github.com/ridgepole/ridgepole/pull/85))
|
186
|
+
* Support DDL Comment (Rails5 only)
|
187
|
+
* Output schema diff when pass `--verbose`
|
188
|
+
* Support composite primary key (Rails5 only / [pull#97](https://github.com/ridgepole/ridgepole/pull/97))
|
189
|
+
|
190
|
+
### 0.6.4
|
191
|
+
|
192
|
+
* Execute sql using external script ([pull#56](https://github.com/ridgepole/ridgepole/pull/56))
|
193
|
+
* Add `--mysql-use-alter` option
|
194
|
+
* Add `--alter-extra` option
|
195
|
+
* Add `--dump-with-default-fk-name` option
|
196
|
+
* Support `t.index` ([pull#64](https://github.com/ridgepole/ridgepole/pull/64))
|
197
|
+
* Remove migration_comments
|
198
|
+
* Fix foreign key apply order
|
199
|
+
|
200
|
+
### 0.6.3
|
201
|
+
|
202
|
+
* Fix `default` option ([pull#48](https://github.com/ridgepole/ridgepole/pull/48))
|
203
|
+
* Add `--enable-migration-comments` option ([pull#50](https://github.com/ridgepole/ridgepole/pull/50))
|
204
|
+
* Disable `rename_table_indexes`
|
205
|
+
|
206
|
+
### 0.6.1
|
207
|
+
|
208
|
+
* Support [PostgreSQL columns](https://github.com/winebarrel/rails/blob/v4.2.1/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L79)
|
209
|
+
|
210
|
+
### 0.6.0
|
211
|
+
|
212
|
+
* Fix rails version `~> 4.2.1`
|
213
|
+
* Disable following libraries support:
|
214
|
+
* activerecord-mysql-unsigned
|
215
|
+
* migration_comments
|
216
|
+
* foreigner
|
217
|
+
* Disable sqlite support
|
218
|
+
* Add PostgreSQL test
|
219
|
+
* Remove `--mysql-awesome-unsigned-pk` option
|
220
|
+
|
221
|
+
## 0.5
|
222
|
+
|
223
|
+
### 0.5.2
|
224
|
+
|
225
|
+
* Add `--enable-mysql-awesome` option ([activerecord-mysql-awesome](https://github.com/kamipo/activerecord-mysql-awesome) is required `>= 0.0.3`)
|
226
|
+
* 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`
|
227
|
+
* Fix foreigner version `<= 1.7.1`
|
228
|
+
|
229
|
+
### 0.5.1
|
230
|
+
|
231
|
+
* Add `--enable-migration-comments` option ([migration_comments](https://github.com/pinnymz/migration_comments) is required)
|
232
|
+
* Fix rails version `< 4.2.0`
|
233
|
+
|
234
|
+
### 0.5.0
|
235
|
+
|
236
|
+
* Fix `activerecord-mysql-unsigned` version: `~> 0.3.1`
|
237
|
+
|
238
|
+
## 0.4
|
239
|
+
|
240
|
+
### 0.4.12
|
241
|
+
|
242
|
+
* Fix `activerecord-mysql-unsigned` version: `~> 0.2.0`
|
243
|
+
|
244
|
+
### 0.4.11
|
245
|
+
|
246
|
+
* Add `--enable-mysql-pkdump` option.
|
247
|
+
|
248
|
+
### 0.4.8
|
249
|
+
|
250
|
+
* `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.
|
251
|
+
* 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
@@ -6,156 +6,20 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
6
6
|
(like Chef/Puppet)
|
7
7
|
|
8
8
|
[![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](http://badge.fury.io/rb/ridgepole)
|
9
|
-
[![Build Status](https://github.com/
|
10
|
-
[![Coverage Status](https://coveralls.io/repos/github/
|
11
|
-
|
12
|
-
<details><summary>ChangeLog</summary>
|
13
|
-
|
14
|
-
* `>= 0.4.8`
|
15
|
-
* `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.
|
16
|
-
* Please pass `--enable-foreigner` after you install [foreigner](https://github.com/matthuhiggins/foreigner) if you want to use the foreign key.
|
17
|
-
* `>= 0.4.11`
|
18
|
-
* Add `--enable-mysql-pkdump` option.
|
19
|
-
* `>= 0.4.12`
|
20
|
-
* Fix `activerecord-mysql-unsigned` version: `~> 0.2.0`
|
21
|
-
* `>= 0.5.0`
|
22
|
-
* Fix `activerecord-mysql-unsigned` version: `~> 0.3.1`
|
23
|
-
* `>= 0.5.1`
|
24
|
-
* Add `--enable-migration-comments` option ([migration_comments](https://github.com/pinnymz/migration_comments) is required)
|
25
|
-
* Fix rails version `< 4.2.0`
|
26
|
-
* `>= 0.5.2`
|
27
|
-
* Add `--enable-mysql-awesome` option ([activerecord-mysql-awesome](https://github.com/kamipo/activerecord-mysql-awesome) is required `>= 0.0.3`)
|
28
|
-
* 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`
|
29
|
-
* Fix foreigner version `<= 1.7.1`
|
30
|
-
* `>= 0.6.0`
|
31
|
-
* Fix rails version `~> 4.2.1`
|
32
|
-
* Disable following libraries support:
|
33
|
-
* activerecord-mysql-unsigned
|
34
|
-
* migration_comments
|
35
|
-
* foreigner
|
36
|
-
* Disable sqlite support
|
37
|
-
* Add PostgreSQL test
|
38
|
-
* Remove `--mysql-awesome-unsigned-pk` option
|
39
|
-
* `>= 0.6.1`
|
40
|
-
* Support [PostgreSQL columns](https://github.com/winebarrel/rails/blob/v4.2.1/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L79)
|
41
|
-
* `>= 0.6.3`
|
42
|
-
* Fix `default` option ([pull#48](https://github.com/winebarrel/ridgepole/pull/48))
|
43
|
-
* Add `--enable-migration-comments` option ([pull#50](https://github.com/winebarrel/ridgepole/pull/50))
|
44
|
-
* Disable `rename_table_indexes`
|
45
|
-
* `>= 0.6.4`
|
46
|
-
* Execute sql using external script ([pull#56](https://github.com/winebarrel/ridgepole/pull/56))
|
47
|
-
* Add `--mysql-use-alter` option
|
48
|
-
* Add `--alter-extra` option
|
49
|
-
* Add `--dump-with-default-fk-name` option
|
50
|
-
* Support `t.index` ([pull#64](https://github.com/winebarrel/ridgepole/pull/64))
|
51
|
-
* Remove migration_comments
|
52
|
-
* Fix foreign key apply order
|
53
|
-
* `>= 0.6.5`
|
54
|
-
* Fix rails version `'>= 4.2', '< 6'`
|
55
|
-
* Support new types ([pull#84](https://github.com/winebarrel/ridgepole/pull/84))
|
56
|
-
* Support `default: -> { ... }` ([pull#85](https://github.com/winebarrel/ridgepole/pull/85))
|
57
|
-
* Support DDL Comment (Rails5 only)
|
58
|
-
* Output schema diff when pass `--verbose`
|
59
|
-
* Support composite primary key (Rails5 only / [pull#97](https://github.com/winebarrel/ridgepole/pull/97))
|
60
|
-
* `>= 0.6.6`
|
61
|
-
* Use `t.column` for migration ([pull#114](https://github.com/winebarrel/ridgepole/pull/114))
|
62
|
-
* Support DATABASE_URL format ([pull#118](https://github.com/winebarrel/ridgepole/pull/118))
|
63
|
-
* Add Ruby2.4 CI ([pull#119](https://github.com/winebarrel/ridgepole/pull/119))
|
64
|
-
* `>= 0.7.0`
|
65
|
-
* Remove Rails 4.x support
|
66
|
-
* Add Rails 5.1 support
|
67
|
-
* Remove `--enable-mysql-awesome` option
|
68
|
-
* Add `--skip-drop-table` option
|
69
|
-
* Support foreign key without name
|
70
|
-
* Support MySQL JSON Type and Generated Columns
|
71
|
-
* Add `--mysql-change-table-options` option
|
72
|
-
* Pass config from env
|
73
|
-
* Fix change fk order
|
74
|
-
* Add `--check-relation-type` option
|
75
|
-
* Add `--skip-column-comment-change` option
|
76
|
-
* Add `--default-bigint-limit` option
|
77
|
-
* Add `--ignore-table-comment` option
|
78
|
-
* `>= 0.7.1`
|
79
|
-
* Remove `--reverse` option
|
80
|
-
* Add `--allow-pk-change` option
|
81
|
-
* Add `--create-table-with-index` option
|
82
|
-
* Add `--mysql-dump-auto-increment` option (`rails >= 5.1`)
|
83
|
-
* `>= 0.7.2`
|
84
|
-
* Support Rails 5.2
|
85
|
-
* `>= 0.7.3`
|
86
|
-
* Add `--mysql-change-table-comment option` ([pull#166](https://github.com/winebarrel/ridgepole/pull/166))
|
87
|
-
* Refactoring with RuboCop
|
88
|
-
* Support primary key adding/dropping ([issue#246](https://github.com/winebarrel/ridgepole/issues/246))
|
89
|
-
* `>= 0.7.4`
|
90
|
-
* Fix `add_foreign_key` options ([issue#250](https://github.com/winebarrel/ridgepole/issues/250))
|
91
|
-
* `>= 0.7.5`
|
92
|
-
* Fix polymorphic options ([pull#263](https://github.com/winebarrel/ridgepole/pull/263))
|
93
|
-
* Fix `--mysql-use-alter` option ([pull#246](https://github.com/winebarrel/ridgepole/pull/264))
|
94
|
-
* Fix Database URI parsing ([pull#265](https://github.com/winebarrel/ridgepole/pull/265))
|
95
|
-
* `>= 0.7.6`
|
96
|
-
* Fix database url check ([pull#266](https://github.com/winebarrel/ridgepole/pull/266))
|
97
|
-
* Add ignore option ([pull#267](https://github.com/winebarrel/ridgepole/pull/267))
|
98
|
-
* `>= 0.7.7`
|
99
|
-
* Support URI query string ([pull#273](https://github.com/winebarrel/ridgepole/pull/273))
|
100
|
-
* `>= 0.7.8`
|
101
|
-
* Fix for `add_foreign_key(..., column: ,,,)` ([pull#278](https://github.com/winebarrel/ridgepole/pull/278))
|
102
|
-
* `>= 0.8.0`
|
103
|
-
* Support Rails 6.0
|
104
|
-
* `>= 0.8.1`
|
105
|
-
* Drop tables in an order considering foreign key constraints ([pull#284](https://github.com/winebarrel/ridgepole/pull/284))
|
106
|
-
* `>= 0.8.2`
|
107
|
-
* Support `postgres://` schema ([pull#285](https://github.com/winebarrel/ridgepole/pull/285))
|
108
|
-
* `>= 0.8.3`
|
109
|
-
* Fix "topological sort failed" error ([pull#287](https://github.com/winebarrel/ridgepole/pull/287))
|
110
|
-
* `>= 0.8.4`
|
111
|
-
* 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/winebarrel/ridgepole/pull/290))
|
112
|
-
* `>= 0.8.5`
|
113
|
-
* Improve warning message on table options ([pull#291](https://github.com/winebarrel/ridgepole/pull/291))
|
114
|
-
* `>= 0.8.6`
|
115
|
-
* Support multiple databases feature ([pull#297](https://github.com/winebarrel/ridgepole/pull/297))
|
116
|
-
* `>= 0.8.7`
|
117
|
-
* Support `require_relative` ([pull#298](https://github.com/winebarrel/ridgepole/pull/298))
|
118
|
-
* `>= 0.8.8`
|
119
|
-
* Fix keyword arguments warnings in Ruby 2.7 ([pull#303](https://github.com/winebarrel/ridgepole/pull/303))
|
120
|
-
* `>= 0.8.9`
|
121
|
-
* Fix unexpected differences on text types and blob types on Rails 6 ([pull#306](https://github.com/winebarrel/ridgepole/pull/306))
|
122
|
-
* Fix unexpected warning when a foreign key is added on the primary key ([pull#307](https://github.com/winebarrel/ridgepole/pull/307))
|
123
|
-
* `>= 0.8.10`
|
124
|
-
* Raise an error if an InnoDB column has a foreign key but no index ([pull#310](https://github.com/winebarrel/ridgepole/pull/310))
|
125
|
-
* `>= 0.8.11`
|
126
|
-
* Fix FK index check support multiple PK ([pull#315](https://github.com/winebarrel/ridgepole/pull/315))
|
127
|
-
* Support t.reference() foreign_key option ([pull#316](https://github.com/winebarrel/ridgepole/pull/316))
|
128
|
-
* `>= 0.8.12`
|
129
|
-
* Pluralize column specified by `references` ([pull#317](https://github.com/winebarrel/ridgepole/pull/317))
|
130
|
-
* `>= 0.8.13`
|
131
|
-
* Support `serial` and `bigserial` column types ([pull#321](https://github.com/winebarrel/ridgepole/pull/321))
|
132
|
-
* `>= 0.9.0`
|
133
|
-
* Remove `--mysql-use-alter` option ([pull#330](https://github.com/winebarrel/ridgepole/pull/330))
|
134
|
-
* Add `--table-hash-options` option ([pull#331](https://github.com/winebarrel/ridgepole/pull/331))
|
135
|
-
* Support Rails 6.1 ([pull#323](https://github.com/winebarrel/ridgepole/pull/323))
|
136
|
-
* Disable Rails 5.0 support ([pull#335](https://github.com/winebarrel/ridgepole/pull/335))
|
137
|
-
* Fix PK AUTO_INCREMENT change bug ([pull#334](https://github.com/winebarrel/ridgepole/pull/334))
|
138
|
-
* `>= 0.9.1`
|
139
|
-
* Support `t.foreign_key` ([pull#348](https://github.com/winebarrel/ridgepole/pull/348))
|
140
|
-
* `>= 0.9.2`
|
141
|
-
* Support `t.column index option` ([pull#353](https://github.com/winebarrel/ridgepole/pull/353))
|
142
|
-
* `>= 0.9.3`
|
143
|
-
* Fix `limit` option for `t.integer` ([pull#354](https://github.com/winebarrel/ridgepole/pull/354))
|
144
|
-
* `>= 0.9.4`
|
145
|
-
* Fix `--alter-extra` option for unique index ([pull#356](https://github.com/winebarrel/ridgepole/pull/356))
|
146
|
-
* `>= 0.9.5`
|
147
|
-
* Call `super` in `disable_table_options.rb` ([pull#357](https://github.com/winebarrel/ridgepole/pull/357))
|
148
|
-
* `>= 0.9.6`
|
149
|
-
* Fix malformed error ([pull#362](https://github.com/winebarrel/ridgepole/pull/362))
|
150
|
-
</details>
|
9
|
+
[![Build Status](https://github.com/ridgepole/ridgepole/workflows/test/badge.svg?branch=1.0)](https://github.com/ridgepole/ridgepole/actions)
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/github/ridgepole/ridgepole/badge.svg?branch=1.0)](https://coveralls.io/github/ridgepole/ridgepole?branch=1.0)
|
151
11
|
|
152
12
|
**Notice**
|
153
13
|
|
154
|
-
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.
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
14
|
+
* 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.
|
15
|
+
* **If you use ActiveRecord 6.1, please modify Schemafile format**.
|
16
|
+
* cf. https://github.com/ridgepole/ridgepole/pull/323
|
17
|
+
* `DROP TABLE` is skipped by default in v1.0 and later versions.
|
18
|
+
* If you want to `DROP TABLE`, please pass `--drop-table`.
|
19
|
+
* cf. https://github.com/ridgepole/ridgepole/pull/363
|
20
|
+
* In Rails 7.0, the output of dumper is different from Rails 6.
|
21
|
+
* cf. https://github.com/rails/rails/issues/43909
|
22
|
+
* cf. https://github.com/rails/rails/commit/c2a6f618d22cca4d9b7be7fa7652e7aac509350c#diff-55f41513f027a3d219629f475f03c2d1105ca55c5093d691e1b3dc4710c6cc0b
|
159
23
|
|
160
24
|
## Installation
|
161
25
|
|
@@ -206,7 +70,7 @@ Usage: ridgepole [options]
|
|
206
70
|
--dump-without-table-options
|
207
71
|
--dump-with-default-fk-name
|
208
72
|
--index-removed-drop-column
|
209
|
-
--
|
73
|
+
--drop-table
|
210
74
|
--mysql-change-table-options
|
211
75
|
--mysql-change-table-comment
|
212
76
|
--check-relation-type DEF_PK
|
@@ -437,18 +301,44 @@ Apply `Schemafile`
|
|
437
301
|
...
|
438
302
|
```
|
439
303
|
|
304
|
+
## Partitioning
|
305
|
+
|
306
|
+
**Notice:** PostgreSQL `PARTITION BY` must be specified with the create_table option.
|
307
|
+
|
308
|
+
### List Partitioning
|
309
|
+
|
310
|
+
```ruby
|
311
|
+
create_table "articles", force: :cascade, options: "PARTITION BY LIST(id)" do |t|
|
312
|
+
end
|
313
|
+
|
314
|
+
add_partition("articles", :list, :id, partition_definitions: [{ name: 'p0', values: { in: [0,1,2] } }, { name: 'p1', values: { in: [3,4,5] } }])
|
315
|
+
```
|
316
|
+
|
317
|
+
### Range Partitioning
|
318
|
+
|
319
|
+
```ruby
|
320
|
+
create_table "articles", force: :cascade, options: "PARTITION BY RANGE(id)" do |t|
|
321
|
+
end
|
322
|
+
|
323
|
+
# postgresql
|
324
|
+
add_partition("articles", :range, :id, partition_definitions: [{ name: 'p0', values: { from: 'MINVALUE', to: 5 }}, { name: 'p1', values: { from: 5, to: 10 } }])
|
325
|
+
# mysql
|
326
|
+
add_partition("articles", :range, :id, partition_definitions: [{ name: 'p0', values: { to: 5 }}, { name: 'p1', values: { to: 10 } }])
|
327
|
+
```
|
328
|
+
|
440
329
|
## Run tests
|
441
330
|
|
331
|
+
|
442
332
|
```sh
|
443
333
|
docker-compose up -d
|
444
334
|
bundle install
|
445
335
|
bundle exec appraisal install
|
446
|
-
bundle exec appraisal activerecord-
|
447
|
-
# POSTGRESQL=1 bundle exec appraisal activerecord-
|
448
|
-
# MYSQL57=1 bundle exec appraisal activerecord-
|
336
|
+
bundle exec appraisal activerecord-7.0 rake
|
337
|
+
# POSTGRESQL=1 bundle exec appraisal activerecord-7.0 rake
|
338
|
+
# MYSQL57=1 bundle exec appraisal activerecord-7.0 rake
|
449
339
|
```
|
450
340
|
|
451
|
-
**Notice:** mysql-client/postgresql-client is required.
|
341
|
+
**Notice:** Ruby 2.6 or above/mysql-client/postgresql-client is required.
|
452
342
|
|
453
343
|
## Demo
|
454
344
|
|
@@ -457,6 +347,6 @@ bundle exec appraisal activerecord-5.1 rake
|
|
457
347
|
|
458
348
|
## Example project
|
459
349
|
|
460
|
-
* https://github.com/
|
461
|
-
* https://github.com/
|
462
|
-
* https://github.com/
|
350
|
+
* https://github.com/ridgepole/ridgepole-example
|
351
|
+
* https://github.com/ridgepole/ridgepole-example/pull/1
|
352
|
+
* https://github.com/ridgepole/ridgepole-example/pull/2
|