create migrations 'add columnt role to users'
This commit is contained in:
@@ -8,4 +8,5 @@ type User struct {
|
|||||||
Email string `json:"email" gorm:"type:string;index"`
|
Email string `json:"email" gorm:"type:string;index"`
|
||||||
Password string `json:"password" gorm:"type:string;index"`
|
Password string `json:"password" gorm:"type:string;index"`
|
||||||
Phone string `json:"phone" gorm:"type:string;index"`
|
Phone string `json:"phone" gorm:"type:string;index"`
|
||||||
|
Role string `json:"role" gorm:"type:string;index"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
-- +goose Up
|
||||||
|
-- +goose StatementBegin
|
||||||
|
ALTER TABLE users ADD COLUMN role VARCHAR(50);
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
-- +goose StatementBegin
|
||||||
|
ALTER TABLE users DROP COLUMN role;
|
||||||
|
-- +goose StatementEnd
|
||||||
Reference in New Issue
Block a user