[2025-05-23]Tips about PostgreSQL & WordPress Page Refreshing for Testing & Git add / 关于PostgreSQL & WordPress页面刷新测试 & Git add 的小技巧

PostgreSQL

UUID

Today I spent a lot of time to change the schema, modified the id from series into uuid.
Fortunately now there are just a few tables. Should think it more clearly.

Order of Columns

Because PostgreSQL doesn’t support the order changing, so I just left the new added column(mostly uuid) to the end. A little hard to read.
The way to modify the orders is to build new columns or tables, copy the records, and then remove old ones.
I won’t do that… but have to make sure every query based operation do not related to the orders, by naming all the columns needed.

WordPress

Force Refresh the Page

Command + shift + R (for Mac).
Or just hit F12 to open the developer tool, and with Ctrl pressed click the refresh button.
The former is much more convenient.

Testing the first time to open page (clear Redux Persist cache)

F12 -> Application -> Local Storage / Session Storage -> delete the persist:my_key (depending on the codes)
Not very convenient, but the test won’t be done too frequently, so it’s OK.

Git

Remove the files / directories added by mistake (git add)

git rm –cached -r target_directory

Related Platforms

(Github Issues) / (Notion) / (Blog)

Advertisement

(A website to optimize your resume and to boost your career: Nonpareil.me)


PostgreSQL

UUID

今天花了不少时间,把我创建的表的主键id,从自动生成的序列改成UUID。
好在表并不多,以后还是得想得清楚些才行。

列的顺序

PostgreSQL不支持修改列顺序,所以我也不动了,新加的UUID在最后,读起来有点困难,不过就这样吧。
也不是不能改,需要创建新的列或者表,把原来的数据复制过去,再把旧的列或者表删除。
目前不做这个了。不过这样需要保证,查询时最好指明需要哪些列,如果使用了*,后续操作必须不依赖于列的顺序。

WordPress

强制刷新页面

Command + shift + R (Mac系统)。
或者按F12调出开发者工具,然后按着Ctrl点击页面的刷新按钮。
前者显然更方便。

测试第一次加载网页的行为(清空Redux持久化存储)

F12打开开发者工具 -> Application标签 -> Local Storage / Session Storage -> 删除 persist:my_key (取决于代码里怎么写)
不算很方便,不过目前我测试这一步不会很频繁,所以还好。

Git

如何移除误被 git add 的文件或者文件夹

git rm –cached -r target_directory

相关平台

(Github Issues) / (Notion) / (Blog)

推广

(优化简历,助力职场:Nonpareil.me)

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

滚动至顶部