Update Cloud SQL Postgres sample to create table on app start#2307
Conversation
enocom
left a comment
There was a problem hiding this comment.
I ran this locally against an instance without the votes table and confirmed it works as expected.
cloud-sql/postgres/knex/server.js
Outdated
| table.specificType('candidate', 'CHAR(6)').notNullable(); | ||
| }); | ||
| } | ||
| console.log("Ensured that table 'votes' exists"); |
There was a problem hiding this comment.
This should probably be logger.info or whatever is appropriate for winston.
|
@jsimonweb looks good to me, but there do appear to be two failing links when tests run: Error: [404] https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/update-cloud-sql-postgres-sample/appengine Any idea what's referencing these, such that we might fix the links? |
Looks like these links might have been caused by the recent change to rename the repo's main branch and not a result of this PR. Merged branch 'main' into update-cloud-sql-postgres-sample branch to sync PR with 'main'. |
|
Given that we've merged this: #2314 (review) I think we need to make the Kokoro config changes first so that tests can run on this PR. I'll make sure to make any necessary to changes to this PR for it to pass. |
* Update Cloud SQL Postgres sample to create table * Remove test for createTable.js script * Lint. * Address review comment. Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
Fixes #2306