The Wayback Machine - https://web.archive.org/web/20201115062831/https://github.com/knex/knex/issues/4063
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

Missing support for withKeyName in TypeScript type declarations #4063

Open
pdemarino opened this issue Oct 12, 2020 · 0 comments
Open

Missing support for withKeyName in TypeScript type declarations #4063

pdemarino opened this issue Oct 12, 2020 · 0 comments

Comments

@pdemarino
Copy link

@pdemarino pdemarino commented Oct 12, 2020

Environment

Knex version: 0.21.6
Database + version: Not relevant
OS: Not relevant

Typescript issue: @lorefnon

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do

I am trying to rename a foreign key. Minimal example:

import * as Knex from "knex";

export async function up(knex: Knex): Promise<void> {
  await knex.schema.createTable("xyz", (t) => {
    t.increments("id");
    
    t.foreign("id").references("another.table").withKeyName("cg_link");
  });
}
  1. Error message

Property 'withKeyName' does not exist on type 'ReferencingColumnBuilder'.ts(2339)

  1. Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
    database connection to MySQL or PostgreSQL, then single file example which initializes
    needed data and demonstrates the problem.

See above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.