migration create extension uuid-ossp
This commit is contained in:
@@ -3,9 +3,9 @@ package models
|
|||||||
import "github.com/google/uuid"
|
import "github.com/google/uuid"
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
Id uuid.UUID `json:"id" gorm:"type:uuid;default:uuid_generate_v4;primaryKey;unique;AutoIncrement:false"`
|
Id uuid.UUID `json:"id" gorm:"type:uuid;default:uuid_generate_v4();primaryKey;unique;AutoIncrement:false"`
|
||||||
Name string `json:"name" gorm:"type:string"`
|
Name string `json:"name" gorm:"type:string"`
|
||||||
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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
-- +goose Up
|
||||||
|
-- +goose StatementBegin
|
||||||
|
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||||
|
-- +goose StatementEnd
|
||||||
|
|
||||||
|
-- +goose Down
|
||||||
|
-- +goose StatementBegin
|
||||||
|
DROP EXTENSION "uuid-ossp";
|
||||||
|
-- +goose StatementEnd
|
||||||
Reference in New Issue
Block a user