### Apache Airflow version

2.6.2

### What happened

airflow doesn't work correct UPDATE: with Pydantic 2 released on 30th of June UPDATE:, raises 
`pydantic.errors.PydanticUserError: A non-annotated attribute was detected: `dag_id = <class 'str'>`. All model fields require a type annotation; if `dag_id` is not meant to be a field, you may be able to resolve this error by annotating it as a `ClassVar` or updating `model_config['ignored_types']`.`

### What you think should happen instead

_No response_

### How to reproduce

just install apache-airflow and run `airflow db init`

### Operating System

Ubuntu 22.04.2 LTS

### Versions of Apache Airflow Providers

_No response_

### Deployment

Official Apache Airflow Helm Chart

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

#
#
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel as BaseModelPydantic
class DagScheduleDatasetReferencePydantic(BaseModelPydantic):
    """Serializable version of the DagScheduleDatasetReference ORM SqlAlchemyModel used by internal API."""
    dataset_id: int
    dag_id: str
    created_at: datetime
    updated_at: datetime
    class Config:
        """Make sure it deals automatically with SQLAlchemy ORM classes."""
        orm_mode = True
class TaskOutletDatasetReferencePydantic(BaseModelPydantic):
    """Serializable version of the TaskOutletDatasetReference ORM SqlAlchemyModel used by internal API."""
    dataset_id: int
    dag_id = str
    task_id = str
    created_at = datetime
    updated_at = datetime
    class Config: