Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alterType and update index.d.ts for alter function #4967

Merged
merged 6 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/integration2/schema/set-nullable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
isMysql,
isBetterSQLite3,
isOracle,
isCockroachDB,
} = require('../../util/db-helpers');
const { getAllDbs, getKnexForDb } = require('../util/knex-instance-provider');

Expand Down Expand Up @@ -76,7 +77,7 @@ describe('Schema', () => {
});

it('should throw error if alter a not nullable column with primary key #4401', async function () {
if (!isPostgreSQL(knex)) {
if (!(isPostgreSQL(knex) || isCockroachDB(knex))) {
this.skip();
}
await knex.schema.dropTableIfExists('primary_table_null');
Expand All @@ -97,7 +98,7 @@ describe('Schema', () => {
});

it('should not throw error if alter a not nullable column with primary key with alterNullable is false #4401', async function () {
if (!isPostgreSQL(knex)) {
if (!(isPostgreSQL(knex) || isCockroachDB(knex))) {
this.skip();
}
await knex.schema.dropTableIfExists('primary_table_null');
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@ export declare namespace Knex {
notNullable(): ColumnBuilder;
nullable(): ColumnBuilder;
comment(value: string): ColumnBuilder;
alter(): ColumnBuilder;
alter(options: Readonly<{alterNullable?: boolean}>): ColumnBuilder;
OlivierCavadenti marked this conversation as resolved.
Show resolved Hide resolved
queryContext(context: any): ColumnBuilder;
after(columnName: string): ColumnBuilder;
first(): ColumnBuilder;
Expand Down