gobuffalo / buffalo-auth

Buffalo auth plugin helps adding username password authentication to your app
https://gobuffalo.io
MIT License
41 stars 28 forks source link

attr type didn't work #21

Closed markbates closed 1 year ago

markbates commented 5 years ago

I generated a new auth with the following command:

$ b g auth age:int bio:nulls.Text

It didn't generate a model using nulls.String or a migration that has the correct column t.Column("bio", "text", {"null": true})

type User struct {
    ID           uuid.UUID `json:"id" db:"id"`
    CreatedAt    time.Time `json:"created_at" db:"created_at"`
    UpdatedAt    time.Time `json:"updated_at" db:"updated_at"`
    Email        string    `json:"email" db:"email"`
    PasswordHash string    `json:"password_hash" db:"password_hash"`

    Password             string `json:"-" db:"-"`
    PasswordConfirmation string `json:"-" db:"-"`

    //Extra fields

    Age string `json:"age" db:"age"`

    Bio string `json:"bio" db:"bio"`
}
create_table("users"){
    t.Column("id", "uuid", {"primary": true})
    t.Column("email", "string", {})
    t.Column("password_hash", "string", {})

    t.Column("age", "string", {})

    t.Column("bio", "string", {})

}
paganotoni commented 5 years ago

@markbates going for it, part of it should be because of the version of attr it uses, have one question for you, how do you prevent those spaces from happening in plush ?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.