When creating a table in Design view and not setting a column to be the primary key, Base will ask the user whether they want to create a primary key. IIRC the same query also appears when importing data into a new table (and in addition the option to designate a column as the primary key is well hidden). Not sure how the wizard behaves in this situation. Answering Yes will add a new column named ID, with an auto-increment value and designated as the primary key. This is what Microsoft’s Access does, and what would have made my old database professor cringe. Suggested improvement: when a user tries to add a new table without a primary key, give them the following options: - select an existing column to serve as the primary key (or multiple ones for a compound primary key) - add a new column with an auto-incremented value to serve as the primary key (à la Access) - proceed without a primary key
Agree
We have two workflows: "Use Wizard to Create Table..." providing various options to set-up the primary key and "Create Table in Design View" with a confirmation box allowing to create another "ID" field (one of the options with the wizard). I don't get the point with "importing data into a new table". (In reply to michael from comment #0) > Suggested improvement: when a user tries to add a new table without a > primary key, give them the following options... Users have all options when using the wizard but only a limited yes/no choice for the other workflow. But it's always possible to edit a table and to set another primary key is just a click away (right click at the row header). See also https://help.libreoffice.org/7.3/en-US/text/shared/guide/data_tabledefine.html Don't see much room for improvement.
(In reply to michael from comment #0) > > - select an existing column to serve as the primary key (or multiple ones > for a compound primary key) This is already implemented: in Step 3 of the wizard you will see on the left the columns. Now mark one (ore more by holding SHIFT) fields, right mouseclick and set "Primary Key". > - add a new column with an auto-incremented value to serve as the primary > key (à la Access) See the other bug descriptions for this. Importing from Calc doesn't allow to create a new column at all at this moment. Importing with autovalue has never worked, so it has been impossible to create a table with primary key and autovalue for Firebird, because you couldn't change such a field in Firebird to autovalue. > - proceed without a primary key This is already implemented. A popup appears when trying to save without primary key, and asks, if a PK should be created. Pressing "No" will save the table without PK. But Base will only read this tables in the GUI. There couldn't be changed data through the GUI, only per direct SQL or macro.
from comment 3, this looks as a WFM?
(In reply to Cor Nouws from comment #4) > from comment 3, this looks as a WFM? The only possibility, which isn't implemented, is to create an autoincrement primary key at this moment. But this is bug 130345 or bug 121210. … but as this moment (LO 7.2 / LO 7.3) the import wizard is mostly unusable (bug 147174). This bug has been reported for LO 7.0.0.3. So I would say: WFM.