Skip to content

refactor: rename cardano_address DB column to cardano_stake_key for clarity #440

@cosmir17

Description

@cosmir17

Problem

The cnight_registrations table has a column named cardano_address that actually contains Cardano stake keys. This naming is confusing for developers and QA, as demonstrated when QA engineer Giuseppe was confused about which values to use for the dustGenerationStatus query.

Current State

  • Column name: cardano_address
  • Actual content: 32-byte Cardano stake keys
  • GraphQL field name: cardanoStakeKey
  • Documentation refers to: "Cardano stake keys"

Proposed Change

Rename the column from cardano_address to cardano_stake_key to match the GraphQL field naming and documentation terminology.

Affected Components

  • Database migration to rename column
  • Update chain-indexer/src/infra/storage.rs
  • Update any SQL queries referencing the column
  • Update documentation

Impact

  • Breaking change: No (internal database column only)
  • API change: No (GraphQL field names remain the same)
  • Migration required: Yes (simple column rename)

Alternative

If renaming is too disruptive, at minimum add clear comments in the schema and prominent notes in documentation about this naming discrepancy.

Context

QA feedback revealed this confusion: "the column name was what drove me off the road" - Giuseppe

Related PR: #419
Related documentation: #439

Metadata

Metadata

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions