[SOLVED] ADOBD : creating a database : sequence or auto-increment ?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
User avatar
redwarp
Forum Members
Forum Members
Posts: 37
Joined: Wed Mar 24, 2010 5:36 pm

[SOLVED] ADOBD : creating a database : sequence or auto-increment ?

Post by redwarp »

Should I rather use :

Code: Select all

$flds = "
	ipwatch_id I AUTOINCREMENT PRIMARY,
	(...)
";
OR

Code: Select all

$flds = "
	ipwatch_id I KEY,
	(...)
";
(...)
$db->CreateSequence(cms_db_prefix().'module_iplock_watch_seq');
The first one looks easier to use to me, so what's the catch ?

Thanks in advance.
--
Redwarp
Last edited by redwarp on Tue May 11, 2010 2:11 pm, edited 1 time in total.
User avatar
redwarp
Forum Members
Forum Members
Posts: 37
Joined: Wed Mar 24, 2010 5:36 pm

Re: ADOBD : creating a database : sequence or auto-increment ?

Post by redwarp »

PS : I read that squences were important because of certain db that don't support auto increment, but I also heard that cms made simple didn't support them anymore, so... I'm basically lost !
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: ADOBD : creating a database : sequence or auto-increment ?

Post by calguy1000 »

Sequence tables were used because common versions of postgres didn't support auto increment fields back in the day when CMSMS was started.

We're not using sequence tables on any new development now.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
redwarp
Forum Members
Forum Members
Posts: 37
Joined: Wed Mar 24, 2010 5:36 pm

Re: ADOBD : creating a database : sequence or auto-increment ?

Post by redwarp »

Thanks !
Then I'll modify my code. It's gonna be a lot easier !
Locked

Return to “Developers Discussion”