()
| 423 | }, |
| 424 | |
| 425 | async dropGeneratedConstraint() { |
| 426 | const client = new PGlite(); |
| 427 | |
| 428 | const schema1 = { |
| 429 | users: pgTable('users', { |
| 430 | id: integer('id'), |
| 431 | id2: integer('id2'), |
| 432 | name: text('name'), |
| 433 | generatedName: text('gen_name').generatedAlwaysAs((): SQL => sql`${schema1.users.name}`), |
| 434 | }), |
| 435 | }; |
| 436 | const schema2 = { |
| 437 | users: pgTable('users', { |
| 438 | id: integer('id'), |
| 439 | id2: integer('id2'), |
| 440 | name: text('name'), |
| 441 | generatedName: text('gen_name'), |
| 442 | }), |
| 443 | }; |
| 444 | |
| 445 | const { statements, sqlStatements } = await diffTestSchemasPush(client, schema1, schema2, [], false, ['public']); |
| 446 | |
| 447 | expect(statements).toStrictEqual([ |
| 448 | { |
| 449 | columnAutoIncrement: undefined, |
| 450 | columnDefault: undefined, |
| 451 | columnGenerated: undefined, |
| 452 | columnName: 'gen_name', |
| 453 | columnNotNull: false, |
| 454 | columnOnUpdate: undefined, |
| 455 | columnPk: false, |
| 456 | newDataType: 'text', |
| 457 | schema: '', |
| 458 | tableName: 'users', |
| 459 | type: 'alter_table_alter_column_drop_generated', |
| 460 | }, |
| 461 | ]); |
| 462 | expect(sqlStatements).toStrictEqual(['ALTER TABLE "users" ALTER COLUMN "gen_name" DROP EXPRESSION;']); |
| 463 | }, |
| 464 | |
| 465 | async alterGeneratedConstraint() { |
| 466 | const client = new PGlite(); |
nothing calls this directly
no test coverage detected