|
|
@ -1,11 +1,11 @@ |
|
|
|
import init_queries from "./db"; |
|
|
|
|
|
|
|
/* initDatabase(db) |
|
|
|
/* createAllTables(db) |
|
|
|
* |
|
|
|
* Creates all tables from `db.js` file into |
|
|
|
* db arg. |
|
|
|
*/ |
|
|
|
function initDatabase(db) { |
|
|
|
function createAllTables(db) { |
|
|
|
db.transaction((tx) => { |
|
|
|
init_queries.forEach((query) => { |
|
|
|
tx.executeSql( |
|
|
@ -22,4 +22,13 @@ function initDatabase(db) { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/* initDatabase(db) |
|
|
|
* |
|
|
|
* Initiate database with tables and forms from FeedScreens |
|
|
|
* |
|
|
|
*/ |
|
|
|
function initDatabase(db) { |
|
|
|
createAllTables(db); |
|
|
|
} |
|
|
|
|
|
|
|
export default initDatabase; |