Closed yoonghm closed 8 years ago
Are you connected to the right database?
I figured out the reason by printing all attributes from PG
:
for (var x in PG) {
if (typeof PG[x] != 'function')
console.log(x);
}
One of the attribute, defaultConnectionUrl
is suspicious. I looked it up and found it in .meteor/local/isopacks/simple_pg/os/pg.js
PG.defaultConnectionUrl = process.env.POSTGRESQL_URL || 'postgres://127.0.0.1/postgres';
The run-app.sh
set the value to "postgres://127.0.0.1/todos"
.
So now the new question is why the information in .knex/knexfile.js
is not used?
Because it's only used for migrations via Knex.
You need to export POSTGRESQL_URL
the same way you would export the MONGO_URL
.
Thanks. From http://knexjs.org/, I still do not see why migrations is needed. Could you help to explain? Thanks.
You can read this Wikipedia article about migrations to get the gist of it.
Thanks!
My code
I have the table
.knex/knexfile.js
is