amber icon indicating copy to clipboard operation
amber copied to clipboard

Scaffold CLI to support Postgresql array and JSON types

Open rnice01 opened this issue 4 years ago • 1 comments

Description

Are you guys open to having the scaffolding CLI support Postgresql specific types? It's easy enough to change the generated files as of now, but this might be a nice quality of life feature?

Example amber g scaffold Vocab expression:string meanings:array:string would produce the following migration and model.

CREATE TABLE vocabs (
  id BIGSERIAL PRIMARY KEY,
  expression VARCHAR,
  meanings VARCHAR[]
class Vocab < Granite::Base
  connection pg
  table vocabs
  column id : Int64, primary: true
  column expression : String?
  column meanings : Array(String)
  timestamps
end

rnice01 avatar Feb 21 '21 22:02 rnice01

We will be open please follow up with a PR

eliasjpr avatar May 10 '21 20:05 eliasjpr