set -ex

psql -d evantest -c "create table test1(id int primary key) partition by range(id);";

for idx in $(seq 2 1000);
do
    psql -d evantest -c "create table test$idx(id int primary key) partition by range(id);"
    psql -d evantest -c "alter table test$((idx - 1)) attach partition test$idx for values from ($idx) to (1000000000);"
done;
