× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Designating a Primary Key

9 år 3 måneder dager siden #913 av Robert Garza
Designating a Primary Key opprettet av Robert Garza
I have imported a SQL Script into Component Creator but how do I know that the fields I created to be primary keys are actually primary keys.

Or...how do I designate a primary key in an imported table?

Am I stuck using "id" as the only field name for a primary key?


Thanks

Vennligst Logg inn eller Registrer konto for å bli med i samtalen.

9 år 3 måneder dager siden #919 av Walt Sorensen
Besvart av Walt Sorensen i emne Designating a Primary Key
Generally speaking when working with Joomla components you will want to use `id` as your table's unique primary key field.
Without getting into a lot of explanation as to why, or identifying exceptions to this rule of thumb; I would say that you will likely save yourself from a lot of headaches by sticking with this general convention. 
Følgende bruker(e) sa Takk: Andres Maeso, Robert Garza

Vennligst Logg inn eller Registrer konto for å bli med i samtalen.

9 år 3 måneder dager siden #920 av Robert Garza
Besvart av Robert Garza i emne Designating a Primary Key
Thanks!!  Also, just wondering....

Are there any other preferred names for other fields/columns - created_by, active, checked_out_by, ..etc...

Vennligst Logg inn eller Registrer konto for å bli med i samtalen.

9 år 3 måneder dager siden #922 av Walt Sorensen
Besvart av Walt Sorensen i emne Designating a Primary Key
Yes there are "reserved" field names for the table

There is some information in the JTable tutorial docs.joomla.org/Using_the_JTable_class
(The tutorial does need some technical review, but will give you some good general direction)

There is also a way to specify custom names for fields documented in the API api.joomla.org/cms-3/classes/JTable.html
Følgende bruker(e) sa Takk: Andres Maeso, Robert Garza

Vennligst Logg inn eller Registrer konto for å bli med i samtalen.

Tid til å lage siden: 0.067 sekunder
Forumløsning av: Kunena

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.