You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
612 B
JavaScript
23 lines
612 B
JavaScript
"use strict";
|
|
|
|
const Promise = require("bluebird");
|
|
|
|
module.exports.up = function(knex) {
|
|
return Promise.try(() => {
|
|
return knex.schema.createTable("datasheets_products", (table) => {
|
|
table.text("id").primary();
|
|
table.text("manufacturer");
|
|
table.text("name").notNull();
|
|
table.text("description");
|
|
table.text("source").notNull();
|
|
table.text("url").notNull();
|
|
});
|
|
}).then(() => {
|
|
return knex.raw("CREATE INDEX search_index ON datasheets_products ((lower(name)) text_pattern_ops);");
|
|
});
|
|
};
|
|
|
|
module.exports.down = function(knex) {
|
|
return knex.schema.dropTable("datasheets_products");
|
|
};
|