Improve the setup database

This commit is contained in:
Louis Lam
2023-07-01 02:48:42 +08:00
parent d286c534bd
commit e26abc3156
11 changed files with 122 additions and 136 deletions

View File

@@ -37,6 +37,11 @@ exports.up = function(knex) {
table.increments('id');
table.decimal('price').notNullable();
table.string('name', 1000).notNullable();
}).then(() => {
knex("products").insert([
{ price: 10, name: "Apple" },
{ price: 20, name: "Orange" },
]);
});
};