Project

General

Profile

Bug #4682

Tables with no primary key

Added by Laurent Opprecht about 9 years ago. Updated almost 9 years ago.

Status:
Bug resolved
Priority:
Urgent
Assignee:
-
Category:
-
Target version:
Start date:
30/04/2012
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Some tables have no primary keys:

admin
c_chat_connected
c_forum_mailcue
c_forum_notification
c_role_group
c_role_permissions
c_role_user

c_wiki_conf
c_wiki_mailcue

skill_rel_skill
stored_values
stored_values_stack
reservation_category_rights
track_e_attempt
track_e_attempt_recording
track_e_hotpotatoes
usergroup_rel_user
usergroup_rel_course
usergroup_rel_session

Associated revisions

Revision 384bf36a (diff)
Added by Julio Montoya about 9 years ago

Adding primary keys see #4682

Revision ceeb99e4 (diff)
Added by Julio Montoya about 9 years ago

Adding PK in the chat_connected + changing smallint to int see #4682

Revision 680d8608 (diff)
Added by Julio Montoya about 9 years ago

Adding new constant in the Database class in order to error_log mysql errors see #4682

Revision 2001985a (diff)
Added by Julio Montoya about 9 years ago

Adding id in some course tables see #4682

Revision d8ca23eb (diff)
Added by Julio Montoya about 9 years ago

Adding missing primary keys see #4682

History

#1

Updated by Laurent Opprecht about 9 years ago

usergroup_rel_course
usergroup_rel_session$

no primary keys

#2

Updated by Laurent Opprecht about 9 years ago

  • Subject changed from usergroup_rel_user has no primary key to Tables with no primary key
#3

Updated by Yannick Warnier about 9 years ago

  • Target version set to 1.9 Beta

For some of these, it might be important to have one before the beta. For some of these, it didn't matter in the past as they were only available in the context of one course (so very little data), but now they're all in the same database, it becomes much more important. This being said, if there is no primary key but there is a sufficient index for all the queries that are sent to it, it is not that important (I see most of them are n-to-m relations tables, which mean two columns ar already foreign key and can be indexed, and are really the columns used to find the data).

#4

Updated by Julio Montoya about 9 years ago

  • % Done changed from 0 to 30

adding primary keys to this tables:

admin
usergroup_rel_user
usergroup_rel_course
usergroup_rel_session
skill_rel_skill

#5

Updated by Julio Montoya about 9 years ago

Any idea why this table exists?

stored_values
stored_values_stack

#6

Updated by Yannick Warnier about 9 years ago

This is for the new reporting system. You can leave them (we still have to get it to work, but either way... they're OK)

#7

Updated by Yannick Warnier about 9 years ago

actually I would rather rename stored_values into track_stored_values or something like that... to keep it close in terminology from other tracking tables.

#8

Updated by Yannick Warnier about 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya
  • Priority changed from Normal to Urgent

Moving this to a higher priority as it has to do with database structure. Julio, can you take the adding of primary keys in charge or is there something stopping you?

#9

Updated by Julio Montoya about 9 years ago

  • % Done changed from 30 to 40

working on it

#10

Updated by Julio Montoya about 9 years ago

  • Status changed from Assigned to Needs more info
  • Assignee changed from Julio Montoya to Yannick Warnier
  • % Done changed from 40 to 70

Only 2 tables are still missing of PK:

c_wiki_conf, c_wiki_mailcue

I don't want to mess right now with those tables because I did a test and I will take some time to fix all the queries...

#11

Updated by Yannick Warnier about 9 years ago

  • Status changed from Needs more info to New
  • Assignee deleted (Yannick Warnier)
  • Target version changed from 1.9 Beta to 2.0

OK, then I'm moving this task to 1.10. Thanks for checking everything.

#12

Updated by Laurent Opprecht almost 9 years ago

  • Status changed from New to Bug resolved
  • % Done changed from 70 to 100

both tables have no primary keys
code generation for Doctrine worked
closing

Also available in: Atom PDF