Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
DB Table txp_section has no primary key
Rather a hint than anything else:
While modifying some section data directly on the table level (setting dev_skin’s), I noticed that the table itself has no primary key.
I believe the intent with the first column, txp_section.name is to have it unique, so I made it primary key (and since primary key, changed it from varchar to char and due to size limitations down to 100 instead of former 255):
ALTER TABLE `<YourDbNameHere>`.`txp_section`
CHANGE COLUMN `name` `name` CHAR NOT NULL DEFAULT ‘’ ,
ADD PRIMARY KEY (`name`);
Have not checked the other tables, but potentially more tables are flying about without primary keys. It might also be that indices can be optimized.
Offline
Re: DB Table txp_section has no primary key
Weird. They should all have primary keys. Surprised it’s not set.
Edit: wait. The missing primary keys were only added as part of the upcoming 4.9.0. Affected tables:
txp_css
txp_form
txp_page
txp_plugin
txp_prefs
txp_section
Last edited by Bloke (2023-12-03 15:26:04)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: DB Table txp_section has no primary key
Got you.
Offline