トランザム
トランザム
Subscribe

トランザム

この広告は、90日以上更新していないブログに表示しています。

2016-11-20

gormでModelのenumの設定をする書き方

Go gorm

Golangのgormでenumの設定をする時に書き方に困ったのでその時のメモ

type Item struct {
  ID   uint   `gorm:"primary_key"`
  Name string `gorm:"size:255;not null"`
  Sex  string `gorm:"type: enum('male', 'female', 'unspecified'); default: 'unspecified'; not null"`
}

Models · GORM Guide

kiharekato 2016-11-20 13:41 Subscribe

Bookmark this entry on Hatena::Bookmark
Remove all ads
Goで依存ライブラリのバージョンを上げる »
Profile
id:kiharekato id:kiharekato
Subscribed unsubscribe Subscribe Subscribe
About this blog
Search
Links
  • Hatena Blog
  • ブログをはじめる
  • Weekly Hatena Blog
  • Hatena Blog Pro
Recent Entries
  • gormでModelのenumの設定をする書き方
  • Goで依存ライブラリのバージョンを上げる
  • IntelliJ IDEAでGoを開発しているときに、Unresolved referenceの対応メモ
  • GVMでGolangのバージョン管理の導入メモ
Archive
  • ▼ ▶
    2016
    • 2016 / 11

Start using Hatena Blog!

kiharekato is using Hatena Blog. Would you like to try it too?

Start using Hatena Blog (Free)
What is Hatena Blog?
トランザム トランザム

Powered by Hatena Blog | ブログを報告する

Quote saved.

Login to quote this blog

Failed to save quote. Please try again later.

You cannot quote because this article is private.

Subscribed unsubscribe Subscribe Subscribe