Moodle

Add reset_sequence to db layer

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Activity

Hide
Andrei Bautu added a comment - - edited

I still believe that sequence reset belongs to ddl. Yes, it uses some data (max(id)) which will be retrieved by dml, but the workhorse should be in ddl (with a generic bootstrap method in dml).
Instead of copy/pasting the same code for each driver type, this approach would allow statements to be reuse per db type. For example, like in the case of CREATE SEQUENCE, CREATE TABLE, etc, ALTER TABLE xyz AUTO_INCREMENT value it's the same for MySQL no matter what driver type you use (adodb, pdo, native).

Show
Andrei Bautu added a comment - - edited I still believe that sequence reset belongs to ddl. Yes, it uses some data (max(id)) which will be retrieved by dml, but the workhorse should be in ddl (with a generic bootstrap method in dml). Instead of copy/pasting the same code for each driver type, this approach would allow statements to be reuse per db type. For example, like in the case of CREATE SEQUENCE, CREATE TABLE, etc, ALTER TABLE xyz AUTO_INCREMENT value it's the same for MySQL no matter what driver type you use (adodb, pdo, native).
Hide
Petr Škoda (skodak) added a comment -

code committed into cvs, minor changes related to table_exists() and return values added.

thanks!

Show
Petr Škoda (skodak) added a comment - code committed into cvs, minor changes related to table_exists() and return values added. thanks!

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: