Sasha
90bca15f52
fix(drizzle): enforce uniqueness on index names ( #8754 )
...
Fixes https://github.com/payloadcms/payload/issues/8752
Previously, trying to define a config like this:
```ts
{
type: 'text',
name: 'someText',
index: true,
},
{
type: 'array',
name: 'some',
index: true,
fields: [
{
type: 'text',
name: 'text',
index: true,
},
],
}
```
Lead to the error:
```
Warning We've found duplicated index name across public schema. Please rename your index in either the demonstration table or the table with the duplicated index name
```
Now, if we encounter duplicates, we increment the name like this:
`collection_some_text_idx`
`collection_some_text_1_idx`
---------
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com >
2024-10-17 02:05:27 +00:00
..
2024-10-11 18:54:39 +00:00
2024-10-07 14:20:07 -04:00
2024-09-20 22:46:40 -04:00
2024-10-04 13:02:56 -06:00
2024-10-03 23:37:08 -04:00
2024-09-20 22:46:40 -04:00
2024-09-25 09:23:54 -04:00
2024-09-20 22:46:40 -04:00
2024-10-11 13:14:18 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-14 19:05:13 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-17 02:05:27 +00:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 12:09:42 -04:00
2024-09-24 13:29:53 -04:00
2024-09-20 22:46:40 -04:00
2024-05-12 21:28:19 -04:00
2024-10-14 19:39:30 -04:00
2024-10-03 23:37:08 -04:00
2024-08-13 12:54:33 -04:00
2024-10-04 11:48:54 -04:00
2024-09-20 22:46:40 -04:00
2024-10-16 14:46:39 -04:00
2024-08-13 12:54:33 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-09 14:26:58 -04:00
2024-09-25 11:05:18 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-08 11:40:34 -04:00
2024-07-23 13:44:44 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-08 14:45:51 -04:00
2024-10-11 10:01:21 -04:00
2024-07-11 15:59:38 -04:00
2024-05-25 15:45:05 +00:00
2024-09-04 11:53:43 -04:00
2023-09-01 14:45:41 -04:00
2024-03-07 11:33:46 -05:00
2024-10-14 20:02:26 +00:00
2024-09-20 22:46:40 -04:00
2024-09-16 17:02:08 +00:00
2024-08-13 12:54:33 -04:00
2024-08-13 12:54:33 -04:00
2024-09-16 17:02:08 +00:00
2024-10-07 14:20:07 -04:00
2024-09-16 17:02:08 +00:00
2024-10-11 18:54:39 +00:00
2024-10-11 18:54:39 +00:00
2024-10-11 18:54:39 +00:00
2024-10-11 18:54:39 +00:00
2024-03-19 11:31:50 -04:00
2024-08-19 17:31:36 -04:00
2024-10-16 16:32:54 -04:00
2024-05-01 17:35:41 -04:00
2024-08-13 12:54:33 -04:00
2024-08-19 17:31:36 -04:00
2024-08-14 08:57:04 -04:00
2024-08-14 08:57:04 -04:00
2024-10-14 20:02:26 +00:00
2024-09-20 11:10:16 -04:00
2024-04-06 15:06:04 -04:00
2024-06-17 14:25:36 -04:00
2024-08-19 17:31:36 -04:00
2024-03-14 23:53:47 -04:00
2024-08-29 21:25:50 -04:00
2024-05-13 01:37:52 +00:00