×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Designating a Primary Key
Robert Garza
Yeni Üye
Posts: 2
9 yıl 3 ay önce #913
Yazan: Robert Garza
Designating a Primary Key, Robert Garza tarafından oluşturuldu
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
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
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Walt Sorensen
Bronz Üye
Posts: 54
9 yıl 3 ay önce #919
Yazan: Walt Sorensen
Walt Sorensen tarafından Designating a Primary Key konusunda yanıtlandı
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.
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.
Şu kullanıcı(lar) Teşekkür etti: Andres Maeso, Robert Garza
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Robert Garza
Yeni Üye
Posts: 2
9 yıl 3 ay önce #920
Yazan: Robert Garza
Robert Garza tarafından Designating a Primary Key konusunda yanıtlandı
Thanks!! Also, just wondering....
Are there any other preferred names for other fields/columns - created_by, active, checked_out_by, ..etc...
Are there any other preferred names for other fields/columns - created_by, active, checked_out_by, ..etc...
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Walt Sorensen
Bronz Üye
Posts: 54
9 yıl 3 ay önce #922
Yazan: Walt Sorensen
Walt Sorensen tarafından Designating a Primary Key konusunda yanıtlandı
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
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
Şu kullanıcı(lar) Teşekkür etti: Andres Maeso, Robert Garza
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Sayfa oluşturma süresi: 0.056 saniye