cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
My table has the following schema ->
when migrating to planetscale i get the following error ->
the generated sql produces this monster index for the composite primary key
how the heck can i set an alias for a composite primary key?
9 Replies
@Andrew Sherman sorry to buzz ya mate, don't seem to be getting a bite on my question, hopin you could maybe point me in the right direction? i don't particularly want to compress my table or column names as ive got a consistent set of conventions id really prefer to stick to....
Hey, sorry for a late response. This issue will be fixed right after we will introduce custom names for primaryKey and foreignKey constraints
are you using push or generate?
@Andrew Sherman been away for a minute sorry for late reply, yeah im pushing incremental migrations to planetscale through the greenfields phase till i settle on a version 1 database schema for production, so before that its the wild west atm
cant see a mention of custom names for primary keys in the releases page just yet, will this feature be far away?
no, I will work on it next(I'm finishing some batch api feature for orm) and then will work on drizzle-kit names for pk/fk
Hey @a_sherman - Has this functionality been released? As I'm currently hitting the same issue as above, and I can't find anything in the docs about it 🙂
GitHub
Unsigned Ints; Custom names for PrimaryKeys and ForeignKeys by Andr...
Added unsigned option for all ints in MySQL
column: int('column_name', { unsigned: true })
Add custom names for primary keys and foreign keys for all dialects
const table = sqliteTable('...
it's waiting it's turn for a next 0.29.0 release
working on a kit side for that
That's amazing thank you! Do you roughly when that should be released?
@Andrew Sherman at the risk of stretchin the friendship i don't spose a cheeky little Check constraint feature is gonna creep into 0.29.0? cause that'd just be swell.