Closed nelsonic closed 2 years ago
It's just occurred to me: I can make these changes in the localhost
reasonably easily. š
But then the App that has been deployed to Fly.io mvp.fly.dev would require a migration ... š
I'm tempted to just do it manually in the PostgreSQL CLI
... š§āš»
Updated ERD:
flyctl postgres connect -a mvp-db
Connecting to mvp-db.internal... complete
psql (14.4 (Debian 14.4-1.pgdg110+1))
Type "help" for help.
describe tables (\dt
):
postgres-# \c mvp
You are now connected to database "mvp" as user "postgres".
mvp-# \dt
public | items | table | mvp
public | people | table | mvp
public | schema_migrations | table | mvp
public | timers | table | mvp
rename:
ALTER TABLE timers RENAME COLUMN "end" TO "stop";
Confirm:
SELECT
table_name,
column_name,
data_type
FROM
information_schema.columns
WHERE
table_name = 'timers';
table_name | column_name | data_type |
---|---|---|
timers | id | bigint |
timers | start | timestamp without time zone |
timers | stop | timestamp without time zone |
timers | item_id | bigint |
timers | person_id | bigint |
timers | inserted_at | timestamp without time zone |
timers | updated_at | timestamp without time zone |
Looks good. Now need to redeploy the app with the updated code. š¤
Looks like everything still works: š
Thank goodness for tests. š
At present the
timer
schema has anend
field: š https://github.com/dwyl/app-mvp-phoenix/blob/bf65127b434c5861e56a501a6350978c142df788/lib/app/timer.ex#L10This is a remnant from the previous MVP (
JavaScript
) where we selectedend
thinking it was a good field name. But inElixir
,end
is a "reserved" keyword for ending functions, conditionals and loops ... š The MVP is working ... https://github.com/dwyl/app-mvp-phoenix/issues/89#issuecomment-1190240856 But as I'm updating theREADME.md
I'm spotting things I want to improve. This is definitely one of them that we can "fix" reasonably easily now. š¤Todo
timer.end
totimer.stop
to be consistent.timer.end
totimer.stop
via CLI: https://github.com/dwyl/app-mvp/issues/114#issuecomment-1192150876This might take a while because there are many instances ... ā³ But I really want to avoid any unnecessary head-scratchers for other people reading the
README.md
in the future. š