Skip to content

feat: Auto-update timestamp columns - #287

Merged
spencewenski merged 2 commits into
mainfrom
auto-update-timestamp
Jul 24, 2024
Merged

spencewenski merged 2 commits into
mainfrom
auto-update-timestamp

Conversation

@spencewenski

Copy link
Copy Markdown
Member

Add utilities and migrations to enable auto-updating timestamp columns of a row whenever the row is updated. Also, add the relevant migrations to the UserMigrator to auto-enable the feature for the user table.

Closes #285

@codecov

codecov Bot commented Jul 24, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 60.15038% with 106 lines in your changes missing coverage. Please review.

Project coverage is 46.84%. Comparing base (999f362) to head (01ad521).

Files Coverage Δ
src/migration/schema.rs 53.65% <100.00%> (ø)
.../user/m20240714_203550_create_user_table_int_pk.rs 0.00% <ø> (ø)
...user/m20240714_203551_create_user_table_uuid_pk.rs 0.00% <ø> (ø)
src/migration/user/mod.rs 100.00% <100.00%> (+85.71%) ⬆️
src/migration/user/tests.rs 100.00% <100.00%> (ø)
.../m20240723_201404_add_update_timestamp_function.rs 0.00% <0.00%> (ø)
...ion/user/m20240724_005115_user_update_timestamp.rs 0.00% <0.00%> (ø)
src/migration/timestamp/mod.rs 58.03% <58.03%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 999f362...01ad521. Read the comment docs.

@spencewenski
spencewenski force-pushed the auto-update-timestamp branch from 8569e15 to 2e7c2e9 Compare July 24, 2024 09:08
Add utilities and migrations to enable auto-updating timestamp columns
of a row whenever the row is updated. Also, add the relevant migrations
to the `UserMigrator` to auto-enable the feature for the `user` table.

Closes #285
@spencewenski
spencewenski force-pushed the auto-update-timestamp branch from 2e7c2e9 to 52403cd Compare July 24, 2024 09:17
@spencewenski
spencewenski merged commit 9e1ee56 into main Jul 24, 2024
@spencewenski
spencewenski deleted the auto-update-timestamp branch July 24, 2024 09:29
@github-actions github-actions Bot mentioned this pull request Jul 24, 2024
spencewenski pushed a commit that referenced this pull request Jul 24, 2024
## 🤖 New release
* `roadster`: 0.5.8 -> 0.5.9

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.5.9](roadster-v0.5.8...roadster-v0.5.9)
- 2024-07-24

### Added
- Auto-update timestamp columns
([#287](#287))
- Add SeaORM migrations and utils to create `user` table
([#284](#284))

### Other
- Disallow `unwrap` and `expect` except in tests
([#286](#286))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-update “updated_at” timestamp columns

1 participant