Skip to content

CDbSchema::resetSequence(): documentation does not fit functionality #2241

Closed
resurtm opened this Issue Mar 22, 2013 · 1 comment

1 participant

@resurtm
resurtm commented Mar 22, 2013

Discussion started here: #2214 (comment)

On the one hand it seems changing PHPDoc would solve the problem but i don't think it would be logical approach. I don't quite realize the use case of resetting sequence to the MAX PK value (i.e. trimming it).

I think it's better to change functionality to fit PHPDoc: resetting sequence value to the 1 by default would be far more logical approach. Of course this change will be mentioned in the UPGRADE file, since it's BC breaking.

Moreover we can create another special value (e.g. false) which would reset sequence to the MAX PK value (in case someone needs this).

UPD: After thinking a little bit more i came to opinion that it's better to keep functionality untouched. Everything can be achieved through current implementation:

  1. To set sequence value to the N: resetSequence($table,$n).
  2. To set sequence value to the 1: resetSequence($table,1).
  3. To set sequence value to the MAX PK value: resetSequence($table) or resetSequence($table,null).

Fixing this.

@resurtm resurtm was assigned Mar 22, 2013
@resurtm
resurtm commented Mar 22, 2013

I've just stumbled upon on another issue: COciSchema::resetSequence() works same way as described in its PHPDoc. BC breaking for Oracle is imminent.

@resurtm resurtm closed this in 0b41782 May 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.