Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
my understanding of bast practices is that all tables should have a primary key to make database queries run faster
Comments
Comment #2
jrglasgow CreditAttribution: jrglasgow commentedthis patch makes the nid column a primary key
Comment #3
laxman.ghavte CreditAttribution: laxman.ghavte as a volunteer and at Faichi Solutions Pvt Ltd commentedHi jrglasgow,
Reviewed patch working fine.
Comment #5
marcelovaniComment #7
brtamas CreditAttribution: brtamas at Integral Vision Ltd commentedI have got an error when I enable the module:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1171 All parts of a PRIMARY KEY must be NOT NULL;
I have created a patch to fix it.
Comment #8
brtamas CreditAttribution: brtamas at Integral Vision Ltd commentedComment #9
brtamas CreditAttribution: brtamas at Integral Vision Ltd commentedComment #10
Mike.Conley CreditAttribution: Mike.Conley commentedRefactoring brtamas' patch above -- the other columns in the primary key can't be NULL either.
Comment #11
Mike.Conley CreditAttribution: Mike.Conley commentedRefactoring to apply cleanly.
Comment #12
Mike.Conley CreditAttribution: Mike.Conley commentedUgh. 3rd time is the charm.
Comment #13
Mike.Conley CreditAttribution: Mike.Conley commentedFound a bug with a db_select query, needed to put the addField method on its own line.