From c8a65276123719288a38d2286f9117cefc3a3266 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Sun, 11 Oct 2020 21:06:10 +0300 Subject: [PATCH] schema/mixin: add support for mixed-in annotations --- ent.go | 3 +++ entc/load/internal/bindata.go | 4 ++-- entc/load/schema.go | 10 +++++++--- entc/load/schema_test.go | 26 +++++++++++++++++++++++--- schema/mixin/mixin.go | 3 +++ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/ent.go b/ent.go index 6c3388f20..9db0eae74 100644 --- a/ent.go +++ b/ent.go @@ -153,6 +153,9 @@ type ( // Policy returns a privacy policy to add to the schema. // Note that mixin policy are executed before schema policy. Policy() Policy + // Annotations returns a list of schema annotations to add + // to the schema annotations. + Annotations() []schema.Annotation } // The Policy type defines the write privacy policy of an entity. diff --git a/entc/load/internal/bindata.go b/entc/load/internal/bindata.go index e19198524..11be66a98 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\xdc\x36\x12\x7f\xde\xfd\x14\x13\x03\x35\xa4\x60\x2b\xf7\x8a\xa2\xb8\xdb\xdc\x1e\x50\xb4\x29\xea\xeb\xd5\x0d\x9a\xa4\x2f\x86\xe1\xca\x12\xe9\x65\x2c\x91\x5b\x92\xeb\xd8\x75\xfd\xdd\x0f\x9c\x21\x29\x4a\xab\x5d\x6f\xe2\x3f\x2f\x59\x0d\x39\xff\x7e\x9a\x19\x0e\x47\x39\x3a\x82\xef\xd5\xea\x56\x8b\xcb\xa5\x85\xaf\xbf\xfa\xc7\xbf\xbe\x5c\x69\x66\x98\xb4\xf0\x63\x59\xb1\x0b\xa5\xae\xe0\x58\x56\x05\x7c\xd7\x34\x80\x9b\x0c\xb8\x75\x7d\xcd\xea\x62\x7a\x74\x04\xef\x96\xc2\x80\x51\x6b\x5d\x31\xa8\x54\xcd\x40\x18\x68\x44\xc5\xa4\x61\x35\xac\x65\xcd\x34\xd8\x25\x83\xef\x56\x65\xb5\x64\xf0\x75\xf1\x55\x58\x05\xae\xd6\xb2\x76\x22\x84\xc4\x2d\xff\x3b\xfe\xfe\xf5\xc9\xdb\xd7\xc0\x45\xc3\x02\x4d\x2b\x65\xa1\x16\x9a\x55\x56\xe9\x5b\x50\x1c\x6c\xa2\xcf\x6a\xc6\x8a\xe9\x74\x55\x56\x57\xe5\x25\x83\x46\x95\xf5\x74\x2a\xda\x95\xd2\x16\xb2\xe9\xe4\x80\xc9\x4a\xd5\x42\x5e\x1e\x7d\x30\x4a\x1e\x4c\x27\x07\xbc\xb5\xee\x1f\xcd\x78\xc3\x2a\x7b\x30\x9d\x4e\x0e\x2e\x85\x5d\xae\x2f\x8a\x4a\xb5\x47\xdc\x3b\x7c\xc4\x24\x6e\xdb\xb2\x74\x64\xaa\x25\x6b\xcb\x23\x56\x5f\xb2\x3d\xb6\x71\xc1\x9a\x7a\x8f\x7d\x42\xd6\xec\xe6\x60\x9a\x4f\x1d\x24\x6f\x91\x06\x9a\xf9\x97\x61\xa0\x94\xc0\xa4\x2d\xfc\x82\x5d\x96\x16\x3e\x96\x06\x7d\x66\x35\x70\xad\x5a\x28\xa1\x52\xed\xaa\x11\x0e\x78\xc3\x34\x78\x5c\x8a\xa9\xbd\x5d\xb1\x20\xd2\x58\xbd\xae\x2c\xdc\x4d\x27\x27\x65\xcb\xc0\xff\x19\xab\x85\xbc\x84\xe1\xdf\x1f\x0e\xb8\xf9\x81\x2c\x5b\x36\x53\xad\xb0\xac\x5d\xd9\xdb\x83\x3f\xa6\x93\xef\x95\xe4\xc2\xef\x77\x66\xa5\xcf\x7d\xde\x0a\x57\xfa\xdc\xaf\xeb\x4b\x66\xfc\xb6\xd3\xb3\x97\xee\x71\x8b\x66\x87\xb1\xe9\x33\xff\xe8\xf0\x34\x91\x19\x1f\xc7\x99\x11\xf9\x01\xf7\xb1\x43\xd9\x2b\x3f\x3d\x7b\x89\x8f\xe3\xdc\x82\x76\xf6\xd9\x7f\x52\xea\x2a\xb1\xfc\x8d\x32\xc2\x0a\x25\x47\xd8\x97\x6e\x67\x9f\xf9\x8d\x6a\x44\x75\xbb\x0f\xf3\x0a\x77\xf6\xb9\xbf\x93\x52\xd9\xd2\x31\x18\x68\xcb\xd5\x29\xbd\xb2\x33\x21\x2d\xd3\x2e\x9e\xee\xee\x03\x77\xd9\xed\xec\x89\xb8\xc7\xd0\x8a\x6a\x6b\x66\x2a\x2d\x2e\x98\x81\x12\x56\x81\xe8\xf3\x8e\x62\xd2\x47\x4e\xe4\xe8\x62\x27\xc1\x4d\x48\x0b\x70\x74\x04\x44\xf2\xfc\x08\xfd\x91\xc3\x00\x1a\x61\x6c\x31\x9d\xfc\x22\x6e\x58\x7d\x8c\xce\x5e\x28\xd5\x78\x0e\x51\x95\x96\x19\x10\x3c\xd1\x0a\xea\xe2\x03\xab\x28\xbc\x5b\xc7\xf5\xa5\x90\x24\x40\xc8\xa0\x84\x54\x22\x09\x44\xaa\xb8\x45\x12\xe9\x24\x7f\x29\x40\x36\x33\x89\xe8\x9f\x91\x48\xc4\x38\x9e\x47\x5b\x33\x69\x7b\x2a\x1d\x4b\xae\xba\x6d\x2f\x11\xb9\xe2\xdd\xed\x8a\xf5\x16\x3c\xbb\x33\xa0\xcf\xfe\xae\x4c\x95\x3d\xa0\xdd\x96\x83\x4c\x7c\x2b\xfe\x4a\x6c\x7f\x29\xa4\xfd\xf6\x9b\xad\xdc\x46\xfc\x35\x50\xfe\x5a\xae\x5b\x13\xb7\x9d\x9e\x11\x28\x77\x70\x32\x83\xdf\x83\x2d\x31\x2c\x99\xdb\xdc\xe7\x7f\x2f\xc5\x9f\xeb\x68\x00\xc6\xc5\xc8\x9f\xe7\x5f\xe3\xe6\xbe\x80\x13\xd1\x34\xe5\x45\xc3\xf6\x12\x20\xfd\xe6\xbe\x88\x5f\x57\x2e\xb6\xcb\x66\x2f\x11\xca\x6f\xee\x8b\xf8\x81\xf1\x72\xdd\xd8\xfd\xdc\xa8\x69\xf3\xa8\x84\xdf\xcb\xc6\xc1\x91\xe6\xf4\x76\x09\xe7\xd7\x6e\xf7\x00\xd0\x55\x5d\x5a\x16\xec\x79\x08\x50\xdc\x7c\x3e\x6a\xd0\x71\xdb\xae\x6d\x44\xf6\x01\x41\x22\x6c\xee\xcb\xf8\xbd\x6c\x44\x5d\x5a\xa5\x31\x44\x30\x69\xb7\xcb\xb8\x8e\x9b\x07\x11\x6a\x95\x2e\x2f\xd9\xcf\x0c\x0b\xe7\x03\xf1\x6d\x68\xf3\xf9\x15\xbb\x1d\x96\xde\xb4\xd6\x8e\x96\xde\xb4\xfa\xd2\xea\xc0\x10\x26\x1d\xf9\x7a\x2f\x44\x4c\xd8\x3c\x90\x81\x05\xce\x25\xb7\xdb\x9b\x54\xf1\x9e\x5f\x41\x06\x6e\x3e\xdf\x4c\xf9\xf4\x24\x80\x6d\x67\xc1\x7e\x87\x01\x1e\xbd\x9b\xb5\x11\xc9\x9f\x51\x1a\x91\xef\x69\x3a\x8c\x00\xd2\xc3\xbc\xbb\x6b\xe2\x03\xbc\xc3\x82\xf8\x1b\xe3\xd1\xea\xdd\xac\x9a\xf1\xf3\x4d\xb3\x7f\x63\x3c\x6e\x1c\x6d\x6c\x52\xfe\xed\xc5\x70\x4b\x78\xed\xa8\x84\xc7\xf2\x9a\x69\xb3\x33\x38\x63\x63\x83\x3b\x87\x76\xff\xb9\x16\x9a\xd5\x0f\xb3\x6b\xbf\x73\x7b\x9a\xbe\x74\x5d\x5b\xd1\x4f\xdc\x3d\x72\xf4\xa9\x1a\x1c\xea\x11\x36\x83\x9a\xe8\x9f\x11\xd5\xc4\xd8\x85\x75\xf2\xa2\x22\x54\x3b\xde\x4c\xd2\xed\x9e\x86\x44\xdf\xab\xbd\x1d\xee\x1e\xeb\x67\x13\x94\x63\xb8\x3e\x00\x34\xa1\x74\xc2\x3e\x62\x78\x56\x9a\x61\x0b\x56\xca\x80\x88\x33\x8a\x60\xc1\x5f\xd4\x26\xae\xac\xd2\xc5\x94\xaf\x65\x15\x38\x33\x56\xfb\x37\xfd\x43\xdc\x91\xfb\x98\xbf\x9b\x4e\x24\x83\xf9\x02\x0e\xdd\xe3\xdd\x74\xe2\x52\x72\x1e\x23\x89\xd5\xc5\xbb\xf2\x72\xe6\xc8\xb7\x2b\x36\x4f\xc9\x2e\x97\xa7\x13\xac\x1c\x29\xdd\x3d\x3b\x3a\x41\x3f\x8f\x74\x7a\x76\x2b\x3e\xfe\xe7\x61\xc5\x3f\xbb\xa5\x10\xdb\x73\xbf\x14\x9e\x69\x8d\x77\xba\x70\x8d\x07\x5d\x1d\xb4\x73\x5c\xea\x9e\xdd\x6a\x12\xad\x73\x68\xcb\x2b\x96\x8d\xc7\x6c\x3e\x9b\x4e\xee\xa7\x13\xae\x34\x9c\xcf\xa0\xb4\x0e\x15\x5d\xca\x4b\xe6\x44\xa6\x21\xef\x50\x92\x2c\x25\x9d\x96\x16\x1d\xcf\xf2\x33\x58\x40\x69\x51\x90\xe0\xa0\x19\x77\x52\xc8\xda\x57\xf8\xf8\x62\x01\x52\x34\x41\x86\x2b\x42\x8b\xf8\x9e\x34\xe3\x39\xd1\x93\x60\x59\x00\xed\x4b\x68\x28\x5e\x33\xbb\xd6\x12\x24\xeb\xc2\x84\xfa\xdd\xcd\x38\xc1\x70\xa4\x40\xa1\x9f\x63\x91\x82\xcc\x19\xaf\x43\x63\x9b\xc6\x4a\x46\x97\xb7\x19\x30\xad\xdd\xf3\x1d\x7a\xc7\xb4\x76\xde\xf1\xba\x78\xad\x75\x96\xbf\x42\x42\xe2\x5f\xb0\x50\x34\x33\xe0\xad\x75\xbb\x94\xe6\x19\x65\x07\x7c\xf1\xe7\x1c\xbe\xb8\x3e\x98\x39\x7e\x7c\x91\x8e\x3d\x47\xd7\x0c\xa2\x76\x88\x3a\xef\x86\x31\x06\x91\x01\x63\x89\xab\xfe\x8a\xa3\xcc\x86\x61\x8c\x2b\x3e\x90\xb1\x13\x9e\xa7\x0b\x48\xd9\x88\x59\x5c\xea\xa2\x36\xf4\xaf\xf3\xce\x86\xd0\xa4\x4e\x27\xb1\x35\xed\x56\x03\xc5\xad\xfa\x2e\x6f\xde\xc9\x0d\x7d\x1f\xa1\x85\xba\xd3\x7e\x70\x8e\xba\x7b\x1d\x62\xb7\x33\x36\x7c\xf3\xe8\x73\xec\xea\x86\xc9\x80\xcb\xfd\x74\xe8\x7a\x3d\x5c\x6f\x98\xcc\x78\x5d\x74\xd4\x1c\x85\x84\xae\x28\xea\x88\x14\x5c\x8e\xdd\x51\xd4\x11\x29\x1b\x29\x07\x9f\x97\x74\x7c\x33\xe9\x0c\xdf\x27\xe9\x0c\xc7\x20\x80\xc5\xc3\x91\xd8\x0a\x63\x5c\x25\xc6\xc3\x43\x38\x26\x67\x48\x88\xcf\x83\x99\x93\xe5\x54\xe4\x51\xb6\xbb\x85\xcd\x17\x80\xd7\x2f\x87\x9b\xbb\x96\xe5\xaf\x88\xfe\x62\x01\x5f\x05\x3b\xf1\xba\xb6\x80\x43\xb7\x80\xcc\xee\xb8\xa3\xbb\xb3\xef\xe2\x01\x2f\x05\x50\x95\x12\x2e\x18\xe0\x00\x8c\xd5\x60\x15\xee\xb9\x64\x92\xe9\x12\xf3\xd3\x71\xfe\xa8\x34\xb0\x9b\xb2\x5d\x35\x6c\x06\x52\x59\x28\xc1\xa5\x2d\x36\xc6\x8d\xb8\x62\x60\x45\xcb\x8a\x13\xf5\xb1\x40\x2b\xcf\x67\x21\x37\xdd\xf9\x52\xfc\x52\x6a\xb3\x2c\x9b\xac\x8b\x3b\x9f\xab\x09\x42\x86\x17\xbd\x9b\xcd\x22\x89\xd2\xb4\xdc\x18\x3e\x73\x3c\x5d\xcd\xa1\x23\x77\xb3\xe6\xd0\x5d\x1f\x6b\x0e\xfd\x1c\xab\x39\xc8\x9c\x89\xfa\xc6\x5d\x68\x6b\x76\xd3\x3f\xa0\x48\xf4\x5d\xd4\x7d\x88\x04\x67\x2d\x1e\xd4\x3e\x9d\x44\x7d\x83\x5d\x30\x66\x30\x9d\xc9\xf3\xb8\x40\xcf\xc3\xdc\x76\x2b\x5d\x66\xa7\x09\xe3\x56\x7a\xe9\x72\xef\x3d\xf5\x18\xfa\xd1\x1c\xbd\x2d\x7c\x53\xc9\xa8\x2f\x86\xb5\xfb\xa5\xa0\x84\xff\xbe\xfd\xf5\xc4\x31\x63\x27\xe3\x5f\x74\xcd\xe8\x45\xe3\x16\x27\xe0\x6d\x6f\x94\x42\xff\x78\x84\x7a\x4a\x33\x13\x74\xbb\x06\xc9\x6b\xca\x21\xbb\x80\xd3\xb3\x8b\x5b\x4b\xf5\x33\x29\xd0\x06\x6b\x28\xf1\x3a\xcc\x68\xf0\xe7\x41\xf3\x53\x23\xa2\x65\xf9\xc6\x41\x2e\x24\x8d\x72\x33\x3f\x80\xc5\xe3\xfe\x57\xee\x6d\xc8\x73\x9f\x78\x4f\x73\xbc\x7a\x63\x12\x41\x59\x4e\x41\xb9\x4f\xba\xfb\x48\x37\x85\x0b\x3c\x9c\x33\x05\x2b\xf7\x3e\x90\x3c\xb2\xf1\x44\x32\xc3\x03\x69\xa8\x86\xc2\xea\xe9\xf5\x50\x97\x19\x75\x95\x9c\x61\x64\x07\x45\xd1\x90\xa7\xd0\xe5\x5f\x04\x4b\xdb\x1c\xd7\xfe\x12\xf0\xd4\x0a\x2f\xa0\x5c\xad\x98\xac\x33\x4f\x98\x75\x2d\x65\x92\xaa\x59\x9e\x7b\x98\xfc\x20\x36\x75\xc0\x8f\x71\x9f\xd3\x05\x57\x3f\xa2\x13\xde\x06\xef\x46\x18\x22\x27\x8e\x1c\x07\x23\xd3\xfa\x33\xea\xcd\xe0\xa5\xe3\x44\xf9\xf9\x63\x8b\x66\xcf\x4f\xaf\xc7\x33\xf6\x4e\x04\x93\xfb\xf2\xf6\x5e\xb6\xbd\x02\x47\x55\xca\xd0\x59\x24\xae\x99\x84\x8b\x35\xe7\x4c\x03\xd6\x35\x5f\xe2\xc3\xe8\x19\x6b\xd5\x40\x42\x76\xb1\xe6\xbe\x30\xb9\xf6\x91\x88\xb3\x6d\xe5\xa9\x07\x03\x5a\x18\xc5\x39\x41\x33\x30\xbb\x81\x60\x5a\xa7\x01\xc1\x93\xda\xe2\x8f\x00\x64\x49\x7a\xd6\xc2\x9f\xc2\x66\xa4\x6f\xdd\x14\xed\x64\x27\x67\x60\x7a\x04\xc6\xaa\x83\xbf\x8c\x1f\x6b\x5b\x15\x46\xe4\x74\x3d\x4b\x6b\xb6\x07\x2c\x33\xe0\x61\xc9\x61\x58\xba\x86\x45\x1e\x61\x73\xb6\xa1\xf4\x5e\x7e\xf5\x2a\xde\x8e\xec\x4a\x21\x12\x33\x68\x93\x94\x21\x93\xf1\x46\x52\xb6\xbe\xbd\x19\x2f\xff\xed\x4d\x2c\xfd\xd3\xc9\xc4\xdf\x72\x53\x6b\x7c\x61\x6c\x6f\xf2\x0e\xee\x11\x64\xfb\x3d\x98\xd3\x1e\xe3\x56\x26\x51\xeb\xec\x45\x83\x3f\xf4\xde\x29\xef\xde\xe8\xc4\xf5\x23\x5e\x7f\x77\x87\xe9\x67\xb3\xdb\x36\x62\xca\xa7\xda\x82\xc6\xb8\x3e\x29\x8e\x24\x17\x70\x18\x7e\x93\x44\x2c\x27\xfe\x0c\xfd\x30\x43\x92\xff\x98\x82\x44\xab\xa9\xe1\x98\x24\x5f\x48\xe6\x20\x66\x9d\xf0\x10\xac\x49\xb9\xf2\x1d\x0c\x18\x1e\x00\xd9\x76\x48\x3c\x35\xe8\xdb\x0e\x87\xcf\x3a\x1d\x50\xea\xae\xf3\xe1\x19\xac\xdf\x7a\x2e\x3c\xe6\x60\x40\x05\xf4\xc9\x30\x75\x83\x0e\x87\x27\x8f\xfb\xce\x7e\x54\x19\xac\xa7\x8f\x9b\x89\xed\x3f\x91\x41\x4f\x18\x8f\xc1\x0c\xff\x81\x33\xf5\xd5\x9f\x50\x4f\xe9\xac\xe0\x40\x8a\x7a\x82\x4c\xe1\x3f\xc4\x26\x9e\xbe\xf1\xf6\x0c\x5c\xfd\x54\xbf\x92\x01\x4a\xaf\x94\xfb\x04\xa4\x5a\x4e\x17\xc1\xcf\xa8\xe5\xbd\xfe\x70\x6b\x31\xdf\x5e\x3f\x3f\xb9\x9c\x8f\x57\xc7\xfd\x8a\xe3\xf6\x37\x18\xcf\xbe\xad\x65\x2f\x60\x8b\x7b\x1e\xaa\x5e\x1b\x98\x8f\x62\x97\xb6\x59\x5b\xa1\xdb\x96\x80\x9f\x08\xdc\x58\x7a\xed\x9b\x5d\x31\xb9\x28\xb0\x62\x00\xf2\xb2\xa1\x61\xe6\xfd\xde\x2e\xf7\x5a\xbe\xad\x3e\x6f\xcf\xc4\xfd\xbd\x1e\xcd\xb3\xfd\xd2\x6c\x87\x3b\x1c\x68\x3e\x98\x43\xd7\x55\x75\x76\x0b\x0e\x2f\xe2\x74\x01\xfe\xfe\xdb\x3d\x1d\x4b\xae\x8a\x93\x75\xcb\xb4\xa8\xfc\x65\x2f\x11\xec\xf4\xc8\x19\xa8\x2b\x6a\xd5\xd2\xc1\x44\x91\xf1\x46\x95\xf6\xdb\x6f\xc8\xdb\x17\xea\x2a\x65\x4e\x4b\xce\x5a\xb2\x9b\x15\xab\x2c\xab\x07\x13\x17\x1c\xf6\xc4\x39\xcf\x9c\x06\x3d\xe9\x9c\xc7\x7c\x14\xb6\x5a\x82\x25\xed\x68\xaa\xeb\x7f\x5e\x39\x4d\x55\x69\x18\x58\xf8\xcf\x02\xd2\xcf\xff\xf6\x9f\x70\x78\x08\x16\xfe\x3d\x20\x7f\xfb\xcd\xdc\x55\xf2\xe1\x68\x85\xa6\x47\x32\x1f\x17\xf7\x5e\x8c\xcb\x7b\x2f\xb6\x0a\x5c\x77\x12\xc7\x0a\x5b\x57\x59\xe0\xa3\x2e\x57\x26\xfd\x8f\x23\x9e\x5e\xca\x9a\xfa\xc0\x40\x68\x99\x5d\xaa\x1a\x3e\x0a\xbb\x04\xcd\x2a\x75\x4d\xcd\x3f\x93\x66\xad\x19\x48\x05\xab\x52\x8a\xca\x80\x90\xe0\x3b\x75\x21\x2f\x7d\x39\x4c\x2a\x19\xaf\x93\x6f\xe4\xe0\x89\x39\x9c\x9e\x75\xff\xb1\xe3\x3e\x87\xcc\x17\xad\x84\x3c\x1c\x67\xd4\xcc\x5d\x3f\x9c\x78\x1f\x2f\x82\xc3\x35\xe6\x2f\x19\xe7\xfa\xf8\xeb\x5e\x11\xc3\x09\x57\x2f\x24\xbe\x78\x17\xbc\x23\xe3\xe3\x00\x7a\x06\xd7\xd8\xe2\xf1\x50\xc0\x30\x0a\xf1\x9c\x70\x9d\x6e\x88\xae\xba\x08\x0e\xcc\x06\xe8\x52\x43\xb4\x01\x2e\x91\x1f\x0b\x65\x3a\x03\x48\xd1\x24\x7a\x00\x13\x3f\xe7\x38\x2c\xa9\x53\xeb\x88\xcf\x81\x64\xcf\xbf\x1e\x98\x04\x24\xf3\x0d\xe2\x28\x8e\x29\xf3\x26\x94\xa1\x33\xdb\x00\x33\x2c\x3c\x16\xce\xfe\x44\x22\x05\x34\xac\x04\x48\x69\x00\xe9\x30\x0d\xdd\x63\x42\x7f\x46\x58\x83\xa7\x23\xc0\x8a\xd8\xb7\xee\x82\x36\x3a\x32\x04\x97\x6e\xaa\x1b\xd0\x12\xf9\xb1\xc0\xee\xba\xc1\x66\xd4\x01\x12\x7e\xbf\x74\xb7\xd8\x67\xc1\x8f\xdc\x19\x41\x8f\x8c\xd8\x8d\x1d\x79\xb1\x81\x1c\x35\x05\x1b\xc8\x11\xf9\xb1\xc8\xf5\x7a\x9e\x24\x20\x89\x1e\xc2\xd1\x3d\x61\x34\x52\xb3\xd2\x11\x9f\x11\x4a\xf2\x6f\x04\xca\xa5\x6f\x92\x76\x41\xe9\xcd\x1f\x42\xe9\xbb\x8d\x0d\x2c\x3d\xfd\xb1\x60\xf6\xbb\xa9\x04\x4d\xbf\x90\x63\x6c\x7a\x65\x0e\x4e\xdf\x11\x75\xd4\x67\xc4\xd3\xab\x1d\x01\x74\x15\x7a\xb0\x5d\x88\x06\x17\x66\xbd\x06\x2c\x8e\x6b\x2c\xa4\x03\x9b\xbc\xf7\x84\x37\x0e\xa5\xc1\x16\x3f\x0b\x59\x67\x39\x2c\x16\x71\xfd\x8d\xc5\x4e\x6d\x62\x61\x01\xb6\x78\xdd\xb0\x36\xeb\xb5\x12\x76\x7a\x3f\xfd\x7f\x00\x00\x00\xff\xff\xd9\xbf\xc5\x7e\x7f\x2e\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\x13\x03\x35\xa4\x60\x2b\xf7\x8a\xa2\xb8\xdb\xdc\x1e\x50\xb4\x29\xea\xeb\xd5\x0d\x9a\xa4\x2f\x86\xe1\xca\xd2\xd0\xcb\x58\x22\xb7\x24\xd7\xb1\xeb\xfa\xbb\x1f\x38\xfc\x23\x4a\xab\x5d\x6f\x1c\x3b\x2f\x59\x0d\x39\xc3\x99\x9f\xe6\x1f\x47\x3e\x3a\x82\xef\xe5\xea\x56\xf1\xcb\xa5\x81\xaf\xbf\xfa\xc7\xbf\xbe\x5c\x29\xd4\x28\x0c\xfc\x58\x56\x78\x21\xe5\x15\x1c\x8b\xaa\x80\xef\x9a\x06\x68\x93\x06\xbb\xae\xae\xb1\x2e\xa6\x47\x47\xf0\x6e\xc9\x35\x68\xb9\x56\x15\x42\x25\x6b\x04\xae\xa1\xe1\x15\x0a\x8d\x35\xac\x45\x8d\x0a\xcc\x12\xe1\xbb\x55\x59\x2d\x11\xbe\x2e\xbe\x0a\xab\xc0\xe4\x5a\xd4\x56\x04\x17\xb4\xe5\x7f\xc7\xdf\xbf\x3e\x79\xfb\x1a\x18\x6f\x30\xd0\x94\x94\x06\x6a\xae\xb0\x32\x52\xdd\x82\x64\x60\x92\xf3\x8c\x42\x2c\xa6\xd3\x55\x59\x5d\x95\x97\x08\x8d\x2c\xeb\xe9\x94\xb7\x2b\xa9\x0c\x64\xd3\xc9\x01\x8a\x4a\xd6\x5c\x5c\x1e\x7d\xd0\x52\x1c\x4c\x27\x07\xac\x35\xf6\x3f\x85\xac\xc1\xca\x1c\x4c\xa7\x93\x83\x4b\x6e\x96\xeb\x8b\xa2\x92\xed\x11\xf3\x06\x1f\xa1\xa0\x6d\x5b\x96\x8e\x74\xb5\xc4\xb6\x3c\xc2\xfa\x12\xf7\xd8\xc6\x38\x36\xf5\x1e\xfb\xb8\xa8\xf1\xe6\x60\x9a\x4f\x2d\x24\x6f\x89\x06\x0a\xfd\xcb\xd0\x50\x0a\x40\x61\x0a\xbf\x60\x96\xa5\x81\x8f\xa5\x26\x9b\xb1\x06\xa6\x64\x0b\x25\x54\xb2\x5d\x35\xdc\x02\xaf\x51\x81\xc7\xa5\x98\x9a\xdb\x15\x06\x91\xda\xa8\x75\x65\xe0\x6e\x3a\x39\x29\x5b\x04\xff\x4f\x1b\xc5\xc5\x25\x0c\xff\xfd\x61\x81\x9b\x1f\x88\xb2\xc5\x99\x6c\xb9\xc1\x76\x65\x6e\x0f\xfe\x98\x4e\xbe\x97\x82\x71\xbf\xdf\xaa\x95\x3e\xf7\x79\x2b\x5a\xe9\x73\xbf\xae\x2f\x51\xfb\x6d\xa7\x67\x2f\xed\xe3\x96\x93\x2d\xc6\xba\xcf\xfc\xa3\xc5\x53\x47\x66\x7a\x1c\x67\x26\xe4\x07\xdc\xc7\x16\x65\x7f\xf8\xe9\xd9\x4b\x7a\x1c\xe7\xe6\x6e\x67\x9f\xfd\x27\x29\xaf\x12\xcd\xdf\x48\xcd\x0d\x97\x62\x84\x7d\x69\x77\xf6\x99\xdf\xc8\x86\x57\xb7\xfb\x30\xaf\x68\x67\x9f\xfb\x3b\x21\xa4\x29\x2d\x83\x86\xb6\x5c\x9d\xba\x57\x76\xc6\x85\x41\x65\xfd\xe9\xee\x3e\x70\x97\xdd\xce\x9e\x88\x7b\x72\xad\x78\x6c\x8d\xba\x52\xfc\x02\x35\x94\xb0\x0a\x44\x1f\x77\xce\x27\xbd\xe7\x44\x8e\xce\x77\x12\xdc\xb8\x30\x00\x47\x47\xe0\x48\x9e\x9f\xa0\x3f\xb2\x18\x40\xc3\xb5\x29\xa6\x93\x5f\xf8\x0d\xd6\xc7\x64\xec\x85\x94\x8d\xe7\xe0\x55\x69\x50\x03\x67\xc9\xa9\x20\x2f\x3e\x60\xe5\xdc\xbb\xb5\x5c\x5f\x72\xe1\x04\x70\x11\x0e\x71\x47\x12\x09\x78\x7a\x70\x4b\x24\x77\xa6\xb3\xd7\x39\xc8\x66\x24\x39\xfa\x23\x02\xc9\x31\x8e\xc7\xd1\xd6\x48\xda\x1e\x4a\xc7\x82\xc9\x6e\xdb\x4b\x42\xae\x78\x77\xbb\xc2\xde\x82\x67\xb7\x0a\xf4\xd9\xdf\x95\xe9\x61\x0f\x9c\x6e\xca\x41\x24\xbe\xe5\x7f\x25\xba\xbf\xe4\xc2\x7c\xfb\xcd\x56\x6e\xcd\xff\x1a\x1c\xfe\x5a\xac\x5b\x1d\xb7\x9d\x9e\x39\x50\xee\xe0\x64\x06\xbf\x07\x5d\xa2\x5b\xa2\xdd\xdc\xe7\x7f\x2f\xf8\x9f\xeb\xa8\x00\xf9\xc5\xc8\x3f\xcf\xbf\xa6\xcd\x7d\x01\x27\xbc\x69\xca\x8b\x06\xf7\x12\x20\xfc\xe6\xbe\x88\x5f\x57\xd6\xb7\xcb\x66\x2f\x11\xd2\x6f\xee\x8b\xf8\x01\x59\xb9\x6e\xcc\x7e\x66\xd4\x6e\xf3\xa8\x84\xdf\xcb\xc6\xc2\x91\xc6\xf4\x76\x09\xe7\xd7\x76\xf7\x00\xd0\x55\x5d\x1a\x0c\xfa\x3c\x04\x28\x6d\x3e\x1f\x55\xe8\xb8\x6d\xd7\x26\x22\xfb\x80\x20\x1e\x36\xf7\x65\xfc\x5e\x36\xbc\x2e\x8d\x54\xe4\x22\x14\xb4\xdb\x65\x5c\xc7\xcd\x03\x0f\x35\x52\x95\x97\xf8\x33\x52\xe2\x7c\xc0\xbf\xb5\xdb\x7c\x7e\x85\xb7\xc3\xd4\x9b\xe6\xda\xd1\xd4\x9b\x66\x5f\xb7\x3a\x50\x04\x85\x25\x5f\xef\x85\x88\x0e\x9b\x07\x32\x28\xc1\xd9\xe0\xb6\x7b\x93\x2c\xde\xb3\x2b\xc8\xa0\xcd\xe7\x9b\x21\x9f\x56\x02\xd8\x56\x0b\xf6\x2b\x06\x54\x7a\x37\x73\x23\x91\x1f\x91\x1a\x89\xef\x69\x3a\x8c\x00\xd2\xc3\xbc\xbb\x73\xe2\x03\xbc\xc3\x84\xf8\x1b\xb2\xa8\xf5\x6e\x56\x85\xec\x7c\x53\xed\xdf\x90\xc5\x8d\xa3\x8d\x4d\xca\xbf\x3d\x19\x6e\x71\xaf\x1d\x99\xf0\x58\x5c\xa3\xd2\x3b\x9d\x33\x36\x36\xb4\x73\xa8\xf7\x9f\x6b\xae\xb0\x7e\x98\x5d\xf9\x9d\xdb\xc3\xf4\xa5\xed\xda\x8a\x7e\xe0\xee\x11\xa3\x4f\xd5\xe0\xb8\x1e\x61\xd3\xa9\x1d\xfd\x11\x5e\xed\x18\x3b\xb7\x4e\x5e\x54\x84\x6a\xc7\x9b\x49\xba\xdd\xd3\x10\xe8\x7b\xb5\xb7\xc3\xdd\x63\xfd\x6c\x82\x72\x74\xd7\x07\x80\x76\x28\x9d\xe0\x47\x72\xcf\x4a\x21\xb5\x60\xa5\x08\x88\x58\xa5\x1c\x2c\xf4\xcb\xb5\x89\x2b\x23\x55\x31\x65\x6b\x51\x05\xce\x0c\x6b\xff\xa6\x7f\x88\x3b\x72\xef\xf3\x77\xd3\x89\x40\x98\x2f\xe0\xd0\x3e\xde\x4d\x27\x36\x24\xe7\xd1\x93\xb0\x2e\xde\x95\x97\x33\x4b\xbe\x5d\xe1\x3c\x25\xdb\x58\x9e\x4e\x28\x73\xa4\x74\xfb\x6c\xe9\x0e\xfa\x79\xa4\xbb\x67\xbb\xe2\xfd\x7f\x1e\x56\xfc\xb3\x5d\x0a\xbe\x3d\xf7\x4b\xe1\xd9\xad\xb1\xee\x2c\x5a\x63\xe1\xac\x0e\xda\x39\x2d\x75\xcf\x76\x35\xf1\xd6\x39\xb4\xe5\x15\x66\xe3\x3e\x9b\xcf\xa6\x93\xfb\xe9\x84\x49\x05\xe7\x33\x28\x8d\x45\x45\x95\xe2\x12\xad\xc8\xd4\xe5\x2d\x4a\x02\x53\xd2\x69\x69\xc8\xf0\x2c\x3f\x83\x05\x94\x86\x04\x71\x06\x0a\x99\x95\xe2\xb4\x7d\x45\x8f\x2f\x16\x20\x78\x13\x64\xd8\x24\xb4\x88\xef\x49\x21\xcb\x1d\x3d\x71\x96\x05\xb8\x7d\x09\x8d\xc4\x2b\x34\x6b\x25\x40\x60\xe7\x26\xae\xdf\xdd\xf4\x13\x72\x47\xe7\x28\xee\xe7\x98\xa7\x10\x73\xc6\xea\xd0\xd8\xa6\xbe\x92\xb9\xcb\xdb\x0c\x50\x29\xfb\x7c\x47\xd6\xa1\x52\xd6\x3a\x56\x17\xaf\x95\xca\xf2\x57\x44\x48\xec\x0b\x1a\xf2\x66\x06\xac\x35\x76\x97\x54\x2c\x73\xd1\x01\x5f\xfc\x39\x87\x2f\xae\x0f\x66\x96\x9f\x5e\xa4\x65\xcf\xc9\x34\x4d\xa8\x1d\xd2\x99\x77\x43\x1f\x83\xc8\x40\xbe\xc4\x64\x7f\xc5\x52\x66\x43\x37\xa6\x15\xef\xc8\xd4\x09\xcf\xd3\x05\xa2\x6c\xf8\x2c\x2d\x75\x5e\x1b\xfa\xd7\x79\xa7\x43\x68\x52\xa7\x93\xd8\x9a\x76\xab\x81\x62\x57\x7d\x97\x37\xef\xe4\x86\xbe\xcf\xa1\x45\x67\xa7\xfd\xe0\x9c\xce\xee\x75\x88\xdd\xce\xd8\xf0\xcd\xa3\xcd\xb1\xab\x1b\x06\x03\x2d\xf7\xc3\xa1\xeb\xf5\x68\xbd\x41\x91\xb1\xba\xe8\xa8\x39\x09\x09\x5d\x51\x3c\x23\x52\x68\x39\x76\x47\xf1\x8c\x48\xd9\x08\x39\x78\x5c\xd0\xb1\xcd\xa0\xd3\x6c\x9f\xa0\xd3\x8c\x9c\x00\x16\x0f\x7b\x62\xcb\xb5\xb6\x99\x98\x8a\x07\xb7\x4c\x56\x91\xe0\x9f\x07\x33\x2b\xcb\x1e\x91\x47\xd9\xf6\x16\x36\x5f\x00\x5d\xbf\x2c\x6e\xf6\x5a\x96\xbf\x72\xf4\x17\x0b\xf8\x2a\xe8\x49\xd7\xb5\x05\x1c\xda\x05\x62\xb6\xe5\xce\xdd\x9d\x7d\x17\x0f\x74\x29\x80\xaa\x14\x70\x81\x40\x03\x30\xac\xc1\x48\xda\x73\x89\x02\x55\x49\xf1\x69\x39\x7f\x94\x0a\xf0\xa6\x6c\x57\x0d\xce\x40\x48\x03\x25\xd8\xb0\xa5\xc6\xb8\xe1\x57\x08\x86\xb7\x58\x9c\xc8\x8f\x05\x69\x79\x3e\x0b\xb1\x69\xeb\x4b\xf1\x4b\xa9\xf4\xb2\x6c\xb2\xce\xef\x7c\xac\x26\x08\x69\x56\xf4\x6e\x36\x8b\xc4\x4b\xd3\x74\xa3\xd9\xcc\xf2\x74\x39\xc7\x95\xdc\xcd\x9c\xe3\xee\xfa\x94\x73\xdc\xcf\xb1\x9c\x43\xcc\x19\xaf\x6f\xec\x85\xb6\xc6\x9b\x7e\x81\x72\xa2\xef\xe2\xd9\x87\x44\xb0\xda\x52\xa1\xf6\xe1\xc4\xeb\x1b\xea\x82\x29\x82\x5d\x4d\x9e\xc7\x05\xf7\x3c\x8c\x6d\xbb\xd2\x45\x76\x1a\x30\x76\xa5\x17\x2e\xf7\xde\x52\x8f\xa1\x1f\xcd\xb9\xb7\x45\x6f\x2a\x19\xf5\x45\xb7\xb6\xbf\x24\x94\xf0\xdf\xb7\xbf\x9e\x58\x66\xea\x64\xfc\x8b\xae\xd1\xbd\x68\xda\x62\x05\xbc\xed\x8d\x52\xdc\x7f\x1e\xa1\xde\xa1\x99\x0e\x67\xdb\x06\xc9\x9f\x94\x43\x76\x01\xa7\x67\x17\xb7\xc6\xe5\xcf\x24\x41\x6b\xca\xa1\x8e\xd7\x62\xe6\x06\x7f\x1e\x34\x3f\x35\x72\xb4\x2c\xdf\x28\xe4\x5c\xb8\x51\x6e\xe6\x07\xb0\x54\xee\x7f\x65\x5e\x87\x3c\xf7\x81\xf7\x88\xf2\xda\xd5\x0d\x5d\x58\x57\xa1\xc9\x50\x90\xbb\x77\x09\xf1\x58\xc4\x1a\xa2\x87\x25\xa4\x9b\xcc\x26\x2d\x28\xc8\x6b\x54\x8a\xd7\x18\xa7\x55\xe9\x6a\x31\x9a\x86\x3c\x52\x89\x95\x59\xee\x22\x66\x9f\x5c\xd4\x33\xd5\x39\xe3\xd3\xdb\xea\x7a\xd3\x78\x56\xc9\x90\xe2\x21\x1c\x14\x15\x79\x8a\xb3\x3c\x42\x98\x36\x47\xb6\x69\x76\x88\xb8\x06\x7a\x01\xe5\x6a\x85\xa2\xce\x3c\x61\xd6\x35\xa2\x49\x80\x67\x79\xee\xd3\xaa\x1f\xdf\xa6\x06\xf8\xe1\xef\x73\x9a\x60\xb3\x4e\x34\xc2\xeb\xe0\xcd\x08\xa3\xe7\xc4\x90\xe3\xa0\x64\x9a\xb5\x46\xad\x19\xbc\x74\x9a\x43\x3f\xfd\x3b\x1f\x1e\xe3\x26\xd6\x4f\x7f\x8e\x67\xec\xd5\x11\x9d\xfb\xa4\xf8\x5e\xb4\xbd\xb4\xe8\x72\x9b\x76\x15\x8c\x5f\xa3\x80\x8b\x35\x63\xa8\x80\xb2\xa1\x2f\x0c\x61\x60\x4d\x19\x6e\x20\x21\xbb\x58\x33\x9f\xce\x6c\xd3\xe9\x88\xb3\x6d\x49\xad\x07\x03\x69\x18\xc5\x59\x41\x33\xd0\xbb\x81\x40\xa5\x52\x87\x60\x49\xd0\xfb\xc2\x41\x2c\x49\xa7\x5b\xf8\xda\xad\x47\xba\xdd\x4d\xd1\x56\x76\x52\x39\xd3\xc2\x19\x33\x1f\xfd\xd2\x7e\x18\x6e\x64\x18\xac\xbb\x4b\x5d\x9a\xe9\x3d\x60\x99\x06\x0f\x4b\x0e\xc3\xf4\x39\x2c\x0d\x04\x9b\xd5\x8d\xa4\xf7\xe2\xab\x97\x75\x77\x44\x57\x0a\x11\x9f\x41\x9b\x84\x8c\x53\x99\xee\x31\x65\xeb\x9b\xa2\xf1\xa2\xd1\xde\xc4\x82\x31\x9d\x4c\xfc\xdd\x38\xd5\xc6\x27\xc6\xf6\x26\xef\xe0\x1e\x41\xb6\xdf\xb9\xd9\xd3\xa3\xdf\x8a\xc4\x6b\xad\xbe\xa4\xf0\x87\xde\x3b\x65\xdd\x1b\x9d\xd8\x2e\xc6\x9f\xdf\xdd\x7c\xfa\xd1\x6c\xb7\x8d\xa8\xf2\xa9\xba\x90\x32\xb6\xbb\x8a\x83\xcc\x05\x1c\x86\xdf\x4e\x22\xa5\x13\x5f\x79\x3f\xcc\x88\xe4\x3f\xc1\x10\xd1\x28\xd7\xa6\x4c\x92\xef\x2a\x73\xe0\xb3\x4e\x78\x70\xd6\x24\x5d\xf9\xbe\x07\x34\x0b\x80\x6c\x2b\x12\x4f\x0d\xfa\xb6\xe2\xf0\xa8\xea\x40\x52\x77\xd5\x87\x67\xd0\x7e\x6b\x5d\xf8\x9c\xc2\x40\x07\xb8\x0f\x8d\xa9\x19\xae\x38\x3c\xb9\xdf\x77\xfa\xd3\x91\x41\x7b\xf7\x49\x34\xd1\xfd\x27\xa7\xd0\x13\xfa\x63\x50\xc3\x7f\x16\x4d\x6d\xf5\x15\xea\x29\x8d\xe5\x0c\xdc\x41\x3d\x41\xba\xf0\x9f\x6f\x13\x4b\xdf\x78\x7d\x06\xa6\x7e\xb2\x5d\x23\x0d\x62\x7b\x33\xd2\x1c\x3e\xd4\x1d\xf6\x4b\x43\xbf\x2e\xf8\x68\x76\x85\xc1\xdd\x45\x1f\x51\x18\x7a\xcd\xe6\xd6\xca\xb0\x3d\x19\x7f\x72\x6d\x18\x4f\xb5\xfb\x65\xda\xed\xee\x10\x0b\xe9\xd6\x1c\x1a\x5e\x14\xed\x79\x28\x15\x6e\x60\x3e\x8a\x5d\xda\xb3\x6d\x85\x6e\x5b\x34\x7f\x22\x70\x63\xb1\xba\x6f\xa8\xc6\x48\x75\x5e\x1a\xbd\x99\x95\x8d\x9b\xa7\xde\xef\x6d\x72\xaf\x7f\xdc\x6a\xf3\xf6\xb0\xde\xdf\xea\xd1\xa0\xdd\x2f\x66\x77\x98\xc3\xc0\x8d\x28\x73\xe8\x5a\xb4\x4e\x6f\xce\xe0\x45\x1c\x70\xc0\xdf\x7f\xdb\xa7\x63\xc1\x64\x71\xb2\x6e\x51\xf1\xca\x47\x6d\x22\xd8\x9e\x23\x66\x20\xaf\x5c\xdf\x97\xce\x46\x8a\x8c\x35\xb2\x34\xdf\x7e\xe3\xac\x7d\x21\xaf\x52\xe6\x34\x7f\xad\x05\xde\xac\xb0\x32\x58\x0f\x86\x3e\x34\x6f\x8a\xa3\xa6\xb9\x9b\x35\xa5\xa3\x26\xfd\x91\x9b\x6a\x09\xc6\x9d\x4e\xaa\xda\x66\xea\x95\x3d\xa9\x2a\x35\x82\x81\xff\x2c\x20\xfd\x0b\x04\xf3\x4f\x38\x3c\x04\x03\xff\x1e\x90\xbf\xfd\x66\x6e\xf3\xd6\x70\xba\xe3\x06\x58\x22\x1f\x17\xf7\x9e\x8f\xcb\x7b\xcf\xb7\x0a\x5c\x77\x12\xc7\x12\x5b\x97\x59\xe0\xa3\x2a\x57\x3a\xfd\xdb\x15\x4f\x2f\x45\xed\x9a\xca\x40\x68\xd1\x2c\x65\x0d\x1f\xb9\x59\x82\xc2\xca\x5e\xde\x6d\x26\x44\xa1\xd7\x0a\x41\x48\x58\x95\x82\x57\x1a\xb8\x00\xdf\xf6\x73\x71\xe9\xd3\x61\x92\xc9\x58\x9d\x7c\xa6\x07\x4f\xcc\xe1\xf4\xac\xfb\xdb\x92\xfb\x1c\x32\x9f\xb4\x12\xf2\x70\xa2\x52\xa3\xbd\xcb\x58\xf1\xde\x5f\x38\x83\x6b\x8a\x5f\xa7\x9c\xbd\x14\x5c\xf7\x92\x18\x0d\xd9\x7a\x2e\xf1\xc5\xbb\x60\x9d\x53\x3e\xce\xc0\x67\x70\x4d\xfd\x22\x0b\x09\x8c\xbc\x90\xea\x84\x6d\x9b\x83\x77\xd5\x45\x30\x60\x36\x40\xd7\x75\x57\x1b\xe0\x3a\xf2\xe7\x42\x99\x0e\x14\x52\x34\x1d\x3d\x80\x49\x5f\x94\x2c\x96\xae\xed\xeb\x88\xcf\x81\x64\xcf\xbe\x1e\x98\x0e\x48\xf4\xdd\xe6\x28\x8e\x29\xf3\x26\x94\xa1\xcd\xdb\x00\x33\x2c\x7c\x2e\x9c\xfd\xf1\x46\x0a\x68\x58\x09\x90\xba\x19\xa8\xc5\x34\xb4\xa2\x09\xfd\x19\x61\x0d\x96\x8e\x00\xcb\x63\x13\xbc\x0b\xda\x68\xc8\x10\x5c\x77\xed\xdd\x80\xd6\x91\x3f\x17\xd8\x5d\xd7\xe1\xcc\xb5\x93\x0e\xbf\x5f\xba\x2b\xf1\xb3\xe0\xe7\xcc\x19\x41\xcf\x29\xb1\x1b\x3b\x67\xc5\x06\x72\xae\x29\xd8\x40\xce\x91\x3f\x17\xb9\x5e\xcf\x93\x38\xa4\xa3\x07\x77\xb4\x4f\xe4\x8d\xae\x59\xe9\x88\xcf\x08\xa5\xb3\x6f\x04\xca\xa5\x6f\x92\x76\x41\xe9\xd5\x1f\x42\xe9\xbb\x8d\x0d\x2c\x3d\xfd\x73\xc1\xec\x77\x53\x09\x9a\x7e\x21\x27\xdf\xf4\x87\x59\x38\x7d\x47\xd4\x51\x9f\x11\x4f\x7f\xec\x08\xa0\xab\xd0\x83\xed\x42\x34\x98\x30\xeb\x35\x60\x71\xf6\x63\x20\x9d\xfe\xe4\xbd\x27\xba\x71\x48\x05\xa6\xf8\x99\x8b\x3a\xcb\x61\xb1\x88\xeb\x6f\x0c\x75\x6a\x13\x03\x0b\x30\xc5\xeb\x06\xdb\xac\xd7\x4a\x98\xe9\xfd\xf4\xff\x01\x00\x00\xff\xff\x31\x4c\x72\xd7\x02\x2f\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: 11903, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "schema.go", size: 12034, 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 765c72a60..a4328a9ef 100644 --- a/entc/load/schema.go +++ b/entc/load/schema.go @@ -158,12 +158,13 @@ func MarshalSchema(schema ent.Interface) (b []byte, err error) { Name: indirect(reflect.TypeOf(schema)).Name(), Annotations: make(map[string]interface{}), } - for _, at := range schema.Annotations() { - s.Annotations[at.Name()] = at - } if err := s.loadMixin(schema); err != nil { return nil, fmt.Errorf("schema %q: %v", s.Name, err) } + // Schema annotations override mixed-in annotations. + for _, at := range schema.Annotations() { + s.Annotations[at.Name()] = at + } if err := s.loadFields(schema); err != nil { return nil, fmt.Errorf("schema %q: %v", s.Name, err) } @@ -263,6 +264,9 @@ func (s *Schema) loadMixin(schema ent.Interface) error { MixinIndex: i, }) } + for _, at := range mx.Annotations() { + s.Annotations[at.Name()] = at + } } return nil } diff --git a/entc/load/schema_test.go b/entc/load/schema_test.go index 41f97a93d..5cb1d4ca0 100644 --- a/entc/load/schema_test.go +++ b/entc/load/schema_test.go @@ -30,14 +30,34 @@ func (OrderConfig) Name() string { return "order_config" } -func (o *OrderConfig) MarshalJSON() ([]byte, error) { - return json.Marshal(*o) +type IDConfig struct { + TagName string +} + +func (IDConfig) Name() string { + return "id_config" +} + +type AnnotationMixin struct { + mixin.Schema +} + +func (AnnotationMixin) Annotations() []schema.Annotation { + return []schema.Annotation{ + IDConfig{TagName: "id tag"}, + } } type User struct { ent.Schema } +func (User) Mixin() []ent.Mixin { + return []ent.Mixin{ + AnnotationMixin{}, + } +} + func (User) Annotations() []schema.Annotation { return []schema.Annotation{ OrderConfig{FieldName: "type annotations"}, @@ -110,7 +130,7 @@ func TestMarshalSchema(t *testing.T) { schema, err := UnmarshalSchema(buf) require.NoError(t, err) require.Equal(t, "User", schema.Name) - require.Len(t, schema.Annotations, 1) + require.Len(t, schema.Annotations, 2) ant := schema.Annotations["order_config"].(map[string]interface{}) require.Equal(t, ant["FieldName"], "type annotations") diff --git a/schema/mixin/mixin.go b/schema/mixin/mixin.go index 9acff01a9..2e8d892d2 100644 --- a/schema/mixin/mixin.go +++ b/schema/mixin/mixin.go @@ -36,6 +36,9 @@ func (Schema) Hooks() []ent.Hook { return nil } // Policy of the mixin. func (Schema) Policy() ent.Policy { return nil } +// Annotations of the mixin. +func (Schema) Annotations() []schema.Annotation { return nil } + // time mixin must implement `Mixin` interface. var _ ent.Mixin = (*Schema)(nil)