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-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-10-04 16:25:05 +00:00
2024-09-30 13:19:32 -04:00
2024-10-04 16:25:05 +00:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-09-20 22:46:40 -04:00
2024-09-13 17:48:53 +00:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-10-01 13:16:11 -04:00
2024-09-30 13:19:32 -04:00
2024-10-02 14:17:15 -04:00
2024-10-04 01:07:47 +00:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-10-01 13:16:11 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-10-01 13:16:11 -04:00
2024-10-01 13:16:11 -04:00
2024-10-04 00:04:20 +00:00
2024-09-30 13:19:32 -04:00
2024-10-01 13:16:11 -04:00
2024-10-01 13:16:11 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-09-30 13:19:32 -04:00
2024-10-04 01:07:47 +00:00