Someone Posted January 1, 2013 Share Posted January 1, 2013 Is it by design that user_stat_table do not have auto increment on the column id. Makes it hard(er) to make module installations without having that handled. Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 4, 2013 Share Posted January 4, 2013 Yes it's on purpose. It's to avoid to have odd issues while adding a package. Quote Link to comment Share on other sites More sharing options...
Someone Posted January 6, 2013 Author Share Posted January 6, 2013 Soo, if I am to add a userStats var with a new module, I should during module activation (enable/disable) do: SELECT id FROM `user_stat_types` ORDER BY `user_stat_types`.`id` DESC LIMIT 1 Then use that as a base, add 1 and use that for id for my user_stat_types.id column Or is there a neat way to do it through the module .sql file? Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 7, 2013 Share Posted January 7, 2013 Currently you could of course use HIGH ID numbers, for example, use from 1000 to 1100 without querying, so far I doubt somebody is using it. Later on you will be able to have an "install.php" inside the module which will be called during installation and could setup special things like that. BTW Instead of your query, you could use: select max(id) from user_stat_types Quote Link to comment Share on other sites More sharing options...
Someone Posted January 7, 2013 Author Share Posted January 7, 2013 select max(id) from user_stat_types, thanks did not know that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.