Closed asaf closed 8 months ago
Some context for distribution key: Composite foreign key
class Book(Base):
__tablename__ = 'books'
title = Column(String(20), primary_key=True)
author_firstName = Column(String(20))
author_lastName = Column(String(20))
__table_args__ = (ForeignKeyConstraint([author_firstName, author_lastName], [Author.firstName, Author.lastName]),{})
composite primary key
class Book(Base):
__tablename__ = 'books'
title = Column(String(20), primary_key=True)
author_firstName = Column(String(20), primary_key=True)
creating distributed tables
SELECT create_distributed_table('org', 'id'); //create_distributed_table_concurrently()
SELECT create_distributed_table('request', 'org_id', colocate_with => 'org');
SELECT create_distributed_table('message', 'org_id', colocate_with => 'org');
@asaf This is currently an issue, because org_id
is nullable on both request
and message
tables.
Primary key can't be nullable.
We'll have to decide what we want to do about the "global" org before we can commit anything for this issue.
@ErezSha what's left here? agreed not to allow null org_id as global
is going to be a tenant,
Please make sure all org_id
fields are not nullable and resolve the ticket.
Important when using DBs such as Azure CosmosDB where _org_id is the distribution key required for table colocation.