-
Notifications
You must be signed in to change notification settings - Fork 2k
Update Cloud SQL Postgres sample to create table on app start #2307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Cloud SQL Postgres sample to create table on app start #2307
Conversation
enocom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Fixes #2306