Open ramusus opened 8 years ago
Yes, currently architect doesn't provide a way to transfer existing data to partitions automatically, so you have to do this by hand. Let's assume that you have a table called logs
which already have some data inside and you want this table to be partitioned. These are the steps to do that:
1) Rename logs
to logs_old
2) Create new empty logs
table, apply architect decorator and run the partition command to create triggers
3) Move all your data from logs_old
to logs
and it will automatically assign data to needed partitions because triggers are already there
I think it's a popular use case, may be it's worth to make a script for this?
For example Django management command or option architect move_data
I agree, an architect command for that is a great idea, unfortunately I currently don't have time to do that, so a pull request is more than welcome.
I have a table with big amount of data inside. Just applied
and created triggers. But my data is still in master table. How I can move it to the children tables in the most efficient way?
I use Django framework