diff --git a/api/src/models/user.go b/api/src/models/user.go index 058b0a5..93e3086 100644 --- a/api/src/models/user.go +++ b/api/src/models/user.go @@ -8,4 +8,5 @@ type User struct { Email string `json:"email" gorm:"type:string;index"` Password string `json:"password" gorm:"type:string;index"` Phone string `json:"phone" gorm:"type:string;index"` + Role string `json:"role" gorm:"type:string;index"` } diff --git a/migrator/migrations/20240825004755_add_column_role_to_users.sql b/migrator/migrations/20240825004755_add_column_role_to_users.sql new file mode 100644 index 0000000..f7d4daa --- /dev/null +++ b/migrator/migrations/20240825004755_add_column_role_to_users.sql @@ -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