Is it possible to create a partitioned MySQL table in Django? Any example in that front will be really helpful.
I did as like the below by using sql hook of django:
yourmodelname.sql file:
DROP TABLE <table name>;
CREATE TABLE `<table name>` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`testcase_id` integer NOT NULL,
`databytes` integer NOT NULL,
`direction` integer NOT NULL,
`seconds` integer NOT NULL
) PARTITION BY LINEAR KEY (id) PARTITIONS 4;
COMMIT;
You don't need to involve Django at all. Just do table partitioning in plain mysql
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.