Sasha
0128eedf70
fix(drizzle)!: make radio and select column names to snake_case (#8439)
Fixes https://github.com/payloadcms/payload/issues/8402 and
https://github.com/payloadcms/payload/issues/8027
Before DB column names were camelCase:

After this change, they are snake_case:

#### Breaking SQLite / Postgres ⚠️
If you had any select (not `hasMany: true`) or radio fields with the
name in camelCase, for example:
```ts
{
name: 'selectReadOnly',
type: 'select',
admin: {
readOnly: true,
},
options: [
{
label: 'Value One',
value: 'one',
},
{
label: 'Value Two',
value: 'two',
},
],
},
```
This previously was mapped to the db column name `"selectReadOnly"`. Now
it's `select_read_only`.
Generate a new migration to rename your columns.
```sh
pnpm payload migrate:create
```
Then select "rename column" for targeted columns and Drizzle will handle
the migration.
---------
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2024-10-04 16:25:05 +00:00
..
2024-08-16 18:51:39 -04:00
2024-09-20 11:10:16 -04:00
2024-10-04 16:25:05 +00:00
2024-09-24 16:39:00 -04:00
2024-09-07 02:48:59 +00:00
2024-10-04 11:48:54 -04:00
2024-09-20 11:16:14 -04:00
2024-09-25 15:14:03 -04:00
2024-09-20 11:10:16 -04:00
2024-07-30 13:41:18 -04:00
2024-07-30 13:41:18 -04:00
2024-09-16 16:15:29 -04:00
2024-09-03 11:19:19 -04:00
2024-09-16 16:15:29 -04:00
2024-07-30 13:41:18 -04:00
2024-09-20 11:10:16 -04:00
2024-09-16 16:15:29 -04:00
2024-09-03 11:19:19 -04:00
2024-09-20 11:10:16 -04:00
2024-07-24 12:43:29 -04:00
2024-09-16 16:15:29 -04:00
2024-09-03 11:19:19 -04:00
2024-09-20 11:10:16 -04:00
2024-09-16 16:15:29 -04:00
2024-09-25 15:14:03 -04:00
2024-08-30 16:37:39 +00:00
2024-08-29 02:35:17 +00:00
2024-08-30 16:37:39 +00:00
2024-08-30 16:37:39 +00:00
2024-09-03 11:19:19 -04:00
2024-08-29 02:35:17 +00:00
2024-09-16 16:15:29 -04:00
2024-09-03 11:19:19 -04:00
2024-09-20 11:10:16 -04:00
2024-07-30 13:41:18 -04:00
2024-09-20 11:10:16 -04:00
2024-09-20 11:10:16 -04:00