Skip to content

Conversation

@rgraff
Copy link
Contributor

@rgraff rgraff commented Dec 10, 2025

Description

Adds a create_table_options option to the DSL that is used by migration generator to pass the option to table/2. Note that the option's name is options and it is a string.

### resource defintion
postgres do
  table "posts"
  create_table_options "PARTITION BY RANGE (inserted_at)"
end

### migration looks like
create table(:posts, options: "PARTITION BY RANGE (inserted_at)") do
   ...
end

Also includes some documentation for partitioned tables. Note that partitioned tables can only be created with CREATE TABLE and not ALTER TABLE, so this change is the only practical way to generate a partitioned table with the generator.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@rgraff rgraff force-pushed the create_table_options_for_partitioned_tables branch from 0174e2a to a6df013 Compare December 10, 2025 02:28
@rgraff rgraff force-pushed the create_table_options_for_partitioned_tables branch from a6df013 to ce945c0 Compare December 10, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants