create migrations 'add columnt role to users'

This commit is contained in:
valitovgaziz
2024-08-25 05:51:06 +05:00
parent d10f4af8e3
commit 0e50f3826f
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -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