Skip to content

CockroachDB: addPrimaryKeyOptions uses SERIAL (unsupported) #1970

@bpamiri

Description

@bpamiri

Summary

CockroachDBMigrator inherits PostgreSQL's addPrimaryKeyOptions() which replaces INTEGER with SERIAL. CockroachDB doesn't support SERIAL — it uses INT DEFAULT unique_rowid() instead.

Details

  • PostgreSQLMigrator.addPrimaryKeyOptions() does ReplaceNoCase(sql, "INTEGER", "SERIAL") (line 28-29)
  • CockroachDB will error on SERIAL type in DDL
  • Need CockroachDB-specific override: INT DEFAULT unique_rowid() PRIMARY KEY
  • Alternative: INT DEFAULT gen_random_uuid() for UUID-style PKs

Files

  • vendor/wheels/databaseAdapters/CockroachDB/CockroachDBMigrator.cfc — needs addPrimaryKeyOptions() override
  • vendor/wheels/databaseAdapters/PostgreSQL/PostgreSQLMigrator.cfc:26-32 — inherited method

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugphase:1-stabilizeBugs, cleanup, CI fixes — tackle first

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions