Once you have a unique primary key, there is no need to enforce uniqueness
on other fields. But in many cases it is a good idea. I would not make this
user definable as you are talking about the database structure which should
not need revising (other than to add fields if required)
Rod Webster
*1300 896 832*
+61 435 765 611
Vehicle Modifications Network
www.vehiclemods.net.au


On Mon, 20 Jun 2022 at 15:15, Jérémie Tarot <silopo...@gmail.com> wrote:

> Le dim. 19 juin 2022 à 09:35, Håvard F. Aasen via Emc-developers <
> emc-developers@lists.sourceforge.net> a écrit :
>
> > On 18.06.2022 01:47, andy pugh wrote:
> > > On Fri, 17 Jun 2022 at 17:07, Jose Luis <j.l.toledan...@gmail.com>
> > wrote:
> > >
> > >> Still need to figure the parts from linuxcnc like where i can get or
> put
> > >> the data.
> > >
> > > Dewey added an interface. I'll be honest and say that it isn't how I
> > > would have done it. But I didn't do it so....
> > >
> > > https://linuxcnc.org/docs/devel/html/tooldatabase/tooldatabase.html
> > >
> >
> > I was looking at these tables, and beside that table names are written
> > in plural form,
>
>
> Is that considered "bad" practice?
>
>
>         toolID          TEXT PRIMARY KEY,
> >         T_number        INTEGER,
> >
> > As this is described, it seems to me that toolID really is a description,
> > and T_number could be used as the primary key, like so
> >
> >         toolID          INTEGER PRIMARY KEY, -- alias T_number
> >         description     TEXT
> >
>
> So now it will become patent I hadn't really looked at it before... But I'd
> actually go a step further and make:
> * "tool_id" an auto-generated integer primary key (this has slept a day in
> MB so just seconding Rod's point now)
> * "tool_number" a user editable UNIQUE integer
> * "tool_name" UNIQUE text
> * "tool_description" text
>
> Thinking again, uniqueness constraint on name and number could even be
> optionnal and a user pref
>
> _______________________________________________
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to