herbsjs / herbs-cli

Herbs CLI
https://herbsjs.org/
MIT License
29 stars 30 forks source link

feat: generate id field using uuid #191

Open rodrigodosanjosoliveira opened 1 year ago

rodrigodosanjosoliveira commented 1 year ago

Fixes #158

Proposed Changes

  1. Generate the id field as a string
  2. Using the uuidV4 package

Readiness Checklist

Author/Contributor

Reviewing Maintainer

codecov[bot] commented 1 year ago

Codecov Report

Merging #191 (d137937) into main (1099e97) will not change coverage. The diff coverage is n/a.

:exclamation: Current head d137937 differs from pull request most recent head 6fd4b18. Consider uploading reports for the commit 6fd4b18 to get more accurate results

@@           Coverage Diff           @@
##             main     #191   +/-   ##
=======================================
  Coverage   68.75%   68.75%           
=======================================
  Files          28       28           
  Lines         560      560           
=======================================
  Hits          385      385           
  Misses        175      175           
Impacted Files Coverage Δ
src/generators/src/packagejson.js 100.00% <ø> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

dalssoft commented 1 year ago

Thanks @rodrigodosanjosoliveira for the contribution

dalssoft commented 1 year ago

On the migrations you would need something like this: table.uuid('id').primary().defaultTo(knex.raw('uuid_generate_v4()')) (Postgress) where this line could change for each DB supported (PG, SQL Server, MySQL, etc)