-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
In my migration I have a column definition like this:
table.integer('user_id').notNullable().references('id').inTable('users').onDelete('cascade');
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: [] }