Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails model class cannot be defined with a partition with sub-partitions #91

Open
tomer-zadara opened this issue Dec 30, 2024 · 2 comments

Comments

@tomer-zadara
Copy link

For example, setting the model class with range_partition_by { "(report_date::date)" }
I cannot set sub-partitions of hash kind, although I can create these partitions and sub partitions using:
create_range_partition_of
:main_table,
name: main_table_partition,
start_range: "#{current_year}-#{current_month}-01",
end_range: "#{current_year}-#{current_month}-#{current_month_last_day}",
partition_type: :hash,
partition_key: :org_id

and then create sub-partitions:
10.times do |i|
create_hash_partition_of
main_table_partition,
name: "#{main_table_partition}_org#{i}".to_sym,
modulus: 10,
remainder: i
end

@rkrage
Copy link
Owner

rkrage commented Jan 4, 2025

Honestly, I'm not super familiar with how sub-partitioning works in this gem. That was implemented by @webandtech in #54

Can you provide a bit more info on what error you're seeing?

@tomer-zadara
Copy link
Author

It's not really about the error, more about the inability to configure a rails model with a partition kind, which has a configuration for sub-partitions.

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

No branches or pull requests

2 participants