13 lines
394 B
JavaScript
13 lines
394 B
JavaScript
import buildCreateTableSql from "./build-create-table-sql";
|
|
import recordSchemaChange from "./record-schema-change";
|
|
/**
|
|
* Create a new table
|
|
*/
|
|
export default function createTable(params) {
|
|
const { db, db_schema, table } = params;
|
|
recordSchemaChange(params, {
|
|
description: `Create table "${table.tableName}"`,
|
|
});
|
|
db.run(buildCreateTableSql({ db_schema, table }));
|
|
}
|