I have more of a conceptual question. Is there a way to model the following:
CREATE TABLE AssetPair (
older_asset_id INT8,
newer_asset_id INT8,
PRIMARY KEY (older_asset_id, '-', newer_asset_id)
);
My issue is that older_asset_id
and newer_asset_id
are incrementing IDs so the following edgecases are possible:
older_asset_id: 1, newer_asset_id: 234 --> PrimaryKey:1234
// same Primary keys
older_asset_id: 12 newer_asset_id: 34 --> PrimaryKey:1234
If I was able to insert a hyphen between the two columns I'd be able to avoid this issue. Any thoughts?