From d4e04cd08f76389f0db76adec1c62d3a48c36d7b Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Tue, 29 Dec 2020 10:21:55 +0200 Subject: [PATCH] entc/load: add reflect kind for default value (#1101) --- entc/integration/hooks/ent/internal/schema.go | 2 +- entc/integration/privacy/ent/internal/schema.go | 2 +- entc/load/internal/bindata.go | 4 ++-- entc/load/schema.go | 4 ++++ entc/load/schema_test.go | 3 +++ examples/privacyadmin/ent/internal/schema.go | 2 +- examples/privacytenant/ent/internal/schema.go | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/entc/integration/hooks/ent/internal/schema.go b/entc/integration/hooks/ent/internal/schema.go index ad6d14226..2f37882a3 100644 --- a/entc/integration/hooks/ent/internal/schema.go +++ b/entc/integration/hooks/ent/internal/schema.go @@ -9,4 +9,4 @@ // Package internal holds a loadable version of the latest schema. package internal -const Schema = `{"Schema":"github.com/facebook/ent/entc/integration/hooks/ent/schema","Package":"github.com/facebook/ent/entc/integration/hooks/ent","Schemas":[{"name":"Card","config":{"Table":""},"edges":[{"name":"owner","type":"User","ref_name":"cards","unique":true,"inverse":true}],"fields":[{"name":"number","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"unknown","immutable":true,"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}},{"name":"created_at","type":{"Type":2,"Ident":"","PkgPath":"time","Nillable":false,"RType":null},"default":true,"position":{"Index":2,"MixedIn":false,"MixinIndex":0}},{"name":"in_hook","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"position":{"Index":3,"MixedIn":false,"MixinIndex":0}}],"hooks":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":false,"MixinIndex":0},{"Index":1,"MixedIn":false,"MixinIndex":0}]},{"name":"User","config":{"Table":""},"edges":[{"name":"cards","type":"Card"},{"name":"friends","type":"User"},{"name":"best_friend","type":"User","unique":true}],"fields":[{"name":"version","type":{"Type":12,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":0,"position":{"Index":0,"MixedIn":true,"MixinIndex":0}},{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"worth","type":{"Type":17,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}}],"hooks":[{"Index":0,"MixedIn":true,"MixinIndex":0}]}],"Features":["schema/snapshot"]}` +const Schema = `{"Schema":"github.com/facebook/ent/entc/integration/hooks/ent/schema","Package":"github.com/facebook/ent/entc/integration/hooks/ent","Schemas":[{"name":"Card","config":{"Table":""},"edges":[{"name":"owner","type":"User","ref_name":"cards","unique":true,"inverse":true}],"fields":[{"name":"number","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"unknown","default_kind":24,"immutable":true,"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}},{"name":"created_at","type":{"Type":2,"Ident":"","PkgPath":"time","Nillable":false,"RType":null},"default":true,"default_kind":19,"position":{"Index":2,"MixedIn":false,"MixinIndex":0}},{"name":"in_hook","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"position":{"Index":3,"MixedIn":false,"MixinIndex":0}}],"hooks":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":false,"MixinIndex":0},{"Index":1,"MixedIn":false,"MixinIndex":0}]},{"name":"User","config":{"Table":""},"edges":[{"name":"cards","type":"Card"},{"name":"friends","type":"User"},{"name":"best_friend","type":"User","unique":true}],"fields":[{"name":"version","type":{"Type":12,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":0,"default_kind":2,"position":{"Index":0,"MixedIn":true,"MixinIndex":0}},{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"worth","type":{"Type":17,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}}],"hooks":[{"Index":0,"MixedIn":true,"MixinIndex":0}]}],"Features":["schema/snapshot"]}` diff --git a/entc/integration/privacy/ent/internal/schema.go b/entc/integration/privacy/ent/internal/schema.go index 5d7ddc2b5..7df02d517 100644 --- a/entc/integration/privacy/ent/internal/schema.go +++ b/entc/integration/privacy/ent/internal/schema.go @@ -9,4 +9,4 @@ // Package internal holds a loadable version of the latest schema. package internal -const Schema = `{"Schema":"github.com/facebook/ent/entc/integration/privacy/ent/schema","Package":"github.com/facebook/ent/entc/integration/privacy/ent","Schemas":[{"name":"Task","config":{"Table":""},"edges":[{"name":"teams","type":"Team"},{"name":"owner","type":"User","ref_name":"tasks","unique":true,"inverse":true}],"fields":[{"name":"title","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"description","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}},{"name":"status","type":{"Type":6,"Ident":"task.Status","PkgPath":"","Nillable":false,"RType":null},"enums":[{"N":"planned","V":"planned"},{"N":"in_progress","V":"in_progress"},{"N":"closed","V":"closed"}],"default":true,"default_value":"planned","position":{"Index":2,"MixedIn":false,"MixinIndex":0}},{"name":"uuid","type":{"Type":4,"Ident":"uuid.UUID","PkgPath":"github.com/google/uuid","Nillable":true,"RType":null},"optional":true,"position":{"Index":3,"MixedIn":false,"MixinIndex":0}}],"hooks":[{"Index":0,"MixedIn":false,"MixinIndex":0}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"Team","config":{"Table":""},"edges":[{"name":"tasks","type":"Task","ref_name":"teams","inverse":true},{"name":"users","type":"User","ref_name":"teams","inverse":true}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"User","config":{"Table":""},"edges":[{"name":"teams","type":"Team"},{"name":"tasks","type":"Task"}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"unique":true,"immutable":true,"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"age","type":{"Type":17,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1},{"Index":0,"MixedIn":false,"MixinIndex":0}]}],"Features":["privacy","entql","schema/snapshot"]}` +const Schema = `{"Schema":"github.com/facebook/ent/entc/integration/privacy/ent/schema","Package":"github.com/facebook/ent/entc/integration/privacy/ent","Schemas":[{"name":"Task","config":{"Table":""},"edges":[{"name":"teams","type":"Team"},{"name":"owner","type":"User","ref_name":"tasks","unique":true,"inverse":true}],"fields":[{"name":"title","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"description","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}},{"name":"status","type":{"Type":6,"Ident":"task.Status","PkgPath":"","Nillable":false,"RType":null},"enums":[{"N":"planned","V":"planned"},{"N":"in_progress","V":"in_progress"},{"N":"closed","V":"closed"}],"default":true,"default_value":"planned","default_kind":24,"position":{"Index":2,"MixedIn":false,"MixinIndex":0}},{"name":"uuid","type":{"Type":4,"Ident":"uuid.UUID","PkgPath":"github.com/google/uuid","Nillable":true,"RType":null},"optional":true,"position":{"Index":3,"MixedIn":false,"MixinIndex":0}}],"hooks":[{"Index":0,"MixedIn":false,"MixinIndex":0}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"Team","config":{"Table":""},"edges":[{"name":"tasks","type":"Task","ref_name":"teams","inverse":true},{"name":"users","type":"User","ref_name":"teams","inverse":true}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"User","config":{"Table":""},"edges":[{"name":"teams","type":"Team"},{"name":"tasks","type":"Task"}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"unique":true,"immutable":true,"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}},{"name":"age","type":{"Type":17,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"optional":true,"position":{"Index":1,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1},{"Index":0,"MixedIn":false,"MixinIndex":0}]}],"Features":["privacy","entql","schema/snapshot"]}` diff --git a/entc/load/internal/bindata.go b/entc/load/internal/bindata.go index 26434652d..b73a94ef9 100644 --- a/entc/load/internal/bindata.go +++ b/entc/load/internal/bindata.go @@ -98,7 +98,7 @@ func templateMainTmpl() (*asset, error) { return a, nil } -var _schemaGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x5a\x5f\x6f\xe3\x36\x12\x7f\xb6\x3f\xc5\x34\x40\x17\xd6\xc2\x55\x7a\x45\x51\xdc\x79\xcf\x07\x14\xed\x16\xcd\xf5\x36\x5d\x74\x77\xfb\x12\x04\xa9\x22\x0d\x13\x6e\x24\xca\x25\xe9\x6c\xd2\x34\xdf\xfd\xc0\x19\x52\xa2\x64\xc9\xf6\xe6\xdf\x4b\xac\x21\x67\x38\xf3\xd3\xfc\xe3\xd8\x87\x87\xf0\x43\xbd\xba\xd5\xf2\xe2\xd2\xc2\x37\x5f\xff\xe3\x5f\x5f\xad\x34\x1a\x54\x16\x7e\xca\x72\x3c\xaf\xeb\x2b\x38\x52\x79\x0a\xdf\x97\x25\xd0\x26\x03\x6e\x5d\x5f\x63\x91\x4e\x0f\x0f\xe1\xfd\xa5\x34\x60\xea\xb5\xce\x11\xf2\xba\x40\x90\x06\x4a\x99\xa3\x32\x58\xc0\x5a\x15\xa8\xc1\x5e\x22\x7c\xbf\xca\xf2\x4b\x84\x6f\xd2\xaf\xc3\x2a\x88\x7a\xad\x0a\x27\x42\x2a\xda\xf2\xbf\xa3\x1f\x5e\x1f\xbf\x7b\x0d\x42\x96\x18\x68\xba\xae\x2d\x14\x52\x63\x6e\x6b\x7d\x0b\xb5\x00\x1b\x9d\x67\x35\x62\x3a\x9d\xae\xb2\xfc\x2a\xbb\x40\x28\xeb\xac\x98\x4e\x65\xb5\xaa\xb5\x85\xd9\x74\x72\x80\x2a\xaf\x0b\xa9\x2e\x0e\x3f\x9a\x5a\x1d\x4c\x27\x07\xa2\xb2\xee\x9f\x46\x51\x62\x6e\x0f\xa6\xd3\xc9\xc1\x85\xb4\x97\xeb\xf3\x34\xaf\xab\x43\xe1\x0d\x3e\x44\x45\xdb\x46\x96\x0e\x4d\x7e\x89\x55\xb6\x7b\xc7\x21\x16\x17\xb8\xc7\x36\x21\xb1\x2c\xf6\xd8\x27\x55\x81\x37\x07\xd3\x64\xea\x40\x7b\x47\x34\xd0\xe8\x5f\x97\x81\x4c\x01\x2a\x9b\xfa\x05\x7b\x99\x59\xf8\x94\x19\x42\x05\x0b\x10\xba\xae\x20\x83\xbc\xae\x56\xa5\x74\xaf\xc6\xa0\x06\x8f\x5c\x3a\xb5\xb7\x2b\x0c\x22\x8d\xd5\xeb\xdc\xc2\xdd\x74\x72\x9c\x55\x08\xfe\xcf\x58\x2d\xd5\x05\xf4\xff\xfe\x70\xd0\x2e\x0e\x54\x56\xe1\xbc\xae\xa4\xc5\x6a\x65\x6f\x0f\xfe\x98\x4e\x7e\xa8\x95\x90\x7e\xbf\x53\x2b\x7e\xee\xf2\xe6\xb4\xd2\xe5\x7e\x5d\x5c\xa0\xf1\xdb\x4e\x4e\x5f\xba\xc7\x91\x93\x1d\xc6\xa6\xcb\xfc\x93\xc3\xd3\x34\xcc\xf4\x38\xcc\x4c\xc8\xf7\xb8\x8f\x1c\xca\xfe\xf0\x93\xd3\x97\xf4\x38\xcc\x2d\x79\x67\x97\xfd\xe7\xba\xbe\x8a\x34\x7f\x5b\x1b\x69\x65\xad\x06\xd8\x2f\xdd\xce\x2e\xf3\xdb\xba\x94\xf9\xed\x3e\xcc\x2b\xda\xd9\xe5\xfe\x5e\xa9\xda\x66\x8e\xc1\x40\x95\xad\x4e\xf8\x95\x9d\x4a\x65\x51\x3b\x7f\xba\xbb\x0f\xdc\x59\xbb\xb3\x23\xe2\x9e\x5c\xab\x39\xb6\x40\x93\x6b\x79\x8e\x06\x32\x58\x05\xa2\x8f\x4c\xf6\x49\xef\x39\x0d\x47\xeb\x3b\x11\x6e\x52\x59\x80\xc3\x43\x60\x92\xe7\x27\xe8\x0f\x1d\x06\x50\x4a\x63\xd3\xe9\xe4\x8d\xbc\xc1\xe2\x88\x8c\x3d\xaf\xeb\xd2\x73\xc8\x3c\xb3\x68\x40\x8a\xe8\x54\xa8\xcf\x3f\x62\xce\xee\x5d\x39\xae\xaf\xa4\x62\x01\x52\x85\x43\xf8\x48\x22\x81\x8c\x0f\xae\x88\xc4\x67\xb2\xbd\xec\x20\x9b\x91\xc4\xf4\x07\x04\x12\x33\x0e\xc7\xd1\x68\x24\x8d\x87\xd2\x91\x12\x75\xbb\xed\x25\x21\x97\xbe\xbf\x5d\x61\x67\xc1\xb3\x3b\x05\xba\xec\xef\xb3\xf8\xb0\x1d\xa7\xdb\xac\x17\x89\xef\xe4\x5f\x91\xee\x2f\xa5\xb2\xdf\x7d\x3b\xca\x6d\xe4\x5f\xbd\xc3\x5f\xab\x75\x65\x9a\x6d\x27\xa7\x0c\xca\x1d\x1c\xcf\xe1\xf7\xa0\x4b\xe3\x96\xe8\x36\x77\xf9\x3f\x28\xf9\xe7\xba\x51\x80\xfc\x62\xe0\xcf\xf3\xaf\x69\x73\x57\xc0\xb1\x2c\xcb\xec\xbc\xc4\xbd\x04\x28\xbf\xb9\x2b\xe2\xd7\x95\xf3\xed\xac\xdc\x4b\x44\xed\x37\x77\x45\xfc\x88\x22\x5b\x97\x76\x3f\x33\x0a\xde\x3c\x28\xe1\xf7\xac\x74\x70\xc4\x31\x3d\x2e\xe1\xec\xda\xed\xee\x01\xba\x2a\x32\x8b\x41\x9f\x5d\x80\xd2\xe6\xb3\x41\x85\x8e\xaa\x6a\x6d\x1b\x64\x77\x08\x92\x61\x73\x57\xc6\xef\x59\x29\x8b\xcc\xd6\x9a\x5c\x84\x82\x76\x5c\xc6\x75\xb3\xb9\xe7\xa1\xb6\xd6\xd9\x05\xfe\x82\x94\x38\x77\xf8\xb7\xe1\xcd\x67\x57\x78\xdb\x4f\xbd\x71\xae\x1d\x4c\xbd\x71\xf6\xe5\xd5\x9e\x22\xa8\x1c\xf9\x7a\x2f\x44\x4c\xd8\xdc\x93\x41\x09\xce\x05\xb7\xdb\x1b\x65\xf1\x8e\x5d\x41\x06\x6d\x3e\xdb\x0c\xf9\xb8\x12\xc0\x58\x2d\xd8\xaf\x18\x50\xe9\xdd\xcc\x8d\x44\x7e\x40\x6a\x24\xbe\xa7\xe9\x30\x02\x48\xbb\x79\xb7\xe7\xc4\x1d\xbc\xfd\x84\xf8\x1b\x8a\x46\xeb\xed\xac\x1a\xc5\xd9\xa6\xda\xbf\xa1\x68\x36\x0e\x36\x36\x31\xff\x78\x32\x1c\x71\xaf\x2d\x99\xf0\x48\x5d\xa3\x36\x5b\x9d\xb3\x69\x6c\x68\x67\x5f\xef\x3f\xd7\x52\x63\xb1\x9b\x5d\xfb\x9d\xe3\x61\xfa\xd2\x75\x6d\x69\x37\x70\xf7\x88\xd1\xa7\x6a\x70\xb8\x47\xd8\x74\x6a\xa6\x3f\xc0\xab\x99\xb1\x75\xeb\xe8\x45\x35\x50\x6d\x79\x33\x51\xb7\x7b\x12\x02\x7d\xaf\xf6\xb6\xbf\x7b\xa8\x9f\x8d\x50\x6e\xdc\x75\x07\xd0\x8c\xd2\x31\x7e\x22\xf7\xcc\x35\x52\x0b\x96\xa9\x80\x88\x53\x8a\x61\xa1\x4f\xdc\x26\xae\x6c\xad\xd3\xa9\x58\xab\x3c\x70\xce\xb0\xf0\x6f\xfa\xc7\x66\x47\xe2\x7d\xfe\x6e\x3a\x51\x08\x8b\x25\xbc\x70\x8f\x77\xd3\x89\x0b\xc9\x45\xe3\x49\x58\xa4\xef\xb3\x8b\xb9\x23\xdf\xae\x70\x11\x93\x5d\x2c\x4f\x27\x94\x39\x62\xba\x7b\x76\x74\x86\x7e\xd1\xd0\xf9\xd9\xad\x78\xff\x5f\x84\x15\xff\xec\x96\x82\x6f\x2f\xfc\x52\x78\xe6\x35\xd1\x9e\x45\x6b\x22\x9c\xd5\x42\xbb\xa0\xa5\xf6\xd9\xad\x46\xde\xba\x80\x2a\xbb\xc2\xd9\xb0\xcf\x26\xf3\xe9\xe4\x7e\x3a\x11\xb5\x86\xb3\x39\x64\xd6\xa1\xa2\x33\x75\x81\x4e\x64\xec\xf2\x0e\x25\x85\x69\x56\x14\x2d\x75\x96\xd9\x84\xd8\xa5\x00\x8d\xc2\xf1\xb2\x8e\xaf\xe8\xf1\x8b\x25\x28\x59\x06\x4e\x97\x7a\x96\xcd\xdb\xd1\x28\x12\xa6\x47\x2e\xb2\x04\xde\x17\xd1\x48\xbc\x46\xbb\xd6\x0a\x14\xb6\xce\xc1\x5d\xee\xa6\x77\x90\x13\xb2\x7b\xf0\xc7\x21\xff\x20\xe6\x99\x28\x42\x3b\x1b\x7b\xc8\x8c\xaf\x6c\x73\x40\xad\xdd\xf3\x1d\x59\x27\x8a\xf4\xb5\xd6\xb1\x45\x41\x27\x59\xce\x41\x54\xd6\x2d\xd7\x5a\xcc\x38\x0a\xe0\xcb\x3f\x17\xf0\xe5\xf5\xc1\xdc\x31\xd2\x0b\xf3\x12\x18\x2e\x43\x50\xbd\xa0\x83\xee\xfa\xee\x04\x0d\x0f\xb9\x8d\xa8\xbb\x2b\x8e\x32\xef\x7b\x2c\xad\x78\x9f\xa5\xa6\x77\x11\x2f\x10\x65\xc3\x3d\x69\xa9\x75\xd0\xd0\xaa\x2e\x5a\x1d\x42\x3f\x3a\x9d\x34\x5d\x68\xbb\x1a\x28\x6e\xd5\x37\x74\x8b\x56\x6e\x68\xf1\x18\x30\x3a\x3b\x6e\xfd\x16\x74\x76\xa7\x19\x6c\x77\x36\xbd\xdd\xa2\xb1\xb9\x69\xe0\xfa\x7e\x4f\xcb\x5d\xcf\x6f\xdb\x3a\x5a\x2f\x51\xcd\x44\x91\xb6\xd4\x84\x84\x84\x06\xa8\x39\xa3\xa1\xd0\x72\xd3\x08\x35\x67\x34\x94\x8d\xe8\x82\x87\xc5\x97\xd8\x8c\x2f\x23\xc6\xe3\xcb\x08\x7a\xf5\xb0\xdc\xed\x82\x95\x34\xc6\xa5\x5a\xaa\x0e\xd2\x31\xb9\xe3\x83\x63\x1e\xcc\x9d\x2c\xe7\x60\xad\x6c\x77\xcd\x5a\x2c\x81\xee\x57\x0e\x2d\x77\xef\x4a\x5e\x31\xfd\x8b\x25\x7c\x1d\xb4\xa3\xfb\xd8\x12\x5e\xb8\x05\x62\x76\xf5\x8c\x2f\xc7\xbe\x4d\x07\xea\xfa\x21\xcf\x14\x9c\x23\xd0\x0c\x0c\x0b\xb0\x35\xed\xb9\x40\x85\x3a\xa3\x50\x74\x9c\x3f\xd5\x1a\xf0\x26\xab\x56\x25\xce\x41\xd5\x16\x32\x70\x11\x4a\x9d\x6f\x29\xaf\x10\xac\xac\x30\x3d\xae\x3f\xa5\xa4\xe5\x19\xc5\xa4\xd3\xd3\x15\x90\xf4\x4d\xa6\xcd\x65\x56\xce\x5a\x6f\x4b\x5e\xd1\x86\x08\x21\x23\xd2\xce\xd5\x65\x19\xf9\x66\x9c\x59\x8c\x98\x3b\x9e\x36\xbd\x70\x4d\xdd\x4c\x2f\x7c\x99\xa7\xf4\xc2\x1f\x87\xd2\x0b\x31\xcf\x64\x71\xe3\x6e\xac\x05\xde\x74\x2b\x10\x8b\xbe\x6b\xce\x7e\x41\x04\xa7\x2d\x55\x62\x1f\x44\xb2\xb8\xa1\x36\x97\xe2\x96\x8b\xee\xa2\x59\xe0\xe7\x7e\x44\xbb\x95\x36\x9e\xe3\x30\x71\x2b\x9d\x20\xb9\xf7\x96\x7a\x0c\xfd\xec\x8d\xdf\x16\xbd\xa9\x68\x96\xd7\x38\xb3\xfb\x54\x43\x06\xff\x7d\xf7\xeb\xb1\x63\xa6\x56\xc5\xbf\xe8\x02\xf9\x45\xd3\x16\x27\xe0\x5d\x67\x56\xc2\xff\x3c\x42\x9d\x43\x67\x26\x9c\xed\x3a\x20\x7f\x52\x02\xb3\x73\x38\x39\x3d\xbf\xb5\xc8\xef\xbc\xcd\xc5\x86\x32\x27\xf3\x3a\xcc\x78\xb2\xe7\x41\xf3\x63\x21\xa6\xcd\x92\x8d\x4a\x2d\x15\x4f\x73\x67\x7e\x06\x4b\xf5\xfc\x57\xe1\x75\x48\x12\x8a\x0a\xe6\xfb\xcc\xfa\x29\x45\xf0\x4d\x93\x3a\x57\xa1\xd1\x4f\x90\xcb\x6e\xb9\x47\xed\xf0\x58\x34\xc5\xc3\xf8\xda\x81\xa1\x70\xb4\xa3\xd7\xa8\xc7\x84\xfa\x1a\xb5\x96\x05\x36\xe3\xa8\x78\x35\x1d\x4c\x3e\x1e\xa9\xc8\xca\x59\xc2\x11\x33\x9e\x81\x3a\x06\xb2\x0b\x3e\xbd\x85\xdc\x72\x36\x67\x65\x02\x29\x0a\xc2\x41\x8d\x22\x4f\x71\x96\xc7\x05\xe3\x9e\xc7\xf5\xc2\x8c\x03\xf7\xc5\x4b\xc8\x56\x2b\x54\xc5\xcc\x13\xe6\x6d\x7f\x19\x85\xf5\x2c\x49\x3c\x4c\x7e\x2a\x1b\x1b\xe0\x67\xba\xcf\x69\x82\xcb\x35\x8d\x11\x5e\x07\x6f\x46\x98\x28\x47\x86\x1c\x05\x25\xe3\x5c\x35\x68\x4d\xef\xa5\xd3\x78\xf9\xe9\xdf\x79\xff\x18\x1e\x44\x3f\xfd\x39\x9e\xb1\x53\x3d\x4c\xe2\x53\xe1\x07\x55\x75\x92\x21\x67\x34\xc3\x75\x4b\x5e\xa3\x82\xf3\xb5\x10\xa8\x81\x72\xa0\x2f\x07\x61\x0e\x4d\x79\xad\x27\x61\x76\xbe\x16\x3e\x89\xb9\xae\x92\x89\xf3\xb1\x54\xd6\x81\x81\x34\x6c\xc4\x39\x41\x73\x30\xdb\x81\x40\xad\x63\x87\x10\x51\xa8\xfb\x72\x41\x2c\xed\x19\x22\xf5\x15\xdb\xcc\x36\x25\x6f\x8a\x76\xb2\xa3\x7a\x19\x97\xcb\x26\xdf\xd1\x27\xe3\x67\xdc\xb6\x0e\xf3\x72\xbe\xab\xc5\xf9\xdd\x03\x36\x33\xe0\x61\x49\xa0\x9f\x34\xfb\x05\x81\x60\x73\xba\x91\xf4\x4e\x7c\x75\x72\xed\x96\xe8\x8a\x21\x92\x73\xa8\xa2\x90\x61\x95\xe9\xa2\x92\x55\xbe\x15\x1a\x2e\x15\xd5\x4d\x53\x26\xa6\x93\x89\xbf\xf2\xc6\xda\xf8\xc4\x58\xdd\x24\x2d\xdc\x03\xc8\x76\xfb\x35\x77\x7a\xe3\xb7\x2a\xf2\x5a\xa7\x2f\x29\xfc\xb1\xf3\x4e\x45\xfb\x46\x27\xae\x77\xf1\xe7\xb7\x57\x9b\x6e\x34\xbb\x6d\x03\xaa\x7c\xae\x2e\xa4\x8c\xeb\xa9\x9a\xf9\xe4\x12\x5e\x84\xcf\x2c\x91\xd2\x89\xaf\xb7\x1f\xe7\x44\xf2\xdf\xac\x10\xd1\x6a\x6e\x4e\x26\xd1\xd7\x25\x0b\x90\xf3\x56\x78\x70\xd6\x28\x5d\xf9\x6e\x07\x8c\x08\x80\x8c\x15\x89\xa7\x06\x7d\xac\x38\x3c\xa8\x3a\x90\xd4\x6d\xf5\xe1\x19\xb4\x1f\xad\x0b\x8f\x29\x0c\x74\x00\x7f\x7f\x18\x9b\xc1\xc5\xe1\xc9\xfd\xbe\xd5\x9f\x8e\x0c\xda\xf3\x37\x9d\x91\xee\x3f\xb3\x42\x4f\xe8\x8f\x41\x0d\xff\x6d\x67\x6c\xab\xaf\x50\x4f\x69\xac\x14\xc0\x07\x75\x04\x99\xd4\x7f\x2b\x1b\x59\xfa\xd6\xeb\xd3\x33\xf5\xb3\xed\x1a\x68\x0b\xab\x9b\x81\x96\x70\xb8\x27\xec\x16\x84\x6e\x35\xf0\x31\xcc\xe5\x80\xef\x9d\x0f\x28\x07\x9d\x16\x73\xb4\x1e\x8c\xa7\xe0\xcf\xae\x08\xc3\x09\x76\xbf\xfc\x3a\xee\x04\x4d\xf9\x1c\xcd\x9c\xe1\xf5\xd0\x9e\x5d\x09\x70\x03\xf3\x41\xec\xe2\x4e\x6d\x14\xba\xb1\x18\xfe\x4c\xe0\x86\x22\x74\xdf\x00\x6d\xe2\x93\x7d\xb3\xf1\x61\x91\x95\x3c\x1c\xbd\xdf\xdb\xe4\x4e\xd7\x38\x6a\xf3\x78\x30\xef\x6f\xf5\x60\xa8\xee\x17\xa9\xfb\x99\xd3\x0b\x37\xb5\x79\x5d\xa3\xc8\xcc\xd7\x5a\xcf\xa1\xbe\xe2\xce\x39\x0a\xdc\x93\x4c\xf9\x1e\xe5\x94\xb4\xfd\xa2\xbe\xf2\x3a\x0e\x6f\x72\x3a\xab\xc6\xce\x60\x63\x15\x64\xbb\x73\x52\x8f\x4f\xfa\x06\xf5\x05\xea\xe4\x15\xec\x96\x59\xf1\xe6\x59\xa6\x12\x3f\x72\x60\x4b\x91\xc7\xf0\x0f\xb2\x13\xf7\xb1\x73\x6c\xd3\x63\xec\xdc\x22\x73\xcc\x4e\x01\x3c\x4b\x7e\x90\xa1\x62\x1f\x43\xc7\x36\x3d\xc6\xd0\x2d\x32\x77\x1b\xda\xde\x29\xda\x90\x73\xfa\x36\x73\x38\xf8\xfb\x6f\xf7\x74\xa4\x44\x9d\x1e\xaf\x2b\xd4\x32\xf7\x65\x26\x8a\x09\xa7\xaf\x6a\x81\x88\x47\x78\xe9\x4c\x94\x75\x66\xbf\xfb\x36\xe9\x00\x31\x50\x70\xd7\x0a\x6f\x56\x98\x5b\x2c\x7a\xb3\x49\x1a\x8b\x36\x13\xd1\x05\x8f\x44\xe3\x89\xa8\xf9\x24\x6d\x7e\x09\x96\x4f\x27\x55\x5d\xf7\xff\x8a\x5e\x51\x66\x10\x2c\xfc\x67\x09\xf1\x2f\x61\xec\x3f\xe1\xc5\x0b\xb0\xf0\xef\x1e\xf9\xbb\x6f\x17\x84\x68\x6f\x08\xc9\x73\x56\x07\xe2\x90\xb8\x0f\x72\x58\xde\x07\x39\x2a\x70\xdd\x4a\x1c\xaa\xc9\x6d\x51\x84\x4f\x3a\x5b\x99\xf8\x37\x54\x9e\x9e\xa9\x82\x6f\x41\x81\x50\xa1\xbd\xac\x0b\xf8\x24\xed\x25\x68\xcc\xeb\x6b\xbe\xfa\xa2\x32\x6b\x8d\xa0\x6a\x58\x65\x4a\xe6\x06\xa4\x02\x7f\x4f\x95\xea\xc2\x57\xf2\xa8\x08\x8b\x22\xfa\xb9\x08\x78\x62\x02\x27\xa7\xed\x6f\x9c\xee\x13\x98\xf9\x7a\x1b\x91\xfb\x83\xbf\x02\xdd\xe5\xdb\x89\xf7\xfe\x22\x05\x5c\x53\xe9\x61\xe5\xdc\x2d\xf6\xba\x53\x7f\x69\x16\xdc\x71\x89\x2f\xdf\x07\xeb\x58\xf9\xe6\x3b\x9a\x39\x5c\xd3\x05\x47\x84\xda\x4b\x5e\x48\x2d\x8e\xbb\xe7\x05\xef\x2a\xd2\x60\xc0\xbc\x87\x2e\x5f\x07\x36\xc0\x65\xf2\x63\xa1\x8c\x27\x60\x31\x9a\x4c\x0f\x60\xd2\x37\x9b\x0e\x4b\xbe\xa7\xb4\xc4\xe7\x40\xb2\x63\x5f\x07\x4c\x06\x12\xfd\xf5\x68\x10\xc7\x98\x79\x13\xca\x70\x2f\xd9\x00\x33\x2c\x3c\x16\xce\xee\x3c\x2e\x06\x34\xac\x04\x48\x79\x54\xef\x30\x0d\x77\xa7\x88\xfe\x8c\xb0\x06\x4b\x07\x80\x95\xcd\xad\x6d\x1b\xb4\x8d\x21\x7d\x70\x79\x4e\xb3\x01\x2d\x93\x1f\x0b\xec\xb6\xf9\xcd\x8c\xef\x3f\x8c\xdf\x9b\x76\x86\xf3\x2c\xf8\xb1\x39\x03\xe8\xb1\x12\xdb\xb1\x63\x2b\x36\x90\xe3\x7e\x76\x03\x39\x26\x3f\x16\xb9\x4e\xbb\x1e\x39\x24\xd3\x83\x3b\xba\x27\xf2\x46\xee\xb3\x5b\xe2\x33\x42\xc9\xf6\x0d\x40\x79\xe9\xfb\xfb\x6d\x50\x7a\xf5\xfb\x50\xfa\x46\x79\x03\x4b\x4f\x7f\x2c\x98\xdd\x8b\x40\x84\xa6\x5f\x48\xc8\x37\xfd\x61\x0e\x4e\xdf\xcc\xb7\xd4\x67\xc4\xd3\x1f\x3b\x00\xe8\x2a\x5c\x1f\xb6\x21\x1a\x4c\x98\x77\xee\x0e\xcd\xb0\xd2\x42\x3c\xae\x4c\x3a\x4f\x74\x59\xae\x35\xd8\xf4\x17\xa9\x8a\x59\x02\xcb\x65\xb3\xfe\xd6\x52\xa7\x36\xb1\xb0\x04\x9b\xbe\x2e\xb1\x9a\x75\x5a\x09\x3b\xbd\x9f\xfe\x3f\x00\x00\xff\xff\x45\x25\x59\xe5\xac\x31\x00\x00") +var _schemaGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x5a\x5f\x6f\xdc\x36\x12\x7f\xde\xfd\x14\x53\x03\x0d\xb4\xc1\x56\xee\x15\x45\x71\xb7\xb9\x3d\xa0\x68\x53\xd4\xd7\x8b\x1b\x34\x49\x5f\x0c\xc3\xa5\xa5\x91\xcd\x58\xa2\xb6\x24\xd7\xb1\xeb\xfa\xbb\x1f\x38\x43\x4a\x94\x56\xda\xdd\xf8\x4f\x5e\xb2\x1a\xce\x0c\x67\x7e\x9a\x7f\xa4\x7c\x78\x08\x3f\xd4\xab\x5b\x2d\x2f\x2e\x2d\x7c\xf3\xf5\x3f\xfe\xf5\xd5\x4a\xa3\x41\x65\xe1\x27\x91\xe1\x79\x5d\x5f\xc1\x91\xca\x52\xf8\xbe\x2c\x81\x98\x0c\xb8\x75\x7d\x8d\x79\x3a\x3d\x3c\x84\xf7\x97\xd2\x80\xa9\xd7\x3a\x43\xc8\xea\x1c\x41\x1a\x28\x65\x86\xca\x60\x0e\x6b\x95\xa3\x06\x7b\x89\xf0\xfd\x4a\x64\x97\x08\xdf\xa4\x5f\x87\x55\x28\xea\xb5\xca\x9d\x0a\xa9\x88\xe5\x7f\x47\x3f\xbc\x3e\x7e\xf7\x1a\x0a\x59\x62\xa0\xe9\xba\xb6\x90\x4b\x8d\x99\xad\xf5\x2d\xd4\x05\xd8\x68\x3f\xab\x11\xd3\xe9\x74\x25\xb2\x2b\x71\x81\x50\xd6\x22\x9f\x4e\x65\xb5\xaa\xb5\x85\x64\x3a\x39\x40\x95\xd5\xb9\x54\x17\x87\x1f\x4d\xad\x0e\xa6\x93\x83\xa2\xb2\xee\x3f\x8d\x45\x89\x99\x3d\x98\x4e\x27\x07\x17\xd2\x5e\xae\xcf\xd3\xac\xae\x0e\x0b\xef\xf0\x21\x2a\x62\x1b\x59\x3a\x34\xd9\x25\x56\x62\x37\xc7\x21\xe6\x17\xb8\x07\x5b\x21\xb1\xcc\xf7\xe0\x93\x2a\xc7\x9b\x83\xe9\x6c\xea\x40\x7b\x47\x34\xd0\xe8\x5f\x97\x01\xa1\x00\x95\x4d\xfd\x82\xbd\x14\x16\x3e\x09\x43\xa8\x60\x0e\x85\xae\x2b\x10\x90\xd5\xd5\xaa\x94\xee\xd5\x18\xd4\xe0\x91\x4b\xa7\xf6\x76\x85\x41\xa5\xb1\x7a\x9d\x59\xb8\x9b\x4e\x8e\x45\x85\xe0\xff\x19\xab\xa5\xba\x80\xfe\xbf\x3f\x1c\xb4\x8b\x03\x25\x2a\x9c\xd7\x95\xb4\x58\xad\xec\xed\xc1\x1f\xd3\xc9\x0f\xb5\x2a\xa4\xe7\x77\x66\xc5\xcf\x5d\xd9\x8c\x56\xba\xd2\xaf\xf3\x0b\x34\x9e\xed\xe4\xf4\xa5\x7b\x1c\xd9\xd9\x61\x6c\xba\xc2\x3f\x39\x3c\x4d\x23\x4c\x8f\xc3\xc2\x84\x7c\x4f\xfa\xc8\xa1\xec\x37\x3f\x39\x7d\x49\x8f\xc3\xd2\x92\x39\xbb\xe2\x3f\xd7\xf5\x55\x64\xf9\xdb\xda\x48\x2b\x6b\x35\x20\x7e\xe9\x38\xbb\xc2\x6f\xeb\x52\x66\xb7\xfb\x08\xaf\x88\xb3\x2b\xfd\xbd\x52\xb5\x15\x4e\xc0\x40\x25\x56\x27\xfc\xca\x4e\xa5\xb2\xa8\x5d\x3c\xdd\xdd\x07\x69\xd1\x72\x76\x54\xdc\x53\x68\x35\xdb\xe6\x68\x32\x2d\xcf\xd1\x80\x80\x55\x20\xfa\xcc\xe4\x98\xf4\x91\xd3\x48\xb4\xb1\x13\xe1\x26\x95\x05\x38\x3c\x04\x26\x79\x79\x82\xfe\xd0\x61\x00\xa5\x34\x36\x9d\x4e\xde\xc8\x1b\xcc\x8f\xc8\xd9\xf3\xba\x2e\xbd\x84\xcc\x84\x45\x03\xb2\x88\x76\x85\xfa\xfc\x23\x66\x1c\xde\x95\x93\xfa\x4a\x2a\x56\x20\x55\xd8\x84\xb7\x24\x12\xc8\x78\xe3\x8a\x48\xbc\x27\xfb\xcb\x01\xb2\x99\x49\x4c\x7f\x40\x22\xb1\xe0\x70\x1e\x8d\x66\xd2\x78\x2a\x1d\xa9\xa2\x6e\xd9\x5e\x12\x72\xe9\xfb\xdb\x15\x76\x16\xbc\xb8\x33\xa0\x2b\xfe\x5e\xc4\x9b\xed\xd8\xdd\x8a\x5e\x26\xbe\x93\x7f\x45\xb6\xbf\x94\xca\x7e\xf7\xed\xa8\xb4\x91\x7f\xf5\x36\x7f\xad\xd6\x95\x69\xd8\x4e\x4e\x19\x94\x3b\x38\x9e\xc3\xef\xc1\x96\x26\x2c\xd1\x31\x77\xe5\x3f\x28\xf9\xe7\xba\x31\x80\xe2\x62\xe0\x9f\x97\x5f\x13\x73\x57\xc1\xb1\x2c\x4b\x71\x5e\xe2\x5e\x0a\x94\x67\xee\xaa\xf8\x75\xe5\x62\x5b\x94\x7b\xa9\xa8\x3d\x73\x57\xc5\x8f\x58\x88\x75\x69\xf7\x73\x23\x67\xe6\x41\x0d\xbf\x8b\xd2\xc1\x11\xe7\xf4\xb8\x86\xb3\x6b\xc7\x3d\xa8\xe7\x17\xa9\x5c\x4d\xf4\x9d\x30\xf5\x8f\x63\x7a\xae\xa4\xca\x7b\xef\x65\x95\x0b\x8b\xc1\xad\x5d\xef\x85\x98\xcf\x06\xfd\x3a\xaa\xaa\xb5\x6d\x5e\xd0\x0e\x45\x32\x30\x77\x75\xfc\x2e\x4a\x99\x0b\x5b\x6b\x8a\x34\xca\xfd\x71\x1d\xd7\x0d\x73\x2f\xd0\x6d\xad\xc5\x05\xfe\x82\x54\x7f\x77\xa4\x89\x61\xe6\xb3\x2b\xbc\xed\x57\xf0\xb8\x64\x0f\x56\xf0\xb8\x88\xf3\x6a\xcf\x10\x54\x8e\x7c\xbd\x17\x22\x26\x30\xf7\x74\x50\x9d\x74\x35\xc2\xf1\x46\xcd\xa0\xe3\x57\xd0\x41\xcc\x67\x9b\x95\x23\x6e\x28\x30\xd6\x52\xf6\xeb\x29\xd4\xc1\x37\x4b\x2c\x91\x1f\x50\x61\x49\xee\x69\x06\x95\x00\xd2\x6e\xd9\xed\xa5\x75\x87\x6c\xbf\xae\xfe\x86\x45\x63\xf5\x76\x51\x8d\xc5\xd9\xa6\xd9\xbf\x61\xd1\x30\x0e\xce\x47\xb1\xfc\x78\x4d\x1d\x09\xaf\x2d\x05\xf5\x48\x5d\xa3\x36\x5b\x83\xb3\x99\x8f\x88\xb3\x6f\xf7\x9f\x6b\xa9\x31\xdf\x2d\xae\x3d\xe7\x78\x9a\xbe\x74\xc3\x5f\xda\x4d\xdc\x3d\x72\xf4\xa9\xe6\x24\x1e\x35\x36\x83\x9a\xe9\x0f\x88\x6a\x16\x6c\xc3\x3a\x7a\x51\x0d\x54\x5b\xde\x4c\x34\x34\x9f\x84\x44\xdf\x6b\x4a\xee\x73\x0f\x8d\xc5\x11\xca\x4d\xb8\xee\x00\x9a\x51\x3a\xc6\x4f\x14\x9e\x99\x46\x9a\xe4\x84\x0a\x88\x38\xa3\x18\x16\xfa\xc5\xd3\xe6\xca\xd6\x3a\x9d\x16\x6b\x95\x05\xc9\x04\x73\xff\xa6\x7f\x6c\x38\x66\x3e\xe6\xef\xa6\x13\x85\xb0\x58\xc2\x0b\xf7\x78\x37\x9d\xb8\x94\x5c\x34\x91\x84\x79\xfa\x5e\x5c\xcc\x1d\xf9\x76\x85\x8b\x98\xec\x72\x79\x3a\xa1\xca\x11\xd3\xdd\xb3\xa3\x33\xf4\x8b\x86\xce\xcf\x6e\xc5\xc7\xff\x22\xac\xf8\x67\xb7\x14\x62\x7b\xe1\x97\xc2\x33\xaf\x15\xed\x5e\xb4\x56\x84\xbd\x5a\x68\x17\xb4\xd4\x3e\xbb\xd5\x28\x5a\x17\x50\x89\x2b\x4c\x86\x63\x76\x36\x9f\x4e\xee\xa7\x93\xa2\xd6\x70\x36\x07\x61\x1d\x2a\x5a\xa8\x0b\x74\x2a\xe3\x90\x77\x28\x29\x4c\x45\x9e\xb7\xd4\x44\xd8\x19\x89\xcb\xc2\xcd\x04\x4e\x96\x6d\x7c\x45\x8f\x5f\x2c\x41\xc9\x32\x48\xba\xd2\xb3\x6c\xde\x8e\xc6\x62\xc6\xf4\x28\x44\x96\xc0\x7c\x11\x8d\xd4\x6b\xb4\x6b\xad\x40\x61\x1b\x1c\x3c\x2c\x6f\x46\x07\x05\x21\x87\x07\xff\x1c\x8a\x0f\x12\x4e\x8a\x3c\x4c\xc5\x71\x84\x24\x7c\xf2\x9b\x03\x6a\xed\x9e\xef\xc8\xbb\x22\x4f\x5f\x6b\x1d\x7b\x14\x6c\x92\xe5\x1c\x8a\xca\xba\xe5\x5a\x17\x09\x67\x01\x7c\xf9\xe7\x02\xbe\xbc\x3e\x98\x3b\x41\x7a\x61\x5e\x03\xc3\x65\x08\xaa\x17\xb4\xd1\x5d\x3f\x9c\xa0\x91\xa1\xb0\x29\xea\xee\x8a\xa3\xcc\xfb\x11\x4b\x2b\x3e\x66\x69\x76\x5e\xc4\x0b\x44\xd9\x08\x4f\x5a\x6a\x03\x34\x4c\xbc\x8b\xd6\x86\x30\xd6\x4e\x27\xcd\x30\xdb\xae\x06\x8a\x5b\xf5\x03\xdd\xa2\xd5\x1b\x46\x3c\x06\x8c\xf6\x8e\x47\xbf\x05\xed\xdd\x19\x06\x5b\xce\x66\xb6\x5b\x34\x3e\x37\x03\x5c\x3f\xee\x69\xb9\x1b\xf9\xed\x58\x47\xeb\x25\xaa\xa4\xc8\xd3\x96\x3a\x23\x25\x61\x00\x6a\xf6\x68\x28\xb4\xdc\x0c\x42\xcd\x1e\x0d\x65\x23\xbb\xe0\x61\xf9\x55\x6c\xe6\x97\x29\xc6\xf3\xcb\x14\xf4\xea\x61\xb9\x3b\x04\x2b\x69\x8c\x2b\xb5\xd4\x1d\xa4\x13\x72\xdb\x87\xc0\x3c\x98\x3b\x5d\x2e\xc0\x5a\xdd\xee\xb4\xb6\x58\x02\x1d\xd3\x1c\x5a\xee\xf8\x36\x7b\xc5\xf4\x2f\x96\xf0\x75\xb0\x8e\x8e\x75\x4b\x78\xe1\x16\x22\xc3\xc2\x3b\xf4\x5c\xf1\x61\x61\xd9\x1c\x16\x1c\x76\xbf\x16\x49\x1b\x1c\x33\x3a\x3f\x24\x6c\x85\x6b\x8c\x7c\x58\xf7\xf3\x3e\xd0\x29\x04\x32\xa1\xe0\x1c\x81\xee\xe4\x30\x07\x5b\x13\xcf\x05\x2a\xd4\x82\x72\xda\x49\xfe\x54\x6b\xc0\x1b\x51\xad\x4a\x9c\x83\xaa\x2d\x08\x70\xa9\x4e\x23\x74\x29\xaf\x10\xac\xac\x30\x3d\xae\x3f\xa5\x64\xf1\x19\x25\xb7\x73\xd8\x75\xa2\xf4\x8d\xd0\xe6\x52\x94\xb1\x65\xaf\x88\x21\x82\xba\xf5\x8a\x8f\x52\xcb\x28\xc8\xe3\x12\x65\x8a\xb9\x93\x69\xeb\x14\x37\xe7\xcd\x3a\xc5\x97\x0b\x54\xa7\xf8\xe7\x50\x9d\x22\xe1\x44\xe6\x37\xee\x04\x9d\xe3\x4d\xb7\x95\xb1\xea\xbb\x66\xef\x17\x44\x70\xd6\x52\x4b\xf7\xd9\x28\xf3\x1b\x9a\x97\xa9\x00\x70\xf7\x5e\x34\x0b\xfc\xdc\x2f\x0d\x6e\xa5\x2d\x0c\x71\xbe\xb9\x95\x4e\xb6\xdd\x7b\x4f\x3d\x86\xfe\x2e\x90\xdf\x16\xbd\xa9\xe8\x6e\xb1\xc9\x0a\xf7\xab\x06\x01\xff\x7d\xf7\xeb\xb1\x13\xa6\x99\xc7\xbf\xe8\x1c\xf9\x45\x13\x8b\x53\xf0\xae\x73\x77\xc3\xff\x79\x84\x3a\x9b\x26\x26\xec\xed\x46\x29\xbf\xd3\x0c\x92\x73\x38\x39\x3d\xbf\xb5\xc8\xef\xbc\x2d\xea\x86\x4a\x30\xcb\x3a\xcc\xf8\xa6\xd1\x83\xe6\xaf\xa9\x98\x96\xcc\x36\x5a\xbe\x54\x7c\xbb\x9c\xf4\x82\x9b\xe5\x66\x33\x4a\x2f\x96\xfb\xcc\x46\x2c\x8b\x10\x9b\x26\x75\xa1\x42\x57\x51\x41\x2f\x87\xe5\x1e\x4d\xc8\x63\xd1\x74\x21\xe3\x9b\x10\x86\x0e\xd4\x5e\x05\x47\xc3\x2a\xd4\xd7\xa8\xb5\xcc\xb1\xb9\x1e\x8b\x57\xd3\xc1\x2a\xe6\x91\x8a\xbc\x4c\x66\x9c\x31\xe3\xa5\xac\xe3\x20\x87\xe0\xd3\x7b\xc8\xb3\x6b\xb3\x97\x28\x90\xb2\x20\x6c\xd4\x18\xf2\x14\x7b\x79\x5c\x30\x1e\x9e\xdc\x50\xcd\x38\xf0\x80\xbd\x04\xb1\x5a\xa1\xca\x13\x4f\x98\xb7\x83\x6a\x94\xd6\xc9\x6c\xe6\x61\xf2\xb7\xc4\xb1\x03\xfe\x8e\xf9\x39\x5d\x70\xb5\xa6\x71\xc2\xdb\xe0\xdd\x08\x37\xdc\x91\x23\x47\xc1\xc8\xb8\x56\x0d\x7a\xd3\x7b\xe9\x74\xdd\xfd\xf4\xef\xbc\xbf\x0d\x5f\x8c\x3f\xfd\x3e\x5e\xb0\xd3\x3d\xcc\xcc\x97\xc2\x0f\xaa\xea\x14\x43\xae\x68\x86\xfb\x96\xbc\x46\x05\xe7\xeb\xa2\x40\x0d\x54\x03\x7d\x3b\x08\xf7\xe2\x54\xd7\x7a\x1a\x92\xf3\x75\xe1\x8b\x98\x1b\x4f\x99\x38\x1f\x2b\x65\x1d\x18\xc8\xc2\x46\x9d\x53\x34\x07\xb3\x1d\x08\xd4\x3a\x0e\x88\x22\x4a\x75\xdf\x2e\x48\xa4\xdd\xa3\x48\x7d\xc7\x36\xc9\xa6\xe6\x4d\xd5\x4e\x77\xd4\x2f\xe3\x76\xd9\xd4\x3b\xfa\x65\xfc\x9d\xbb\xad\xc3\xfd\x3d\x1f\xfa\xe2\xfa\xee\x01\x4b\x0c\x78\x58\x66\xd0\x2f\x9a\xfd\x86\x40\xb0\x39\xdb\x48\x7b\x27\xbf\x3a\xb5\x76\x4b\x76\xc5\x10\xc9\x39\x54\x51\xca\xb0\xc9\x74\xe2\x11\x95\x9f\xa9\x86\x5b\x45\x75\xd3\xb4\x89\xe9\x64\xe2\xcf\xce\xb1\x35\xbe\x30\x56\x37\xb3\x16\xee\x01\x64\xbb\x83\x9f\xdb\xbd\x89\x5b\x15\x45\xad\xb3\x97\x0c\xfe\xd8\x79\xa7\x45\xfb\x46\x27\x6e\x76\xf1\xfb\xb7\x67\xa4\x6e\x36\x3b\xb6\x01\x53\x3e\xd7\x16\x32\xc6\xcd\x54\xcd\x45\xe7\x12\x5e\x84\xdf\xac\x91\xca\x89\xef\xb7\x1f\xe7\x44\xf2\x5f\x7a\x88\x68\x35\x0f\x27\x93\xe8\xf3\xcd\x02\xe4\xbc\x55\x1e\x82\x35\x2a\x57\x7e\xda\x01\x53\x04\x40\xc6\x9a\xc4\x53\x83\x3e\xd6\x1c\x1e\xd4\x1d\x48\xeb\xb6\xfe\xf0\x0c\xd6\x8f\xf6\x85\xc7\x34\x06\xda\x80\xbf\x67\xc6\x6e\x70\x73\x78\xf2\xb8\x6f\xed\xa7\x2d\x83\xf5\xfc\xe5\x35\xb2\xfd\x67\x36\xe8\x09\xe3\x31\x98\xe1\xbf\xbe\xc6\xbe\xfa\x0e\xf5\x94\xce\xca\x02\x78\xa3\x8e\x22\x93\xfa\xaf\xc4\x91\xa7\x6f\xbd\x3d\x3d\x57\x3f\xdb\xaf\x81\xb1\xb0\xba\x19\x18\x09\x87\x67\xc2\x6e\x43\xe8\x76\x03\x9f\xc3\xdc\x0e\xf8\x00\xfb\x80\x76\xd0\x19\x31\x47\xfb\xc1\x78\x09\xfe\xec\x8e\x30\x5c\x60\xf7\xab\xaf\xe3\x41\xd0\xb4\xcf\xd1\xca\x19\x5e\x0f\xf1\xec\x2a\x80\x1b\x98\x0f\x62\x17\x4f\x6a\xa3\xd0\x8d\xe5\xf0\x67\x02\x37\x94\xa1\xfb\x26\x68\x93\x9f\x1c\x9b\x4d\x0c\x17\xa2\xe4\x5b\xd6\xfb\xbd\x5d\xee\x4c\x8d\xa3\x3e\x8f\x27\xf3\xfe\x5e\x0f\xa6\xea\x7e\x99\xba\x9f\x3b\xbd\x74\x53\x9b\xc7\x35\xca\xcc\x6c\xad\xf5\x1c\xea\x2b\x9e\x9c\xa3\xc4\x3d\x11\xca\xcf\x28\xa7\x64\xed\x17\xf5\x95\xb7\x71\x98\xc9\xd9\xac\x1a\x3f\x83\x8f\x55\xd0\xed\xf6\x49\x3d\x3e\xe9\x1b\xd4\x17\xa8\x67\xaf\x60\xb7\xce\x8a\x99\x13\xa1\x66\xfe\xca\x81\x3d\x45\xbe\xcf\x7f\x90\x9f\xb8\x8f\x9f\x63\x4c\x8f\xf1\x73\x8b\xce\x31\x3f\x0b\xe0\x4b\xe9\x07\x39\x5a\xec\xe3\xe8\x18\xd3\x63\x1c\xdd\xa2\x73\xb7\xa3\xed\x99\xa2\x4d\x39\x67\x6f\x7b\xd9\xf8\xf7\xdf\xee\xe9\x48\x15\x75\x7a\xbc\xae\x50\xcb\xcc\xb7\x99\x28\x27\x9c\xbd\xaa\x05\x22\xbe\xc2\x4b\x93\xa2\xac\x85\xfd\xee\xdb\x59\x07\x88\x81\x86\xbb\x56\x78\xb3\xc2\xcc\x62\xde\xbb\x9b\xa4\xfb\xd5\xe6\x6a\x75\xc1\x77\xab\xf1\xd5\xaa\xf9\x24\x6d\x76\x09\x96\x77\x27\x53\xdd\xf4\xff\x8a\x5e\x91\x30\x08\x16\xfe\xb3\x84\xf8\x2f\x73\xec\x3f\xe1\xc5\x0b\xb0\xf0\xef\x1e\xf9\xbb\x6f\x17\x84\x68\xef\x12\x92\x2f\x6c\x1d\x88\x43\xea\x3e\xc8\x61\x7d\x1f\xe4\xa8\xc2\x75\xab\x71\xa8\x27\xb7\x4d\x11\x3e\x69\xb1\x32\xf1\xdf\x74\x79\xba\x50\x39\x9f\x82\x02\xa1\x42\x7b\x59\xe7\xf0\x49\xda\x4b\xd0\x98\xd5\xd7\x7c\xf4\x45\x65\xd6\x1a\x41\xd5\xb0\x12\x4a\x66\x06\xa4\x02\x7f\x4e\x95\xea\xc2\x77\xf2\xa8\x09\x17\x79\xf4\xe7\x2b\xe0\x89\x33\x38\x39\x6d\xff\xe6\xea\x7e\x06\x89\xef\xb7\x11\xb9\x7f\xf1\x97\xa3\x3b\x7c\x3b\xf5\x3e\x5e\x64\x01\xd7\xd4\x7a\xd8\x38\x77\x8a\xbd\xee\xf4\x5f\xba\x0b\xee\x84\xc4\x97\xef\x83\x77\x6c\x7c\xf3\xb1\x67\x0e\xd7\x74\xc0\x29\x42\xef\xa5\x28\xa4\x11\xc7\x9d\xf3\x42\x74\xe5\x69\x70\x60\xde\x43\x97\x8f\x03\x1b\xe0\x32\xf9\xb1\x50\xc6\x37\x60\x31\x9a\x4c\x0f\x60\xd2\x27\x52\x87\x25\x9f\x53\x5a\xe2\x73\x20\xd9\xf1\xaf\x03\x26\x03\x89\xfe\x78\x34\x88\x63\x2c\xbc\x09\x65\x38\x97\x6c\x80\x19\x16\x1e\x0b\x67\xf7\x3e\x2e\x06\x34\xac\x04\x48\xf9\xaa\xde\x61\x1a\xce\x4e\x11\xfd\x19\x61\x0d\x9e\x0e\x00\x2b\x9b\x53\xdb\x36\x68\x1b\x47\xfa\xe0\xf2\x3d\xcd\x06\xb4\x4c\x7e\x2c\xb0\xdb\xee\x6f\x12\x3e\xff\x30\x7e\x6f\xda\x3b\x9c\x67\xc1\x8f\xdd\x19\x40\x8f\x8d\xd8\x8e\x1d\x7b\xb1\x81\x1c\xcf\xb3\x1b\xc8\x31\xf9\xb1\xc8\x75\xc6\xf5\x28\x20\x99\x1e\xc2\xd1\x3d\x51\x34\xf2\x9c\xdd\x12\x9f\x11\x4a\xf6\x6f\x00\xca\x4b\x3f\xdf\x6f\x83\xd2\x9b\xdf\x87\xd2\x0f\xca\x1b\x58\x7a\xfa\x63\xc1\xec\x1e\x04\x22\x34\xfd\xc2\x8c\x62\xd3\x6f\xe6\xe0\xf4\xc3\x7c\x4b\x7d\x46\x3c\xfd\xb6\x03\x80\xae\xc2\xf1\x61\x1b\xa2\xc1\x85\x79\xe7\xec\xd0\x5c\x56\xda\xce\x67\xdb\x59\xe7\x89\x0e\xcb\xb5\x06\xeb\xbf\xdf\xc2\xb2\xfd\xc8\xfb\xd6\xd2\xa4\x36\xb1\xb0\x04\x9b\xbe\x2e\xb1\x4a\x3a\xa3\x84\x9d\xde\x4f\xff\x1f\x00\x00\xff\xff\xa6\x55\xc8\xfc\x3c\x32\x00\x00") func schemaGoBytes() ([]byte, error) { return bindataRead( @@ -113,7 +113,7 @@ func schemaGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "schema.go", size: 12716, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "schema.go", size: 12860, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/load/schema.go b/entc/load/schema.go index 95e4657ec..e6e850777 100644 --- a/entc/load/schema.go +++ b/entc/load/schema.go @@ -47,6 +47,7 @@ type Field struct { Optional bool `json:"optional,omitempty"` Default bool `json:"default,omitempty"` DefaultValue interface{} `json:"default_value,omitempty"` + DefaultKind reflect.Kind `json:"default_kind,omitempty"` UpdateDefault bool `json:"update_default,omitempty"` Immutable bool `json:"immutable,omitempty"` Validators int `json:"validators,omitempty"` @@ -133,6 +134,9 @@ func NewField(fd *field.Descriptor) (*Field, error) { if size := int64(fd.Size); size != 0 { sf.Size = &size } + if sf.Default { + sf.DefaultKind = reflect.TypeOf(fd.Default).Kind() + } // If the default value can be encoded to the generator. // For example, not a function like time.Now. if _, err := json.Marshal(fd.Default); err == nil { diff --git a/entc/load/schema_test.go b/entc/load/schema_test.go index 35d2ec717..9d197c885 100644 --- a/entc/load/schema_test.go +++ b/entc/load/schema_test.go @@ -8,6 +8,7 @@ import ( "context" "encoding/json" "math" + "reflect" "testing" "time" @@ -170,10 +171,12 @@ func TestMarshalSchema(t *testing.T) { require.Equal(t, "sensitive", schema.Fields[5].Name) require.Equal(t, field.TypeString, schema.Fields[5].Info.Type) require.True(t, schema.Fields[5].Sensitive) + require.Equal(t, reflect.Invalid, schema.Fields[5].DefaultKind) require.Equal(t, "creation_time", schema.Fields[6].Name) require.Equal(t, field.TypeTime, schema.Fields[6].Info.Type) require.Nil(t, schema.Fields[6].DefaultValue) + require.Equal(t, reflect.Func, schema.Fields[6].DefaultKind) require.Equal(t, "uuid", schema.Fields[7].Name) require.Equal(t, field.TypeUUID, schema.Fields[7].Info.Type) diff --git a/examples/privacyadmin/ent/internal/schema.go b/examples/privacyadmin/ent/internal/schema.go index 58c5156f7..1753a3bb4 100644 --- a/examples/privacyadmin/ent/internal/schema.go +++ b/examples/privacyadmin/ent/internal/schema.go @@ -9,4 +9,4 @@ // Package internal holds a loadable version of the latest schema. package internal -const Schema = `{"Schema":"github.com/facebook/ent/examples/privacyadmin/ent/schema","Package":"github.com/facebook/ent/examples/privacyadmin/ent","Schemas":[{"name":"User","config":{"Table":""},"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"Unknown","position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":false,"MixinIndex":0}]}],"Features":["schema/snapshot","privacy"]}` +const Schema = `{"Schema":"github.com/facebook/ent/examples/privacyadmin/ent/schema","Package":"github.com/facebook/ent/examples/privacyadmin/ent","Schemas":[{"name":"User","config":{"Table":""},"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"Unknown","default_kind":24,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":false,"MixinIndex":0}]}],"Features":["schema/snapshot","privacy"]}` diff --git a/examples/privacytenant/ent/internal/schema.go b/examples/privacytenant/ent/internal/schema.go index 54536e272..9ac33a887 100644 --- a/examples/privacytenant/ent/internal/schema.go +++ b/examples/privacytenant/ent/internal/schema.go @@ -9,4 +9,4 @@ // Package internal holds a loadable version of the latest schema. package internal -const Schema = `{"Schema":"github.com/facebook/ent/examples/privacytenant/ent/schema","Package":"github.com/facebook/ent/examples/privacytenant/ent","Schemas":[{"name":"Group","config":{"Table":""},"edges":[{"name":"tenant","type":"Tenant","unique":true,"required":true},{"name":"users","type":"User","ref_name":"groups","inverse":true}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"Unknown","position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"Tenant","config":{"Table":""},"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"User","config":{"Table":""},"edges":[{"name":"tenant","type":"Tenant","unique":true,"required":true},{"name":"groups","type":"Group"}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"Unknown","position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1}]}],"Features":["privacy","entql","schema/snapshot"]}` +const Schema = `{"Schema":"github.com/facebook/ent/examples/privacytenant/ent/schema","Package":"github.com/facebook/ent/examples/privacytenant/ent","Schemas":[{"name":"Group","config":{"Table":""},"edges":[{"name":"tenant","type":"Tenant","unique":true,"required":true},{"name":"users","type":"User","ref_name":"groups","inverse":true}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"Unknown","default_kind":24,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"Tenant","config":{"Table":""},"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"validators":1,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":false,"MixinIndex":0}]},{"name":"User","config":{"Table":""},"edges":[{"name":"tenant","type":"Tenant","unique":true,"required":true},{"name":"groups","type":"Group"}],"fields":[{"name":"name","type":{"Type":7,"Ident":"","PkgPath":"","Nillable":false,"RType":null},"default":true,"default_value":"Unknown","default_kind":24,"position":{"Index":0,"MixedIn":false,"MixinIndex":0}}],"policy":[{"Index":0,"MixedIn":true,"MixinIndex":0},{"Index":0,"MixedIn":true,"MixinIndex":1}]}],"Features":["privacy","entql","schema/snapshot"]}`