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

onDelete not applying in migration #308

rickharrison opened this Issue Jun 10, 2014 · 2 comments


None yet
2 participants

rickharrison commented Jun 10, 2014

In my migration I have a column definition like this:


In knex 0.5, this worked correctly, but on 0.6.12, it is not applying the onDelete clause. Here are the queries made under debug: true

{ __cid: '__cid1',
  sql: 'create table "user_tokens" ("id" serial primary key, "user_id" integer not null, "token" text not null, "created_at" timestamptz default now(), "updated_at" timestamptz default now())',
  bindings: [] }
{ __cid: '__cid1',
  sql: 'alter table "user_tokens" add constraint user_tokens_user_id_foreign foreign key ("user_id") references "users" ("id")',
  bindings: [] }
{ __cid: '__cid1',
  sql: 'alter table "user_tokens" add constraint user_tokens_token_unique unique ("token")',
  bindings: [] }

@tgriesser tgriesser added the bug label Jun 10, 2014

@tgriesser tgriesser closed this in 1e936ff Jun 12, 2014

@tgriesser tgriesser added the fixed label Jun 12, 2014


This comment has been minimized.


tgriesser commented Jun 12, 2014

Fixed in 0.6.13, sorry about that.


This comment has been minimized.

rickharrison commented Jun 12, 2014

No worries! Thanks for fixing

elliotf pushed a commit to elliotf/knex that referenced this issue Nov 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment