diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index a364425ed..4ada6cc44 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -630,7 +630,7 @@ func templateDialectSqlByTmpl() (*asset, error) { return a, nil } -var _templateDialectSqlCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x7b\x6f\xdc\xb8\x11\xff\x5b\xfa\x14\x73\x0b\x37\x90\x5c\x59\xeb\x04\x45\x81\x3a\xdd\x03\xee\xec\xa4\x5d\xe0\x2e\x68\xe1\xe4\x10\xd4\x30\x02\x2e\x35\xf2\x12\xab\x25\x15\x92\x72\x6d\x2c\xf4\xdd\x8b\x19\x89\x5a\xed\xc3\x8f\xbe\xfe\x49\xb4\xe4\xbc\xf8\x9b\xdf\x0c\x87\xde\x6c\xa6\xa7\xf1\xa5\xa9\x1f\xad\xba\x5b\x7a\x78\x77\xfe\xf6\x4f\x67\xb5\x45\x87\xda\xc3\x47\x21\x71\x61\xcc\x0a\xe6\x5a\xe6\xf0\x53\x55\x01\x0b\x39\xa0\x7d\x7b\x8f\x45\x1e\x7f\x5e\x2a\x07\xce\x34\x56\x22\x48\x53\x20\x28\x07\x95\x92\xa8\x1d\x16\xd0\xe8\x02\x2d\xf8\x25\xc2\x4f\xb5\x90\x4b\x84\x77\xf9\x79\xd8\x85\xd2\x34\xba\x88\x95\xe6\xfd\x5f\xe6\x97\x1f\x3e\x5d\x7f\x80\x52\x55\x08\xfd\x9a\x35\xc6\x43\xa1\x2c\x4a\x6f\xec\x23\x98\x12\xfc\xc8\x99\xb7\x88\x79\x7c\x3a\x6d\xdb\x38\xde\x6c\xa0\xc0\x52\x69\x84\x49\xa1\x44\x85\xd2\x4f\xdd\xf7\x6a\x2a\x2d\x0a\x8f\x13\x68\x5b\x92\x38\x59\x34\xaa\xa2\x78\x2e\x66\x50\x0b\x27\x45\x05\x27\xf9\xb5\x34\x35\xe6\x3f\xf7\x3b\xbd\xa0\x45\x89\xea\xbe\x93\x1c\xbe\x07\xf5\x5e\x68\xdd\x78\xe1\x95\xd1\x6c\xce\x2a\xed\x47\x7a\x93\x3c\xec\x4e\x80\xe4\xe3\xb2\xd1\x12\x92\x1d\xdb\x6d\x0b\xa7\xe3\xa8\xda\x36\x05\xf7\xbd\xba\x16\xf7\x98\x48\xff\x00\xd2\x68\x8f\x0f\x3e\xbf\xec\xfe\x4f\x21\x61\xf1\xfc\x93\x58\x23\xb4\x6d\x06\x68\xad\xb1\x29\x6c\xe2\xe8\x9b\x36\x05\x66\xf0\xcd\xd5\x28\x29\x9c\x3d\x3f\x79\x87\xc3\x75\x8d\x32\x49\xe3\x48\x95\xa4\x4a\x72\xee\x7b\x75\x67\x45\xbd\xcc\x2f\x59\xe0\x93\x29\xd8\x75\x76\x60\xa0\xb0\xf4\xd5\x7b\x48\xdf\xb3\xfe\x0f\x33\xd0\xaa\x22\xf7\x64\x51\xa2\xb5\x19\x98\x15\x99\x55\xee\xfa\xef\xbf\x5c\x1a\xed\xbc\x15\x4a\xfb\x0f\x14\x67\x82\xd6\xa6\xef\x49\x80\x14\x22\x32\x30\x63\xa5\x38\x8a\xda\x38\x8a\x2c\xfa\xc6\x6a\xb2\xc8\x07\x8b\x69\x71\xb3\x39\x03\x55\x82\xd0\x05\x9c\xe4\xf3\xab\xfc\x8b\x43\x7b\xc5\x69\x2e\x20\x31\xb6\x5b\x9c\xbb\x6b\x6f\x95\xbe\x0b\xbf\xbe\x7c\x99\x5f\xa5\x84\x79\xc4\xfa\xd3\x53\xb8\x32\xa0\x8d\x5f\x2a\x7d\x97\xc1\x02\xa5\x68\x1c\x12\xbd\x1c\xc2\x3b\xf0\x8f\x35\x3a\x58\x37\xce\xc3\x02\xc1\x35\x75\x5d\x29\x2c\x60\xf1\xc8\x04\x6c\x1c\xda\x1c\x4e\xa7\x70\xd6\xf6\xe1\x60\xe5\x70\x6b\x5c\x95\x87\x81\xf1\x26\x21\xc2\x49\xc9\xe7\x57\x30\x9b\xc1\x39\x9f\x9a\x0d\xe8\x41\xa4\x20\xac\x18\x51\xb2\xf1\x9b\xa8\x1a\xcc\x13\xa5\xfd\x1f\xff\x90\xd2\xfe\x56\x9f\xd3\x41\x32\x9f\x1f\x6b\xf2\x9e\xa8\x22\x7d\x31\x82\x76\xcf\xe1\xf8\xbb\x07\xbb\xa7\x8d\x56\x55\xfc\x7a\x8a\x8e\xb9\x74\x40\xc9\xd3\x3d\x46\x91\x18\x33\xf4\x5e\x58\x48\xe2\xfe\x50\x30\x83\x37\x63\xbd\x8d\x34\xba\x54\x77\x17\x87\xbc\xe5\x75\x3a\x49\x47\xed\x19\xbc\x39\xe2\x80\x09\xf5\x59\x2c\x2a\xec\x2c\xe4\x7f\x13\x72\x25\xee\xc8\x72\xce\xcb\x19\x09\xcc\xaf\x2e\x46\xda\x1f\x15\x56\xc5\xa0\x1c\x11\xb0\x17\x50\xd2\x62\x3e\x06\x3b\x67\x16\x87\xe3\xb1\xe8\xa5\xa9\x9a\xb5\x3e\xf4\x14\xd4\x58\x43\x68\x1f\x14\xf8\xdf\x36\x8e\xd2\xf8\xf9\x84\xa9\x12\x54\x11\x2a\x68\xa7\xbf\x8c\x8c\xff\xda\xaf\xfd\x05\xc9\x7e\x32\x2a\xa8\x11\x5b\x54\xc1\x0b\x3b\xc4\x0a\xcb\x7b\x44\xa0\x6f\x2b\xf4\x1d\xc2\x49\x49\x7e\x4f\x3a\x60\xdc\x10\xd2\x3d\x29\x3f\x17\x55\xf9\x5c\x4c\x1c\x42\x6f\x71\x06\xa2\xae\x51\x17\xc9\x78\x35\x7b\x7d\x4a\xca\xa7\x12\xc2\xe7\xbb\xe8\x23\x7d\x31\x45\xe5\x61\x82\x46\xd5\xd6\x49\x5c\x7b\xdb\x48\xcf\xf1\x50\x09\xf0\xc1\x29\x6f\x65\xfe\x49\x55\x15\x31\x0a\xda\x96\x18\xdc\xc1\xc8\x9e\x9f\xc5\x16\x3b\x6c\x3f\x14\x77\xb8\x85\x96\x1c\xba\xa7\x60\xc5\xbd\x20\xe6\x57\x8e\x90\xad\x50\x27\xac\x97\xc2\x8f\x7d\x53\x61\x3f\xff\x54\x7e\x09\xf8\xe0\xc9\xf7\x09\x4c\xc8\xd1\x84\xdc\x4e\xa8\xa5\xbb\x09\x78\xdb\x20\x4c\xfe\x81\xd6\x4c\x60\xa2\x55\x35\xe9\x9b\x44\xb4\xd9\x80\xc7\x75\x5d\x09\xbf\x77\x75\x16\x58\x22\x5b\xc9\xa9\x40\x37\xd3\xd3\xfe\x82\x2d\xe8\x72\x26\x81\xa6\x2e\x84\xc7\xdc\xaf\xeb\x0a\xf8\x12\x8e\xf6\x1b\x5c\x97\xe8\xee\xd0\x7b\xd9\xe7\xc5\x0c\xc8\x43\x7a\x88\xdc\x6e\x7b\x62\x8d\xb8\xbb\xe4\x7b\x89\xe7\xef\xfb\x6f\x8b\xa6\x5a\xfd\x1f\x2e\xfd\x78\x3a\x05\xba\x9d\xfb\x16\xe8\xf8\x8a\x18\xf7\x31\x40\xed\x95\x57\xe8\xc2\x00\x53\x08\x2f\x16\xc2\x61\xfe\xda\xe6\xfa\xcc\xe5\x7f\x73\xfb\xe4\xf5\x4f\x00\x31\x93\xd6\x62\x85\x24\x78\xa4\x49\x66\xcc\x9d\xfd\x06\xdb\xfb\x76\x69\x1a\x47\x03\x1f\x83\x95\x5d\x77\x2f\xa9\x33\x83\x8d\x1d\x5b\xf8\xb5\x5b\x7a\x59\xb7\x34\x16\x14\xe3\xce\xf5\xf2\x94\x28\xf3\x9d\x90\x4c\x14\x28\xed\xb3\x6e\x40\x3c\x80\x8a\xab\x62\x94\xf6\xa7\xcc\xdd\xa8\xdb\x40\x5a\xee\xca\x7f\x15\xee\x0a\x4b\xd1\x54\x3e\x54\x47\x2f\x99\x17\xdd\xb2\x4b\xd2\x43\x96\xd3\xcd\xb6\x6e\x3c\xf4\x87\x85\x59\xf7\x85\x1f\x29\x4e\x0e\xf6\x48\x3e\x33\x58\x43\xe8\x9b\x29\x24\xbf\x75\x5d\x76\x9b\xd1\x28\x8a\x42\x47\x08\xcd\x77\x9d\xf7\x97\x6d\xd0\xeb\x33\xc3\x21\x51\x3f\xf9\x21\xb4\xdd\xdd\x61\xaa\x5c\xfb\x9c\x27\xb0\x32\x99\x34\x1a\x1f\x6a\x94\x1e\x0b\x18\x1a\x0e\x4d\x40\xf0\xbb\xcf\x93\x0c\xd6\x9d\xa9\x36\x18\xec\x87\xc4\x00\x82\x5c\xa2\x5c\x25\x87\xc3\x5f\x74\x64\x78\x1b\xcc\x04\xe5\xc1\xdd\x6c\xf0\xcc\xfb\x4c\xba\x1b\x75\x9b\x01\x93\xf8\x46\xdd\xc2\xc8\xe3\xce\xd8\xda\x63\x4d\xde\x19\xa8\x10\xa6\x82\x3f\x33\xc1\x02\x01\xd3\xb3\xb7\x21\xae\x6f\x1c\x4e\xf0\x69\x28\xe5\xbf\x7f\x7b\xdb\x21\x88\x09\xb1\xe7\x70\xd4\xdd\xb2\x83\x44\x43\xb0\x3d\x34\xdd\xfc\xd7\x5b\x9f\x4e\x61\xae\xef\xcd\x8a\xa7\x49\x10\xd2\x37\xa2\x02\x53\xa3\xed\x4e\x6a\xba\x1e\x40\xad\xd5\xf9\x2d\xde\x7d\x6b\x90\x4b\xa1\x74\xde\x19\xea\xb1\x1e\xcd\xe3\x3f\x0b\x2f\x97\x5d\xf1\x3e\x3f\x90\xbf\x39\xa6\xc2\x97\x28\x77\xfe\x8b\x0e\xd6\xf6\x68\xd6\xfe\x83\xb1\x3d\xda\x1f\xdd\xb7\x99\xee\xff\x6b\x77\xc8\x9b\x17\x46\xd3\xec\x41\xf7\xcf\x98\x56\xaf\xa5\xcf\x7f\xfb\x02\x88\xfe\xe7\x8f\x80\x50\xff\xc3\x3b\x20\x7a\x69\x10\x8f\xb6\xb7\xfd\x8d\xba\xdd\x79\x10\x1c\x34\x93\xe1\x59\x10\xaa\xe1\xe8\xcb\x60\x54\x37\xcf\xbd\x0f\x5e\x13\x59\x7b\x34\x8a\xbd\x9f\x21\x3f\x43\xad\xd2\x8b\x61\x98\x9c\x86\xe6\x4d\x45\x18\x4a\x77\x69\xcc\xca\xa5\x70\x06\x6f\xdf\x83\x82\x1f\x67\x70\xfe\x1e\xd4\xd9\xd9\xb6\xb7\x8d\xca\x9c\x65\x6f\xd4\x2d\x55\x70\x1a\x9e\x2e\xd1\xb6\x64\x6f\xbb\x02\xa6\x39\x21\x51\x19\x48\xff\x90\xf2\xf3\x50\x95\xbb\x75\x3f\x8c\x44\xf4\xf8\xca\x42\xfb\x1a\xec\x9c\x0f\x85\x7f\xb4\xa2\x86\xba\x3f\x1f\x55\xfd\x61\xd9\x1c\x72\xb5\xe5\x60\xc6\x18\x0d\x4f\xaa\x7e\x60\xf8\xda\xfd\x4d\x64\x85\xfc\x2b\x83\x45\xe3\xa1\x16\x5a\x49\xd7\x91\xbb\xeb\x67\x60\xa4\x6c\xac\xfb\xb7\x66\x85\xaf\xc7\x87\x85\xbd\xcb\x9b\x1f\x60\x03\x20\xfb\x07\x0f\x33\xc7\xf6\x2f\x03\xa3\xf3\x72\x98\xdc\x04\xc6\xa7\xbc\x8f\xdb\xd1\x34\xf6\xaf\x00\x00\x00\xff\xff\x08\x8e\xcc\xc9\x41\x12\x00\x00") +var _templateDialectSqlCreateTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x6d\x6f\xdb\xc8\x11\xfe\x4c\xfe\x8a\x39\xc1\x0d\x48\x57\xa6\x9c\xa0\x28\x50\xa7\x3a\x20\x67\x27\xad\x80\xbb\xa0\x85\x9d\xc3\xa1\x86\x11\x50\xe4\x50\x5a\x88\xda\x65\x76\x97\x3e\x1b\x02\xff\x7b\x31\xb3\xbb\x14\xf5\xe2\x97\x36\xed\x97\x84\xda\x9d\xb7\x9d\x7d\xe6\xd9\x19\x6f\x36\x93\xd3\xf8\x52\x35\x8f\x5a\x2c\x96\x16\xde\x9d\xbf\xfd\xcb\x59\xa3\xd1\xa0\xb4\xf0\x29\x2f\x70\xae\xd4\x0a\x66\xb2\xc8\xe0\x43\x5d\x03\x0b\x19\xa0\x7d\x7d\x8f\x65\x16\xdf\x2c\x85\x01\xa3\x5a\x5d\x20\x14\xaa\x44\x10\x06\x6a\x51\xa0\x34\x58\x42\x2b\x4b\xd4\x60\x97\x08\x1f\x9a\xbc\x58\x22\xbc\xcb\xce\xc3\x2e\x54\xaa\x95\x65\x2c\x24\xef\xff\x3c\xbb\xfc\xf8\xf9\xfa\x23\x54\xa2\x46\xf0\x6b\x5a\x29\x0b\xa5\xd0\x58\x58\xa5\x1f\x41\x55\x60\x07\xce\xac\x46\xcc\xe2\xd3\x49\xd7\xc5\xf1\x66\x03\x25\x56\x42\x22\x8c\x4a\x91\xd7\x58\xd8\x89\xf9\x56\x4f\x0a\x8d\xb9\xc5\x11\x74\x1d\x49\x9c\xcc\x5b\x51\x53\x3c\x17\x53\x68\x72\x53\xe4\x35\x9c\x64\xd7\x85\x6a\x30\xfb\xc9\xef\x78\x41\x8d\x05\x8a\x7b\x27\xd9\x7f\xf7\xea\x5e\x68\xdd\xda\xdc\x0a\x25\xd9\x9c\x16\xd2\x0e\xf4\x46\x59\xd8\x1d\x01\xc9\xc7\x55\x2b\x0b\x48\x76\x6c\x77\x1d\x9c\x0e\xa3\xea\xba\x14\xcc\xb7\xfa\x3a\xbf\xc7\xa4\xb0\x0f\x50\x28\x69\xf1\xc1\x66\x97\xee\xff\x14\x12\x16\xcf\x3e\xe7\x6b\x84\xae\x1b\x03\x6a\xad\x74\x0a\x9b\x38\xfa\x2a\x55\x89\x63\xf8\x6a\x1a\x2c\x28\x9c\x3d\x3f\x99\xcb\xc3\x75\x83\x45\x92\xc6\x91\xa8\x48\x95\xe4\xcc\xb7\x7a\xa1\xf3\x66\x99\x5d\xb2\xc0\x67\x55\xb2\xeb\xf1\x81\x81\x52\xd3\x97\xf7\x90\xbe\x67\xfd\x1f\xa6\x20\x45\x4d\xee\xc9\x62\x81\x5a\x8f\x41\xad\xc8\xac\x30\xd7\xff\xfc\xf9\x52\x49\x63\x75\x2e\xa4\xfd\x48\x71\x26\xa8\x75\xfa\x9e\x04\x48\x21\x22\x03\x53\x56\x8a\xa3\xa8\x8b\xa3\x48\xa3\x6d\xb5\x24\x8b\x7c\xb0\x98\x16\x37\x9b\x33\x10\x15\xe4\xb2\x84\x93\x6c\x76\x95\x7d\x31\xa8\xaf\xf8\x9a\x4b\x48\x94\x76\x8b\x33\x73\x6d\xb5\x90\x8b\xf0\xeb\xcb\x97\xd9\x55\x4a\x39\x8f\x58\x7f\x72\x0a\x57\x0a\xa4\xb2\x4b\x21\x17\x63\x98\x63\x91\xb7\x06\x09\x5e\x06\xe1\x1d\xd8\xc7\x06\x0d\xac\x5b\x63\x61\x8e\x60\xda\xa6\xa9\x05\x96\x30\x7f\x64\x00\xb6\x06\x75\x06\xa7\x13\x38\xeb\x7c\x38\x58\x1b\xdc\x1a\x17\xd5\x61\x60\xbc\x49\x19\xe1\x4b\xc9\x66\x57\x30\x9d\xc2\x39\x9f\x9a\x0d\xc8\x5e\xa4\xa4\x5c\x71\x46\xc9\xc6\xaf\x79\xdd\x62\x96\x08\x69\xff\xfc\xa7\x94\xf6\xb7\xfa\x7c\x1d\x24\x73\xf3\xd8\x90\xf7\x44\x94\xe9\x8b\x11\x74\x7b\x0e\x87\xdf\x3e\xd9\x1e\x36\x52\xd4\xf1\xeb\x21\x3a\xc4\xd2\x01\x24\x4f\xf7\x10\x45\x62\x8c\xd0\xfb\x5c\x43\x12\xfb\x43\xc1\x14\xde\x0c\xf5\x36\x85\x92\x95\x58\x5c\x1c\xe2\x96\xd7\xe9\x24\x0e\xda\x53\x78\x73\xc4\x01\x03\xea\x26\x9f\xd7\xe8\x2c\x64\xff\xc8\x8b\x55\xbe\x20\xcb\x19\x2f\x8f\x49\x60\x76\x75\x31\xd0\xfe\x24\xb0\x2e\x7b\xe5\x88\x12\x7b\x01\x15\x2d\x66\xc3\x64\x67\x8c\xe2\x70\x3c\x16\xbd\x54\x75\xbb\x96\x87\x9e\x82\x1a\x6b\xe4\xd2\x06\x05\xfe\xb7\x8b\xa3\x34\x0e\x78\xfc\x50\xd7\xea\x77\xc8\xcb\x92\x50\xeb\x78\x42\x2e\x18\x6f\x47\x0e\x47\x50\x24\x26\xc6\x07\x8b\xd2\x08\x25\x0d\x28\xcd\xc0\x04\x8b\xeb\xa6\xce\x2d\x9a\x8c\x49\x90\xcd\xff\x2e\xec\x12\x4e\xec\xba\xa9\x0d\xa1\x6b\x9d\xdb\x62\x79\xe3\xe5\x8e\x71\xe3\x84\xf2\x3a\x39\x1d\x6d\x31\xad\x73\xb9\x40\x67\x82\x2c\x78\x5b\x0e\x53\xb4\xff\x10\xdc\x7a\x99\x93\xad\xea\x31\xa8\x3d\x0b\x52\x51\x81\x28\x03\x6b\xec\x70\xea\x20\xa1\xbf\xf8\xb5\xbf\x21\xe5\x34\x19\x90\xc8\xa0\x42\x44\xc9\x0b\x3b\xc5\x14\x96\x8f\x44\xe4\x0f\x59\xf1\x09\x1d\x18\x4c\x1f\xd2\x3d\x29\x3f\x17\x55\xf5\x5c\x4c\x1c\x82\xb7\x38\x85\xbc\x69\x50\x96\xc9\x70\x75\xfc\x7a\x18\x56\x4f\x81\x90\xcf\x77\xe1\x23\x7d\x11\x96\xd5\x21\x28\x07\x0c\xe3\x24\xae\xad\x6e\x0b\xcb\xf1\x50\xd9\xf3\xc1\xe9\xde\xaa\xec\xb3\xa8\x6b\xaa\x22\xe8\x3a\xaa\x5a\x97\x46\xf6\xfc\x6c\x6e\xd1\xe5\xf6\x63\xb9\xc0\x6d\x6a\xc9\xa1\x79\x2a\xad\xb8\x17\xc4\xec\xca\x50\x66\x6b\x94\x09\xeb\xa5\xf0\xa3\x27\xd2\x2d\xd4\xb9\x2c\x4a\x38\x81\x11\x39\x1a\x91\xdb\x11\x3d\x63\x66\x04\x56\xb7\x08\xa3\x7f\xa1\x56\x23\x18\x49\x51\x7b\x8c\x93\x72\x5f\x3a\xbb\x25\x51\x62\x85\x6c\x25\x23\x52\xda\x4c\x4e\x7d\x53\x51\x52\x43\x42\x02\x6d\x53\xe6\x16\x33\xc6\xbd\xab\xb9\x7d\x52\x77\x17\xed\x0e\xbd\x77\xfb\xbc\x38\x06\xf2\x90\x1e\x66\x6e\x97\x92\x59\x23\x76\x8d\x8d\x97\x78\xbe\xc7\xf9\x3a\x6f\xeb\xd5\xff\xa1\xd1\x89\x27\x13\xa0\x8e\xc4\xd3\xbe\x61\x9a\x1a\x72\x37\x91\x93\xb0\x02\x4d\x68\xda\xca\xdc\xe6\xf3\xdc\x60\xf6\xda\x07\xe5\x99\x86\xe7\xf6\xee\xc9\x96\x87\x12\xe4\x29\x6e\x85\x24\x78\x84\x3b\xc7\x8c\x9d\xfd\x47\xc5\xfb\x36\x69\x1a\x47\x3d\x1e\x83\x95\x5d\x77\x2f\xa9\x33\x82\x95\x1e\x5a\xf8\xc5\x2d\xbd\xac\x5b\x29\x0d\x82\xf3\xce\xf5\xf2\x94\x28\xe3\x9d\x32\x99\x08\x10\xd2\x8e\x5d\x53\x7c\x90\x2a\xae\x8a\xc1\xb5\x3f\x65\xee\x56\xdc\x05\xd0\x32\x2b\xff\x3d\x37\x57\x58\xe5\x6d\x6d\x43\x75\x78\xc9\xac\x74\xcb\x26\x49\x0f\x51\x4e\xaf\xf9\xba\xb5\xe0\x0f\x0b\x53\xf7\x85\x9f\x28\x4e\x0e\xf6\xc8\x7d\x8e\x61\x0d\x81\x37\x53\x48\x7e\x75\x2c\xbb\xbd\xd1\x28\x8a\x02\x23\x04\xf2\x5d\x67\xbe\xc1\x08\x7a\xfe\x66\x38\x24\xe2\x93\x1f\x02\xed\xee\x36\x90\xd5\xda\x66\xdc\x75\x56\xc9\xa8\x95\xf8\xd0\x60\x61\xb1\x84\x9e\x70\xa8\xeb\x83\x3f\xdc\x8c\xc6\xb0\x76\xa6\xba\x60\xd0\x37\xc6\x21\x09\xc5\x12\x8b\x55\x72\xd8\xf0\x46\x47\x1a\xd6\xde\x4c\x50\xee\xdd\x4d\x7b\xcf\xbc\xcf\xa0\xbb\x15\x77\x63\x60\x10\xdf\x8a\x3b\x18\x78\xdc\x69\xd5\x7d\xae\xc9\x3b\x27\x2a\x84\x29\xe0\xaf\x0c\xb0\x00\xc0\xf4\xec\x6d\x88\xeb\x2b\x87\x13\x7c\x2a\xba\xf2\x3f\xbe\xbd\x73\x19\xc4\x84\xd0\x73\xd8\xde\x6f\xd1\x41\xa2\x21\x58\x9f\x1a\xd7\xf3\x7a\xeb\x93\x09\xcc\xe4\xbd\x5a\x71\x07\x0d\x79\x61\xdb\xbc\x06\xd5\xa0\x76\x27\x55\x8e\x03\xb8\x2b\xb1\xdb\x7c\x7b\x6a\x28\x96\xb9\x90\x99\x33\xe4\x73\x3d\x98\x41\x7e\xa2\x5e\xc5\x15\xef\xf3\x43\xc8\x9b\x63\x2a\xfc\x88\x32\xf3\x5f\xb8\xb4\x76\x47\x6f\xed\xbf\x18\x55\xa2\xfd\x71\x65\x7b\xd3\xfe\xbf\x6e\x07\xbc\x59\xa9\x24\xf5\x1e\xf4\xfe\x0c\x61\xf5\x5a\xf8\x7c\xef\xd4\x13\xfd\xcf\x07\x9f\x50\xff\xfd\xec\x13\xbd\x34\x7c\x44\xdb\xd7\xfe\x56\xdc\xed\x0c\x41\x07\x64\xd2\x8f\x42\xa1\x1a\x8e\x4e\x43\x83\xba\x79\x6e\x26\x7a\x4d\x64\xdd\xd1\x28\xf6\x7e\x86\xfb\xe9\x6b\x95\xa6\xa4\xbe\x73\xea\xc9\x9b\x8a\x30\x94\xee\x52\xa9\x95\x49\xe1\x0c\xde\xbe\x07\x01\x3f\x4e\xe1\xfc\x3d\x88\xb3\xb3\x2d\xb7\x0d\xca\x9c\x65\x6f\xc5\x1d\x55\x70\x1a\xc6\xb5\x68\x5b\xb2\x77\xae\x80\xa9\x4f\x48\xc4\x18\x0a\xfb\x90\xf2\x48\x2c\xaa\xdd\xba\xef\x5b\x22\x1a\x38\xc7\x81\xbe\x7a\x3b\xe7\x7d\xe1\x1f\xad\xa8\xbe\xee\xcf\x07\x55\x7f\x58\x36\x87\x58\xed\x38\x98\x61\x8e\xfa\x31\xd2\x37\x0c\xbf\xb9\xbf\x03\xad\x90\x7f\x8d\x61\xde\x5a\x68\x72\x29\x0a\xe3\xc0\xed\xf8\x0c\x54\x51\xb4\xda\xfc\x47\xbd\xc2\x6f\xc7\x9b\x85\xbd\xc7\x9b\x87\xce\x3e\x21\xfb\x07\x0f\x3d\xc7\xf6\xaf\x21\x83\xf3\x72\x98\x4c\x02\xc3\x53\xde\xc7\xdd\x6e\x37\xf6\x9d\xc3\xd6\x0b\xb3\xd6\xd3\xa3\xd6\x00\xa8\xdb\xcf\x7f\x07\x00\x00\xff\xff\x01\x51\x07\x87\xc5\x13\x00\x00") func templateDialectSqlCreateTmplBytes() ([]byte, error) { return bindataRead( @@ -645,7 +645,7 @@ func templateDialectSqlCreateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/dialect/sql/create.tmpl", size: 4673, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/dialect/sql/create.tmpl", size: 5061, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template.go b/entc/gen/template.go index aa311b435..31cb2b14c 100644 --- a/entc/gen/template.go +++ b/entc/gen/template.go @@ -167,6 +167,7 @@ var ( partialPatterns = [...]string{ "dialect/additional/*", "dialect/*/import/additional/*", + "dialect/*/*/spec/*", } // templates holds the Go templates for the code generation. templates *Template diff --git a/entc/gen/template/dialect/sql/create.tmpl b/entc/gen/template/dialect/sql/create.tmpl index 4e4326a1d..811a7e2e2 100644 --- a/entc/gen/template/dialect/sql/create.tmpl +++ b/entc/gen/template/dialect/sql/create.tmpl @@ -43,6 +43,12 @@ func ({{ $receiver }} *{{ $builder }}) createSpec() (*{{ $.Name }}, *sqlgraph.Cr }, } ) + {{- /* Allow mutating the sqlgraph.CreateSpec by ent extensions or user templates.*/}} + {{- with $tmpls := matchTemplate "dialect/sql/create/spec/*" }} + {{- range $tmpl := $tmpls }} + {{- xtemplate $tmpl $ }} + {{- end }} + {{- end }} {{- if $.ID.UserDefined }} if id, ok := {{ $mutation }}.{{ $.ID.MutationGet }}(); ok { _node.ID = id