2
我正嘗試將關係遷移到我的postgres數據庫。問題是我不知道什麼值類型用於圖像。在knex中遷移表格:存儲媒體,圖像或blob
exports.up = function (knex, Promise) => {
return knex.schema.createTable('observations', (table) => {
table.increments();
table.integer('user_id').notNullable();
table.blob('image').notNullable(); //???
table.string('category').notNullable();
table.string('description').notNullable();
table.boolean('approved').notNullable().defaultTo(false);
table.float('latitude').notNullable();
table.float('longitude').notNullable();
table.timestamp('created_at').defaultTo(knex.fn.now());
});
};
我以爲會有一個「斑點」的文件類型,但在documentation似乎沒有遷移任何媒體的跡象。
請幫幫我。
或'specificType(typeName)' –
謝謝!這對我來說變得更加清晰了! – user2845075