Created
January 30, 2020 03:54
-
-
Save the-vampiire/639b95575eb62749899c7f4c7b42e554 to your computer and use it in GitHub Desktop.
knex-stub-sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint func-names:0 */ | |
exports.up = function (knex) { | |
return knex.schema.createTable("", (table) => { | |
table.increments(); | |
table | |
.integer("") // foreign_key_name | |
.unsigned() | |
.notNullable() | |
.references("") // table.primary_key_name | |
.onDelete("CASCADE"); // RESTRICT, CASCADE, SET NULL, NO ACTION | |
table.timestamps(true, true); | |
}); | |
}; | |
exports.down = function (knex) { | |
return knex.schema.dropTable(""); | |
}; | |
// exports.config = { transaction: false }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment