kysely icon indicating copy to clipboard operation
kysely copied to clipboard

Add an AlterTypeBuilder

Open trescenzi opened this issue 1 year ago • 2 comments

There doesn't seem to be a way to alter a type after creating it without using raw sql. The following worked fine in a migration for me but it would be nice if there was a way to do it without raw sql. Happy enough if the answer is that it's more work to support than it's worth as the sql is simple enough but wanted to file an issue since I couldn't find anything related to this.

export async function up(db: Kysely<any>): Promise<void> {
  await sql`alter type status add value 'down'`.execute(db)
}

Thanks! Really loving Kysely.

trescenzi avatar May 07 '24 00:05 trescenzi

Hey! I'd like to tackle this one. Any recommendations on where to start?

lucianolix avatar Feb 14 '25 05:02 lucianolix

Hey! Probably the best way to get started is to copy paste one of the existing alter builders like AlterColumnBuilder or AlterTableBuilder and go from there.

koskimas avatar Feb 15 '25 13:02 koskimas