Skip to content

Commit

Permalink
Merge pull request #16 from unok/i-erdm-15
Browse files Browse the repository at this point in the history
#erdm-15  The flag of the unique constraint of index is reversed
  • Loading branch information
unok authored Jun 10, 2017
2 parents f7c9b59 + 615bbd4 commit 5d64fe0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions doc/sample/test_large_data_jp.erdm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ addresses/住所
prefecture_id/都道府県コード [bigint][NN] 0..*--1 prefectures
address1/住所1 [varchar(128)][NN]
address2/住所2 [varchar(128)]
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]
index i_addresses_user_id (user_id)
index i_addresses_address_type_id (address_type_id)
index i_addresses_prefecture_id (prefecture_id)
Expand All @@ -41,14 +41,14 @@ items/商品
description/詳細 [text]
quantity/数量 [int][NN]
price/単価 [numeric(10,2)][NN]
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]

carts/カート
+id/カートID [bigserial][NN][U]
user_id/顧客ID [bigint][NN] 0..*--1 users
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]
index i_carts_user_id (user_id)

cart_items/カート内アイテム
Expand All @@ -57,8 +57,8 @@ cart_items/カート内アイテム
item_id/商品ID [bigint][NN] 0..*--1 items
category_id/分類ID [bigint][NN][U] 0..*--1 categories
quantity/数量 [int][NN]
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]
index i_cart_items_cart_id (cart_id)

orders/注文
Expand All @@ -75,8 +75,8 @@ orders/注文
order_address_id/発注者住所 [bigint][NN] 0..*--1 addresses
delivery_address_id/納品先住所 [bigint][NN] 0..*--1 addresses
charge_address_id/請求先住所 [bigint][NN] 0..*--1 addresses
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]
index i_orders_cart_id (cart_id)
index i_orders_user_id (user_id)
index i_orders_item_id (item_id)
Expand All @@ -87,8 +87,8 @@ categories/分類
name/タグ [varchar(128)][NN]
description/説明 [text]
parent_category_id/親分類ID [bigint] 0..*--0..1 categories
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]

item_categories/商品分類
+id/商品分類ID [bigserial][NN][U]
Expand All @@ -103,5 +103,5 @@ administrators/管理者
mail_address/メールアドレス [varchar(256)][NN][U]
password/パスワード [varchar(128)][='********']
# sha1 でハッシュ化して登録
updated/更新日時 [timestamp with time zone][NN][=now()]
created/作成日時 [timestamp with time zone][NN][=now()]
updated/更新日時 [timestamp with time zone][NN][=now()][-erd]
created/作成日時 [timestamp with time zone][NN][=now()][-erd]
2 changes: 1 addition & 1 deletion erdm.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (e *ErdM) addComment(t string) {
}

func (e *ErdM) setIndexName(t string) {
e.Tables[e.CurrentTableId].Indexes = append(e.Tables[e.CurrentTableId].Indexes, Index{Title: t})
e.Tables[e.CurrentTableId].Indexes = append(e.Tables[e.CurrentTableId].Indexes, Index{Title: t, IsUnique: false})
e.Tables[e.CurrentTableId].CurrentIndexId = len(e.Tables[e.CurrentTableId].Indexes) - 1
}

Expand Down
2 changes: 1 addition & 1 deletion release_tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.13
v0.0.14
4 changes: 2 additions & 2 deletions templates/html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"index_list": [
{{- range $ii, $iv := $t.Indexes}}
{"title": "{{$iv.Title}}",
"columns": "{{range $iic := $iv.Columns}}{{$iic}} {{end}}",
"is_unique": "{{$iv.IsUnique}}"},
"is_unique": {{$iv.IsUnique}},
"columns": "{{range $iic := $iv.Columns}}{{$iic}} {{end}}"},
{{end}}
],
"column_list": [
Expand Down
4 changes: 2 additions & 2 deletions templates_files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d64fe0

Please sign in to comment.