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.
ui/migrations/20211013202909_init.js

23 lines
612 B
JavaScript

3 years ago
"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");
};