diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 68b3c3429..4c6b6ac28 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -931,7 +931,7 @@ func templateDialectSqlUpdateTmpl() (*asset, error) { return a, nil } -var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x59\x5f\x6f\xe3\xb8\x11\x7f\xb6\x3e\xc5\x9c\xe0\xbd\xb3\x03\x87\xde\xde\x5b\xd3\xa6\x40\x2e\xc9\xb6\x01\x16\xb9\xb6\xc9\xa2\x0f\xdb\xc5\x1d\x2d\x8d\x6c\x36\x32\xe9\x25\x29\x27\x81\xe0\xef\x5e\x0c\x49\x49\x94\xe4\xe4\xb2\x77\x4f\xb1\xc8\xf9\xfb\x9b\xe1\x70\x38\xa9\xeb\xe5\x49\x72\xa9\x76\xcf\x5a\xac\x37\x16\x7e\x7c\xff\xa7\x3f\x9f\xee\x34\x1a\x94\x16\x3e\xf0\x0c\x57\x4a\x3d\xc0\x8d\xcc\x18\x5c\x94\x25\x38\x22\x03\xb4\xaf\xf7\x98\xb3\xe4\x7e\x23\x0c\x18\x55\xe9\x0c\x21\x53\x39\x82\x30\x50\x8a\x0c\xa5\xc1\x1c\x2a\x99\xa3\x06\xbb\x41\xb8\xd8\xf1\x6c\x83\xf0\x23\x7b\xdf\xec\x42\xa1\x2a\x99\x27\x42\xba\xfd\x8f\x37\x97\xd7\xb7\x77\xd7\x50\x88\x12\x21\xac\x69\xa5\x2c\xe4\x42\x63\x66\x95\x7e\x06\x55\x80\x8d\x94\x59\x8d\xc8\x92\x93\xe5\xe1\x90\x24\x75\x0d\x39\x16\x42\x22\xa4\x5b\x95\x63\x99\x42\x58\x9d\xee\x1e\xd6\x70\x76\x0e\x2b\x6e\x10\xa6\xec\x52\xc9\x42\xac\xd9\x3f\x79\xf6\xc0\xd7\x48\x44\x75\x0d\x16\xb7\xbb\x92\x5b\x84\x74\x83\x3c\x47\x9d\xc2\xb4\x61\xef\xb6\xc4\x76\xa7\xb4\x6d\xb6\xfc\x17\xcc\x92\x49\x5d\x9f\x82\xe6\x72\x8d\x30\xdd\x71\xbb\x21\x5d\x53\x76\x27\x56\xa5\x90\xeb\x1b\x47\x65\x88\x63\x32\x49\x9d\x35\x44\x72\x38\xa4\x9e\x0f\x65\x4e\x7b\xf3\x24\x59\x2e\x81\xb6\xd9\x2d\xdf\x92\x55\x84\x21\x01\xe0\x7c\x01\x94\x56\xd8\x67\x28\x94\x47\xb2\x47\x68\xb2\x0d\x6e\x39\x4b\xec\xf3\x6e\xb8\x63\x75\x95\x59\xa8\x93\x49\xe6\x9c\x86\x9e\x3b\x4e\xf2\x52\x6d\x85\xb5\x7c\x6d\x82\x5b\x93\xe5\x12\x6e\xae\x3c\xce\x48\x6a\x59\x32\xb9\xb9\xf2\x62\x6f\xae\xd8\x3d\xe9\x38\x1c\xe8\xfb\x51\xd8\x0d\x4c\xd9\x85\x94\xca\x72\x2b\x94\x34\xec\x83\xc0\x32\x37\xec\xce\xa9\xbd\xe7\x6b\x26\xc8\xb9\x5f\xeb\x1a\x58\xf8\x8b\xa5\xc1\xf0\xd3\xc9\x6b\x49\x9b\x7d\x0f\x47\x0c\x69\xe1\xf1\xf4\xb2\x3d\x8e\xb4\x3b\xb5\xdc\x45\x75\x5a\xf4\x84\xb4\x86\x91\x4f\x9e\xf3\x35\x0b\x23\x0e\x21\x73\x7c\x0a\x7c\xd3\xa2\xc1\x90\x0c\x25\x4d\xe7\xce\x85\xd6\xc2\xc8\x54\x67\x8d\x28\x88\xe7\x52\x6d\xb7\x74\x64\xdc\x72\xec\x43\x49\x69\x79\x76\x0e\x66\x57\x0a\x1b\x53\xa6\xff\x95\x69\x20\x9f\x84\x04\x70\xb4\x9d\x84\x9e\x9a\x00\x5f\xd2\x51\x37\xde\x3b\xc7\x28\x32\x1b\x45\x30\x51\xf0\xf6\xbc\xac\xb0\x89\x64\xea\x89\x83\x57\x29\x14\x44\xcf\x92\x91\x8e\x23\x12\xeb\x3a\xb8\x77\x2b\xca\x92\xaf\x4a\x12\x70\x12\x23\x31\x2d\xe2\xbc\x10\x05\x48\xe5\x9c\xbc\x43\x69\x84\x15\xfb\x36\xe2\xb6\x8b\xb3\x77\xe4\x37\xf3\x71\x90\x12\xf1\xef\x90\x7f\xd7\xf9\x1a\x43\x5a\x2c\x97\xe0\xbf\x3a\x0c\x34\x96\x3e\xf2\x4b\x74\x3b\x74\x80\x94\xdd\xa0\x06\xa9\x72\x34\x4d\x95\x59\x6b\xbe\xdb\x30\x2f\xe2\xbe\x81\xce\x00\xd7\x08\x2b\x14\x72\x0d\x3b\xb5\xab\xc8\xca\x1c\x56\xcf\xa3\x13\xf8\xaf\x0a\xf5\x33\x3c\x6e\x50\x02\xf2\x35\xea\xd3\x52\xf1\x9c\xb8\xa8\x50\x21\x9d\xa0\x89\xb7\x2b\x66\x6a\x57\x86\x00\x90\xa1\xf1\x81\x6c\xfc\x3e\x6d\x3e\x96\x27\x70\x91\xe7\x82\xdc\xe2\xa5\x0f\xa4\x01\xab\x80\xe7\xad\x75\xc6\x2a\x4d\xc5\x2d\xd7\x62\x8f\x9a\x81\xab\x90\xe1\xd8\x6c\x77\x25\xa5\xe2\x4e\x0b\x69\x0b\x48\x73\xc1\x4b\xcc\xec\xf2\x9d\x59\x7a\xfd\x5e\x60\x4a\x25\x2c\x48\x69\x78\x45\x01\x1b\x6e\xee\x1b\x7b\xbd\xa8\x36\x37\x9f\x6c\x7f\x83\x1d\x8d\xda\x1b\x8c\xaf\x4c\x6c\xf2\x08\x1f\xcf\xb3\xe4\xad\x94\x00\x94\xab\xd6\xe3\xb4\x18\x94\xd5\x3f\x96\x20\xa3\x12\xeb\xc5\x75\x75\x36\x3a\xf3\xee\xc0\xb3\x36\x33\x89\x0b\xdf\x78\x58\x3d\x6d\x53\xc5\xc9\x30\x16\x0e\xe7\x48\x42\x74\xe0\x90\x7d\x92\xe2\x6b\x45\x3c\x9f\xbf\xb4\x07\xe7\xc4\xb3\xd1\x01\x6d\x25\xb6\x45\x12\x47\x05\x98\x1d\x29\xc4\xcd\xef\xe5\x12\x28\xb3\x31\x27\x61\x31\x88\x42\x16\x4a\x6f\x1d\x8e\x0e\x40\x8d\x74\xe9\xb9\x13\x50\x00\x77\x8c\x0e\xb9\x47\x6e\x82\x04\x98\x39\xb2\xaf\x15\x1a\x8b\xf9\x9c\x60\xee\x1f\x1d\x45\x01\xa0\xa3\x13\x6b\xfc\x5c\xd7\x50\xa2\x74\x46\x7e\x59\x29\x55\x36\x41\x0f\x90\x8b\x45\x0f\xf6\x17\x50\xff\x59\x5f\x6b\x52\x6e\x2b\x2d\x4d\x84\xf7\x00\xd9\x10\x11\x0d\x5c\x02\x6a\xad\x34\x39\xe3\x2e\xc5\x7c\x8d\x4e\x38\xb9\x43\xc8\x07\x97\x86\x3e\x84\xba\x19\x85\x65\x41\xe2\x02\xf5\xaa\xb2\xad\x00\xd7\x05\xb5\xa0\xb3\x64\x52\x54\x32\x83\xd9\x91\x54\x9b\xbf\xec\xd1\x6c\x0e\xb3\xdf\x93\x0d\x0b\xef\xdd\x9c\xd2\x77\x22\x0a\x40\x16\x41\x4e\x88\x4f\x05\xc1\xed\xb6\xdb\xbb\x2e\x92\xee\xee\x2e\xc7\x77\x14\xc6\xf3\x73\x90\xa2\xf4\xdc\x6d\x7d\x25\x08\x07\x59\x1e\xe5\xc6\x10\xc8\x45\xcb\x3b\x02\x8d\xf9\x2d\x1f\x4c\x52\xb4\x80\xef\x6f\x95\xfd\x40\x7b\xd7\xe4\x56\x5d\xf2\x15\x96\x67\x10\xf9\xdd\x75\x7e\xec\x23\x6d\x7a\x0f\xc6\x17\x6e\x23\xf5\xb8\x63\x0b\xd2\x96\x78\xbe\xa1\xfa\x8f\xce\x0f\xaf\x9f\x5c\x3d\xf3\xd7\x6f\xeb\x6c\x7a\x48\x26\x87\x24\x52\x16\xfd\x74\x1d\xab\x2b\xa0\x47\x6b\x74\x8e\xd4\x60\x2f\x95\xc4\x41\x85\xae\xeb\x51\x05\x6e\x5b\xd8\xa9\xc6\x0c\xe9\x26\xf0\x0d\xd1\xbf\x9b\xaf\xb0\x1d\x17\xac\xf8\x42\x75\x57\x3b\x65\x62\x73\x5d\x40\xea\xae\xba\x74\x8c\x46\x7b\xd8\x1c\xfd\xe1\x00\x5f\x2b\xd4\x02\x4d\xd7\x7b\x74\xce\xfb\xe8\x47\xa5\xae\xab\x74\xae\xcb\x6d\xf3\xbf\x67\xf9\xe1\x00\x27\x31\xf1\x3c\x56\x37\x9b\x43\x9c\xd9\xce\xca\xb6\xd8\x75\x01\x9a\x7d\x1f\x4b\xb8\x2c\x05\x4a\x5b\xfb\xd6\xd8\x67\x48\xa4\x8d\xf9\xf5\xc3\x9c\xc5\x7a\x06\x44\x73\x1f\xc7\x36\x76\xcb\x25\x7c\xda\xe5\x14\x81\xa6\xbc\x70\x58\x55\xa2\xa4\x17\x10\x15\xc6\x8a\x36\xa9\xbc\xb9\x47\x4c\x6c\x0c\x23\xde\x5b\x65\x11\xec\x86\x5b\x78\x56\x15\x48\xc4\x9c\xae\xc6\x8c\x97\x65\x9f\xf6\x93\x7c\xd4\x7c\x37\x9b\xc3\x0a\x0b\xa5\xd1\x51\xb4\x52\xb7\x68\x37\x2a\xf7\xc5\x6a\xa0\x24\x09\x45\xcb\x1b\x87\x39\x14\x5a\x6d\x81\x83\xd5\x5c\x1a\x9e\x51\xfd\x5e\x00\x97\xb9\x8b\x4c\xb4\xe8\x98\x32\xb5\xa5\xd6\x0c\x73\x2a\x62\x5a\x95\x25\x15\x31\x9e\x3d\xb0\xe4\x4d\xd1\xf2\xb8\x34\x81\x62\xfe\xf3\x67\x89\x51\x98\xfe\x50\x94\x5a\x81\xe3\x18\x85\xc0\x38\xd0\xa0\x72\x7f\xcc\x4b\xc9\xe7\xe1\xff\x0d\x90\x80\x17\x16\x35\x08\x4f\x98\x95\xca\x60\xbe\x20\x1d\x46\x79\x7e\x8a\x58\x51\xd9\x4a\x63\x7b\x10\x1e\x45\x59\xc2\x0a\x01\x9f\x30\xab\x08\x45\xbb\xd1\xaa\x5a\x6f\x9c\x21\xbe\x4f\x83\xc7\x8d\xc8\x36\x90\x69\xe4\x9e\xa0\x17\x84\xb7\xe2\xdc\xe4\x46\x6f\x9d\xe0\xb5\x4f\x0b\x50\x0f\x74\x98\x8f\x83\xc8\x42\xb7\x38\x3b\xb1\x4f\x57\xee\xe7\x3c\xa1\xc2\xfe\x9d\x7a\x70\x87\x68\xc7\xa5\xc8\x66\x69\xf3\xa2\x3e\x1c\xce\x46\x0f\x56\xaa\xcb\x3d\xa4\x78\xf3\x74\x4d\xdd\x51\x99\xbc\xaa\x19\xce\xc1\x3e\xb1\x5c\xef\xdb\x54\x18\x90\x27\xc3\x17\xb9\xef\x08\x8d\xd5\x42\xae\x7b\x8f\xf6\xa9\x29\x45\xe6\x0a\xda\xae\xac\x34\x2f\xfb\x67\xa0\x23\xf0\x66\x73\xd8\x71\x6d\xdc\xd3\xc6\x2f\xab\x62\x70\x38\xdb\xc6\xaf\x65\xfb\xfc\xa5\x07\xb0\xd3\xea\x9a\x2a\x7c\xb2\x54\x0e\xa6\x90\xde\x11\x6d\xda\xf1\x78\xf7\x5f\x69\xc0\x43\x71\xdf\x72\xf9\x3c\xee\xbf\x8f\x37\xd8\x51\xf1\x39\x9e\x1e\xb1\xd1\x73\xf0\x78\xcf\xb2\x62\x1d\x7e\xba\x6b\x9f\x4a\xd3\x2f\x82\x8c\xf2\x57\xc1\x48\x46\xe8\x3e\xa3\xb5\xcf\xbf\x88\x2f\x21\x7a\x70\x0e\x59\xb1\xa6\xf0\xf6\xcc\xa9\x6b\xea\xf5\xbb\x60\x59\x05\x6b\x94\xa8\xe9\x37\x87\x62\x6b\xe9\x0a\x71\x71\x03\xb1\xdd\x95\x48\xef\x61\xd7\x42\x86\xde\x7f\x38\xcf\x89\xc2\x7c\x18\x66\xd2\xf8\x5a\xa3\xfb\xc8\xcb\xef\xa4\xfb\x43\x1f\x6b\x7e\xeb\x55\xe3\xe9\x67\x73\xf0\x36\x38\x40\xf6\x5c\xb7\xb5\xdd\x2f\x1b\xf6\x93\xff\x4e\x26\x93\xb0\xc3\xfe\xa3\x85\xc5\xc0\x9e\xc6\x42\x67\x74\x22\x8e\x92\x39\x03\x7d\x76\xcc\x52\x91\x9f\xbf\xdb\xa7\x8b\xd1\x91\xbd\xb9\x9a\xcf\x93\xde\x8c\x81\x9a\xdf\x23\xb3\x92\x68\x3c\x11\xbf\xc7\x5d\xcf\x73\xd4\xc8\x05\xf4\x46\x05\xe7\x7f\x35\x0d\xdb\xdf\x9c\xc9\xc3\x41\x84\x7f\x56\x9a\x22\xce\xe9\x77\x86\xbd\xa3\x27\x64\x6b\xf1\x68\xaa\xd0\x72\x8e\x46\x0b\xbe\xa3\x13\x05\xec\x9b\x52\x65\x0a\x38\x1c\xfe\x02\x7b\xf8\xae\xd7\x4b\xbe\xcd\x7c\x6f\x73\xa7\x8c\xae\xb7\x69\xc1\x6e\xcc\xbd\xd8\x22\xcc\xc2\xa8\xe2\x1f\xdc\xfc\x5d\x51\xef\x30\x6f\x2d\x38\x2e\x7f\xcf\x3e\xb8\xa7\xce\xcc\x8a\x2d\xb2\x8b\xdb\xbb\x9b\xcb\x79\xac\xc1\x01\x13\xab\x09\x49\xf8\xcd\x8a\x4e\xf6\x23\xb1\xaf\x33\xf4\xd2\xc6\xe5\xcc\xc9\xbe\x6f\x5a\xdb\xd8\x86\x6e\x77\x2c\xf9\x9b\x10\xfd\x66\x40\x8f\x49\x6f\xe3\xfb\x32\xae\xbf\x17\xd6\x57\xd5\x0d\x65\xbf\xca\x35\x86\xb6\x93\x13\x0b\x92\xbd\xcc\xee\x3e\xc7\x73\xbc\xe6\xa3\xa7\xed\xa7\x67\x8b\xb3\x1f\xe6\x3f\xcc\xbb\x8e\xb5\xd9\x6f\x0a\xd0\xa0\xdf\x1c\xd6\x58\x2a\xe4\xa1\xc8\xfa\x7e\x10\xc1\xf2\x75\xd3\x6b\xc7\xc3\x8a\x53\x3f\x00\x7c\xa1\xd4\x76\x33\xa8\x68\xa2\xda\x1b\xa4\x3a\x59\x2f\x4f\x0f\xc2\x98\xf7\x7f\x46\xc9\xb3\xd4\x4d\x56\xd2\x5f\x8f\x0c\x4f\x8f\x3a\xe0\x26\x80\x64\x7e\xb0\x94\x0c\x79\xc9\xd0\x6e\x5a\x18\x1b\x7a\xcf\xd7\x7e\x60\xe0\xad\x89\x0a\xa4\x6d\xa6\x03\xe1\xa5\x4c\xcb\xf0\x3e\xdc\x93\xdd\x40\xd3\x52\x77\x93\x9e\xa6\xed\xe2\x9b\x8c\x77\xad\x5f\xc6\x25\xb5\x79\x6a\x8f\x5a\x8b\x3c\x47\x49\xcf\x59\xa5\xdd\xff\x40\xfc\x98\x8b\x1f\x9b\x7f\xb9\xc1\x02\xcf\x36\x6e\x50\xc2\x8e\x3b\x7b\x64\xf2\x45\xf6\xa0\xcc\x0f\x87\xe4\xff\x01\x00\x00\xff\xff\xeb\x7d\xe0\xe0\xc3\x19\x00\x00") +var _templateEntTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x59\x5f\x6f\xe3\xb8\x11\x7f\xb6\x3e\xc5\x9c\xe0\xbd\xb3\x83\x84\xde\xde\x5b\xd3\xa6\xc0\x5e\xb2\xdb\x06\x58\xe4\xda\x26\x8b\x3e\x6c\x17\x77\xb4\x34\xb2\xd9\xc8\xa4\x97\xa4\x9c\x04\x82\xbf\x7b\x31\x24\x25\x51\x7f\x92\xcb\xde\x3d\xc5\x22\xe7\xef\x6f\x86\xc3\xe1\xa4\xae\x57\x27\xc9\xa5\xda\x3f\x69\xb1\xd9\x5a\xf8\xf1\xed\x9f\xfe\x7c\xb6\xd7\x68\x50\x5a\xf8\xc0\x33\x5c\x2b\x75\x0f\xd7\x32\x63\xf0\xae\x2c\xc1\x11\x19\xa0\x7d\x7d\xc0\x9c\x25\x77\x5b\x61\xc0\xa8\x4a\x67\x08\x99\xca\x11\x84\x81\x52\x64\x28\x0d\xe6\x50\xc9\x1c\x35\xd8\x2d\xc2\xbb\x3d\xcf\xb6\x08\x3f\xb2\xb7\xcd\x2e\x14\xaa\x92\x79\x22\xa4\xdb\xff\x78\x7d\xf9\xfe\xe6\xf6\x3d\x14\xa2\x44\x08\x6b\x5a\x29\x0b\xb9\xd0\x98\x59\xa5\x9f\x40\x15\x60\x23\x65\x56\x23\xb2\xe4\x64\x75\x3c\x26\x49\x5d\x43\x8e\x85\x90\x08\xe9\x4e\xe5\x58\xa6\x10\x56\xe7\xfb\xfb\x0d\x9c\x5f\xc0\x9a\x1b\x84\x39\xbb\x54\xb2\x10\x1b\xf6\x4f\x9e\xdd\xf3\x0d\x12\x51\x5d\x83\xc5\xdd\xbe\xe4\x16\x21\xdd\x22\xcf\x51\xa7\x30\x6f\xd8\xbb\x2d\xb1\xdb\x2b\x6d\x9b\x2d\xff\x05\x8b\x64\x56\xd7\x67\xa0\xb9\xdc\x20\xcc\xf7\xdc\x6e\x49\xd7\x9c\xdd\x8a\x75\x29\xe4\xe6\xda\x51\x19\xe2\x98\xcd\x52\x67\x0d\x91\x1c\x8f\xa9\xe7\x43\x99\xd3\xde\x32\x49\x56\x2b\xa0\x6d\x76\xc3\x77\x64\x15\x61\x48\x00\x38\x5f\x00\xa5\x15\xf6\x09\x0a\xe5\x91\xec\x11\x9a\x6c\x8b\x3b\xce\x12\xfb\xb4\x1f\xee\x58\x5d\x65\x16\xea\x64\x96\x39\xa7\xa1\xe7\x8e\x93\xbc\x52\x3b\x61\x2d\xdf\x98\xe0\xd6\x6c\xb5\x82\xeb\x2b\x8f\x33\x92\x5a\xe6\xed\x14\x05\xcc\xd9\xf5\x15\xbb\x54\xbb\x1d\x65\x85\xf3\x27\x72\xbc\x24\xe0\xcf\x2f\xc0\xec\x4b\x61\xfb\xa4\xe9\x7f\x65\xea\xe9\x67\xc1\x47\x47\xdc\x4a\x08\x10\xf4\x7e\x5f\x5f\x79\x4f\xae\xaf\xd8\x1d\xb9\x75\x3c\xd2\xf7\x83\xb0\x5b\x98\xb3\x77\x52\x2a\xcb\xad\x50\xd2\xb0\x0f\x02\xcb\xdc\xb0\x5b\xe7\xe9\x1d\xdf\x30\x41\x02\x7e\xad\x6b\x60\xe1\x2f\x96\x06\xc3\x4f\x27\xaf\x25\x6d\xf6\x23\xf5\xc1\x99\xc2\x87\xd0\xcb\xee\x0c\x9d\x5b\xee\x12\x69\x5e\xf4\x84\xb4\x86\x11\x8c\x9e\xf3\x25\x0b\x23\x0e\x21\x73\x7c\x0c\x7c\xf3\xa2\x09\x1b\x19\x4a\x9a\x2e\x9c\x0b\xad\x85\x91\xa9\x0d\x8e\x8d\x1d\x4e\x05\x61\xb4\x55\x64\x30\x45\xee\xc0\xcb\x0a\x9b\x30\xa6\x9e\x38\xc8\x4f\xa1\x20\x7a\x16\xbc\xa2\xc8\x16\xfd\xb8\xbe\x10\xd8\x62\x2a\xac\xe3\xb8\xf6\x82\x39\xfc\x98\x30\xbc\xae\x83\x1d\x37\xa2\x2c\xf9\xba\x24\x31\x27\xb1\xeb\xf3\x22\x4e\x04\x51\x80\x54\xce\x9a\x5b\x94\x46\x58\x71\x68\x43\x6c\xbb\xc0\xfa\xc0\xff\x66\xce\x0f\x72\x20\xfe\x1d\x12\xee\x7d\xbe\x41\xd3\x22\xef\xbf\x3a\xa8\x35\x96\x3e\xd4\x2b\x74\x3b\x74\x48\x95\xdd\xa2\x06\xa9\x72\x34\x4d\x25\xdb\x68\xbe\xdf\x32\x2f\xe2\xae\x89\x90\x01\xae\x11\xd6\x28\xe4\x06\xf6\x6a\x5f\x91\x95\x39\xac\x9f\x46\xa7\xfc\x5f\x15\xea\x27\x78\xd8\xa2\x04\xe4\x1b\xd4\x67\xa5\xe2\x39\x71\x51\x31\x44\x3a\xa5\x33\x6f\x57\xcc\xd4\xae\x0c\x01\x20\x43\xe3\x43\xdf\xf8\x7d\xd6\x7c\xac\x4e\xe0\x5d\x9e\x0b\x72\x8b\x97\x3e\x5f\x0c\x58\x05\x3c\x6f\xad\x33\x56\x69\x2a\xa0\xb9\x16\x07\xd4\x0c\x5c\x15\x0e\xe7\x64\xb7\x2f\x29\x67\xf6\x5a\x48\x5b\x40\x9a\x0b\x5e\x62\x66\x57\x6f\xcc\xca\xeb\xf7\x02\x53\x2a\x93\x41\x4a\xc3\x2b\x0a\xd8\x72\x73\xd7\xd8\xeb\x45\xb5\x49\xf4\x68\xfb\x1b\x6c\x32\x6a\xaf\x30\xbe\x32\xb1\xc9\x23\x7c\x3c\xcf\x8a\xb7\x52\x02\x50\xee\x46\x18\xa7\xc5\xa0\x74\xff\xb1\x04\x19\x95\x71\x2f\xae\xab\xe5\xd1\xe1\x74\x27\x93\xf5\x6a\x02\xbe\xb2\x26\x78\xda\xe6\xa6\x20\xc3\x58\x38\x9c\x23\x09\xd1\x81\x43\xf6\x49\x8a\xaf\x15\xf1\x7c\xfe\xd2\x1e\x9c\x13\xcf\x46\x07\xb4\x95\xd8\x56\x45\x1c\x55\x5c\x36\x51\x79\x9b\xdf\xab\x15\x50\x66\x63\x4e\xc2\x62\x10\x85\x2c\x94\xde\x39\x1c\x1d\x80\x1a\xe9\x62\x75\x27\xa0\x00\xee\x18\x1d\x72\x0f\xdc\x04\x09\xb0\x70\x64\x5f\x2b\x34\x16\xf3\x25\xc1\xdc\x3f\x3a\x8a\x02\x40\x47\x27\xd6\xf8\xb9\xae\xa1\x44\xe9\x8c\xfc\xb2\x56\xaa\x6c\x82\x1e\x20\x17\xa7\x3d\xd8\x9f\x41\xfd\x67\xfd\x5e\x93\x72\x5b\x69\x69\x22\xbc\x07\xc8\x86\x88\x68\xe0\x12\x50\x6b\xa5\xc9\x19\x77\xf1\xe6\x1b\x74\xc2\xc9\x1d\x42\x3e\xb8\x34\xf4\x21\xd4\xcd\x28\x2c\xa7\x24\x2e\x50\xaf\x2b\xdb\x0a\x70\x9d\x56\x0b\x3a\x4b\x66\x45\x25\x33\x58\x4c\xa4\xda\xf2\x79\x8f\x16\x4b\x58\xfc\x9e\x6c\x38\xf5\xde\x2d\x29\x7d\x67\xa2\x00\x64\x11\xe4\x84\xf8\x5c\x10\xdc\x6e\xbb\xbd\x94\x22\xe9\xee\x92\x71\x7c\x93\x30\x5e\x5c\x80\x14\xa5\xe7\x6e\xeb\x2b\x41\x38\xc8\xf2\x28\x37\x86\x40\x9e\xb6\xbc\x23\xd0\x98\xdf\xf2\xc1\x24\x45\xa7\xf0\xfd\x8d\xb2\x1f\x68\xef\x3d\xb9\x55\x97\x7c\x8d\xe5\x39\x44\x7e\x77\xdd\x25\xfb\x48\x9b\xde\x83\xf1\xcd\xd8\x48\x9d\x76\xec\x94\xb4\x25\x9e\x6f\xa8\xfe\xa3\xf3\xc3\xeb\x27\x57\xcf\xfd\x2d\xdf\x3a\x9b\x1e\x93\xd9\x31\x89\x94\x45\x3f\x5d\x57\xec\x0a\xe8\x64\x8d\xce\x91\x9a\xf8\x95\x92\x38\xa8\xd0\x75\x3d\xaa\xc0\x6d\x9b\x3c\xd7\x98\x21\xdd\x04\xbe\x03\xfa\x77\xf3\x15\xb6\xe3\x82\x15\x5f\xa8\xee\x6a\xa7\x4c\x6c\xae\x0b\x48\xdd\x55\x97\x8e\xd1\x68\x0f\x9b\xa3\x3f\x1e\xe1\x6b\x85\x5a\xa0\xe9\x5a\x9c\xce\x79\x1f\xfd\xa8\xd4\x75\x95\xce\x75\xd2\x6d\xfe\xf7\x2c\x3f\x1e\xe1\x24\x26\x5e\xc6\xea\x16\x4b\x88\x33\xdb\x59\xd9\x16\xbb\x2e\x40\x8b\xef\x63\x09\x97\xa5\x40\x69\x6b\xdf\x7e\xfb\x0c\x89\xb4\x31\xbf\x7e\x5c\xb2\x58\xcf\x80\x68\xe9\xe3\xd8\xc6\x6e\xb5\x82\x4f\xfb\x9c\x22\xd0\x94\x17\x0e\xeb\x4a\x94\xf4\xca\xa2\xc2\x58\xd1\x26\x95\x37\xf7\x50\x8a\x8d\x61\xc4\x7b\xa3\x2c\x82\xdd\x72\x0b\x4f\xaa\x02\x89\x98\xd3\xd5\x98\xf1\xb2\xec\xd3\x7e\x92\x0f\x9a\xef\x17\x4b\x58\x63\xa1\x34\x3a\x8a\x56\xea\x0e\xed\x56\xe5\xbe\x58\x0d\x94\x24\xa1\x68\x79\xe3\x30\x87\x42\xab\x1d\x70\xb0\x9a\x4b\xc3\x33\xaa\xdf\xa7\xc0\x65\xee\x22\x13\x2d\x3a\xa6\x4c\xed\xa8\x35\xc3\x9c\x8a\x98\x56\x65\x49\x45\x8c\x67\xf7\x2c\x79\x55\xb4\x3c\x2e\x4d\xa0\x98\xff\xfc\x59\x62\x14\xa6\x3f\x14\xa5\x56\xe0\x38\x46\x21\x30\x0e\x34\xa8\xdc\x1f\xf3\x5c\xf2\x79\xf8\x7f\x03\x24\xe0\x85\x45\x0d\xc2\x13\x66\xa5\x32\x98\x9f\x92\x0e\xa3\x3c\x3f\x45\xac\xa8\x6c\xa5\xb1\x3d\x08\x0f\xa2\x2c\x61\x8d\x80\x8f\x98\x55\x84\xa2\xdd\x6a\x55\x6d\xb6\xce\x10\xdf\xa7\xc1\xc3\x56\x64\x5b\xc8\x34\x72\x4f\xd0\x0b\xc2\x6b\x71\x6e\x72\xa3\xb7\x4e\xf0\xda\xc7\x53\x50\xf7\x74\x98\xa7\x41\x64\xa1\x5b\x5c\x9c\xd8\xc7\x2b\xf7\x73\x99\x50\x61\xff\x4e\xdd\xbb\x43\xb4\xe7\x52\x64\x8b\xb4\x79\xb5\x1f\x8f\xe7\xa3\x47\x31\xd5\xe5\x1e\x52\xbc\x79\x1e\xa7\xee\xa8\xcc\x5e\xd4\x0c\x17\x60\x1f\x59\xae\x0f\x6d\x2a\x0c\xc8\x93\xe1\xab\xdf\x77\x84\xc6\x6a\x21\x37\xbd\xc1\xc0\xdc\x94\x22\x73\x05\x6d\x5f\x56\x9a\x97\xfd\x33\xd0\x11\x78\xb3\x39\xec\xb9\x36\xee\x69\xe3\x97\x55\x31\x38\x9c\x6d\xe3\xd7\xb2\x7d\xfe\xd2\x03\xd8\x69\x75\x4d\x15\x3e\x5a\x2a\x07\x73\x48\x6f\x89\x36\xed\x78\xbc\xfb\x2f\x34\xe0\xa1\xb8\xef\xb8\x7c\x1a\xf7\xdf\xd3\x0d\x76\x54\x7c\xa6\xd3\x23\x36\x7a\x09\x1e\xef\x45\x56\x6c\xc2\x4f\x77\xed\x53\x69\xfa\x45\x90\x51\xfe\x2a\x18\xc9\x08\xdd\x67\xb4\xf6\xf9\x17\xf1\x25\x44\x0f\x2e\x20\x2b\x36\x14\xde\x9e\x39\x75\x4d\xbd\x7e\x17\x2c\xab\x60\x83\x12\x35\xfd\xe6\x50\xec\x2c\x5d\x21\x2e\x6e\x20\x76\xfb\x12\xe9\xe1\xea\x5a\xc8\xd0\xfb\x0f\x67\x46\x51\x98\x8f\xc3\x4c\x1a\x5f\x6b\x74\x1f\x79\xf9\x9d\x74\x7f\xe8\x63\xcd\xaf\xbd\x6a\x3c\xfd\x62\x09\xde\x06\x07\xc8\x81\xeb\xb6\xb6\xfb\x65\xc3\x7e\xf2\xdf\xc9\x6c\x16\x76\xd8\x7f\xb4\xb0\x18\xd8\xd3\x58\xe8\x82\x4e\xc4\x24\x99\x33\xd0\x67\xc7\x22\x15\xf9\xc5\x9b\x43\x7a\x3a\x3a\xb2\xd7\x57\xcb\x65\x7f\xca\x43\xcd\xef\xc4\x70\x24\x9a\x23\xc4\xef\x71\xd7\xf3\x4c\x1a\x79\x0a\xbd\x89\xc4\xc5\x5f\x4d\xc3\xf6\x37\x67\xb2\x6f\x92\xfc\xfb\xdd\x49\x71\xcf\x4a\x53\xc4\x39\xfd\xc6\xb0\x37\xf4\x84\x6c\x2d\x1e\x4d\x15\x5a\xce\xd1\x68\xc1\x77\x74\xa2\x80\x43\x53\xaa\x4c\x01\xc7\xe3\x5f\xe0\x00\xdf\xf5\x7a\xc9\xd7\x99\xef\x6d\xee\x94\xd1\xf5\x36\x2f\xd8\xb5\xb9\x13\x3b\x84\x45\x18\x55\xfc\x83\x9b\xbf\x2b\xea\x1d\x96\xad\x05\xd3\xf2\x0f\xec\x83\x7b\xea\x2c\xac\xd8\x21\x7b\x77\x73\x7b\x7d\xb9\x8c\x35\x38\x60\x62\x35\x21\x09\xbf\x59\xd1\xc9\x61\x24\xf6\x65\x86\x5e\xda\xb8\x9c\x39\x39\xf4\x4d\x6b\x1b\xdb\xd0\xed\x8e\x25\x7f\x13\xa2\xdf\x0c\xe8\x94\xf4\x36\xbe\xcf\xe3\xfa\x7b\x61\x7d\x51\xdd\x50\xf6\x8b\x5c\x63\x68\x3b\x39\xb1\x20\xd9\xcb\xec\xee\xf3\xf9\x81\x5b\x4f\xdb\x4f\x4f\x16\x17\x3f\x2c\x7f\x58\x76\x1d\x6b\xb3\xdf\x14\xa0\x41\xbf\x39\xac\xb1\x54\xc8\x43\x91\xf5\xfd\x20\x82\xe5\x9b\xa6\xd7\x8e\x87\x15\x67\x7e\xce\xf8\x4c\xa9\xed\x66\x50\xd1\x08\xb5\x37\x39\x75\xb2\x9e\x9f\x1e\x84\xb9\xee\xff\x8c\x92\xe7\xa9\x9b\xac\xa4\xbf\x4e\x4c\x4b\x27\x1d\x70\x13\x40\x32\x3f\x58\x4a\x86\x3c\x67\x68\x37\x2d\x8c\x0d\xbd\xe3\x1b\x3f\x30\xf0\xd6\x44\x05\xd2\x36\xd3\x81\xf0\x52\xa6\x65\x78\x1b\xee\xc9\x6e\xa0\x69\xa9\xbb\x49\xcf\xd2\x76\xf1\x55\xc6\xbb\xd6\x2f\xe3\x92\xda\x3c\x75\x40\xad\x45\x9e\xa3\xa4\xe7\xac\xd2\xee\xff\x2c\x7e\xcc\xc5\xa7\xe6\x5f\x6e\xb0\xc0\xb3\xad\x1b\x94\xb0\x69\x67\x27\x26\x5f\x64\x0f\xca\xfc\x78\x4c\xfe\x1f\x00\x00\xff\xff\x74\x22\xc3\xc8\x27\x1a\x00\x00") func templateEntTmplBytes() ([]byte, error) { return bindataRead( @@ -946,7 +946,7 @@ func templateEntTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/ent.tmpl", size: 6595, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/ent.tmpl", size: 6695, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/ent.tmpl b/entc/gen/template/ent.tmpl index 550c13987..f7096abd8 100644 --- a/entc/gen/template/ent.tmpl +++ b/entc/gen/template/ent.tmpl @@ -21,15 +21,19 @@ import ( type {{ $.Name }} struct { config {{ template "model/omittags" $ }} // ID of the ent. + {{- if $.ID.Comment }} + {{- range $line := split $.ID.Comment "\n" }} + // {{ $line }} + {{- end }} + {{- end }} ID {{ $.ID.Type }} {{ with $.Annotations.Fields.StructTag.id }}`{{ . }}`{{ else }}`{{ $.ID.StructTag }}`{{ end }} {{- range $f := $.Fields }} {{- $tag := $f.StructTag }}{{ with $tags := $.Annotations.Fields.StructTag }}{{ with index $tags $f.Name }}{{ $tag = . }}{{ end }}{{ end }} + // {{ $f.StructField }} holds the value of the "{{ $f.Name }}" field. {{- if $f.Comment }} {{- range $line := split $f.Comment "\n" }} // {{ $line }} {{- end }} - {{- else }} - // {{ $f.StructField }} holds the value of the "{{ $f.Name }}" field. {{- end }} {{ $f.StructField }} {{ if $f.Nillable }}*{{ end }}{{ $f.Type }} {{ if not $f.Sensitive }}`{{ $tag }}`{{ else }}{{ template "model/omittags" $ }}{{ end }} {{- end }} diff --git a/entc/integration/config/config_test.go b/entc/integration/config/config_test.go index 614d4a0c4..7f6df4e75 100644 --- a/entc/integration/config/config_test.go +++ b/entc/integration/config/config_test.go @@ -59,7 +59,7 @@ func TestSchemaConfig(t *testing.T) { require.NoError(t, err) ast.Inspect(f, func(n ast.Node) bool { if f, ok := n.(*ast.Field); ok && len(f.Names) > 0 && f.Names[0].Name == fd.Name { - require.Equal(t, fd.Comment, f.Doc.Text()) + require.Contains(t, fd.Comment, f.Doc.Text()) return false } return true diff --git a/entc/integration/config/ent/user.go b/entc/integration/config/ent/user.go index 0490faee0..caa2d3f2d 100644 --- a/entc/integration/config/ent/user.go +++ b/entc/integration/config/ent/user.go @@ -19,6 +19,7 @@ type User struct { config `json:"-"` // ID of the ent. ID int `json:"id,omitempty"` + // Name holds the value of the "name" field. // Comment line1 // Comment line2 Name string `json:"name,omitempty"` diff --git a/entc/integration/ent/card.go b/entc/integration/ent/card.go index d8dffde67..fe9e52a03 100644 --- a/entc/integration/ent/card.go +++ b/entc/integration/ent/card.go @@ -27,6 +27,7 @@ type Card struct { UpdateTime time.Time `json:"update_time,omitempty"` // Number holds the value of the "number" field. Number string `json:"-"` + // Name holds the value of the "name" field. // Exact name written on card Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. diff --git a/entc/integration/ent/group.go b/entc/integration/ent/group.go index 528100291..a47c7b998 100644 --- a/entc/integration/ent/group.go +++ b/entc/integration/ent/group.go @@ -29,6 +29,7 @@ type Group struct { Type *string `json:"type,omitempty"` // MaxUsers holds the value of the "max_users" field. MaxUsers int `json:"max_users,omitempty"` + // Name holds the value of the "name" field. // field with multiple validators Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. diff --git a/entc/integration/gremlin/ent/card.go b/entc/integration/gremlin/ent/card.go index 6347a07f6..0961e0347 100644 --- a/entc/integration/gremlin/ent/card.go +++ b/entc/integration/gremlin/ent/card.go @@ -26,6 +26,7 @@ type Card struct { UpdateTime time.Time `json:"update_time,omitempty"` // Number holds the value of the "number" field. Number string `json:"-"` + // Name holds the value of the "name" field. // Exact name written on card Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. diff --git a/entc/integration/gremlin/ent/group.go b/entc/integration/gremlin/ent/group.go index a03799c34..2194269d8 100644 --- a/entc/integration/gremlin/ent/group.go +++ b/entc/integration/gremlin/ent/group.go @@ -28,6 +28,7 @@ type Group struct { Type *string `json:"type,omitempty"` // MaxUsers holds the value of the "max_users" field. MaxUsers int `json:"max_users,omitempty"` + // Name holds the value of the "name" field. // field with multiple validators Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. diff --git a/entc/integration/hooks/ent/card.go b/entc/integration/hooks/ent/card.go index ae08f956b..b1928468b 100644 --- a/entc/integration/hooks/ent/card.go +++ b/entc/integration/hooks/ent/card.go @@ -23,10 +23,12 @@ type Card struct { ID int `json:"id,omitempty"` // Number holds the value of the "number" field. Number string `json:"number,omitempty"` + // Name holds the value of the "name" field. // Exact name written on card Name string `json:"name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` + // InHook holds the value of the "in_hook" field. // A mandatory field that is set by the hook InHook string `json:"in_hook,omitempty"` // Edges holds the relations/edges for other nodes in the graph.