id convention rule |
Hello to everyone
Can I change the column name 'id' for the primary key of a table to a name of my own favor? thanks Panagiotis
yes you can call it ID ; stick to something that makes sense , that you stick to - can't remember rules on underscore in name, but its the characteristics you pick that are important , i have mine to autoincrement and take this into account when i create a new entry
`ID` INTEGER PRIMARY KEY AUTOINCREMENT, but , if there is data and you rename it, then you will have to adjust code elsewhere. For instance this is the start of a product model Code: class ProductModel extends Model
By rules every table should have an id column and be indexed, just makes life easier.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |