Skip to content

feat: emit sensible defaults and timestamp columns for add resource#499

Open
uemuradevexe wants to merge 1 commit intorapina-rs:mainfrom
uemuradevexe:feat/496-sensible-defaults-and-timestamps
Open

feat: emit sensible defaults and timestamp columns for add resource#499
uemuradevexe wants to merge 1 commit intorapina-rs:mainfrom
uemuradevexe:feat/496-sensible-defaults-and-timestamps

Conversation

@uemuradevexe
Copy link
Copy Markdown
Collaborator

@uemuradevexe uemuradevexe commented Apr 15, 2026

Summary

  • bool/boolean fields now emit .default(Expr::value(false)) in
    the generated migration — avoids requiring every insert to set the
    field explicitly
  • created_at and updated_at (TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP) are injected automatically into every migration
    and the entity schema! block, matching Rails/Django conventions
    and satisfying SeaORM ActiveModelBehavior
  • --no-timestamps flag opts out; entity receives #[timestamps(none)]
    to keep migration and entity in sync

Related Issues

Closes #496

Checklist

  • cargo fmt passes
  • cargo clippy has no warnings
  • Tests pass
  • Documentation updated (if needed)

@github-actions github-actions bot added area: cli CLI tool area: docs Documentation site labels Apr 15, 2026
@uemuradevexe uemuradevexe self-assigned this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI tool area: docs Documentation site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rapina add resource should emit sensible defaults and timestamp columns

1 participant