Skip to content

Commit 3391393

Browse files
committed
Add :meta_tables_after_main and deprecate :indexes_after_tables
1 parent 83f7a22 commit 3391393

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
* ...
66

7+
## 0.5.0 2025-07-09
8+
9+
### Added
10+
* Introduced `:meta_tables_after_main` option as a more flexible replacement for `:indexes_after_tables`.
11+
This option places indexes and deferrable constraints after their respective `CREATE TABLE` statements.
12+
13+
### Deprecated
14+
* `:indexes_after_tables` is now deprecated and will be removed in version 1.0.0.
15+
Please migrate to the new `:meta_tables_after_main` option.
16+
717
## 0.4.3 2024-09-22
818

919
* Fix additional regexp warnings from "rake test". [#50](https://github.com/lfittl/activerecord-clean-db-structure/pull/50)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
activerecord-clean-db-structure (0.4.3)
4+
activerecord-clean-db-structure (0.5.0)
55
activerecord (>= 4.2)
66

77
GEM

lib/activerecord-clean-db-structure/clean_dump.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ def clean_options
129129
dump.gsub!(/^(INSERT INTO schema_migrations .*)\n\n/, "\\1\n")
130130
end
131131

132+
# TODO: Remove support for :indexes_after_tables in version 1.0.0
133+
if options[:indexes_after_tables]
134+
warn "[DEPRECATION] The :indexes_after_tables option is deprecated and will be removed in version 1.0.0. Use :meta_tables_after_main instead."
135+
end
136+
132137
if options[:indexes_after_tables] || options[:meta_tables_after_main]
133138
# Extract indexes
134139
indexes =

0 commit comments

Comments
 (0)