We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
database backend does not store children
The [`Task`](https://github.com/celery/celery/blob/main/celery/backends/database/models.py#L20-L27) and [`TaskExtended`](https://github.com/celery/celery/blob/main/celery/backends/database/models.py#L57-L62) models for the `database` backend do not include `children`. This means that when using any `database` backend, [`AsyncResult.children`](https://github.com/celery/celery/blob/main/celery/result.py#L424) is always empty, even if a task does have children.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `celery/backends/database/models.py`
Content:
```
1 """Database models used by the SQLAlchemy result store backend."""
2 from datetime import datetime
3 
4 import sqlalchemy as sa
5 from sqlalchemy.types import PickleType
6 
7 from celery import states
8 
9 from .session import ResultModelBase
10 
11 __all__ = ('Task', 'TaskExtended', 'TaskSet')
12 
13 
14 class Task(ResultModelBase):
15     """Task result/status."""
16 
17     __tablename__ = 'celery_taskmeta'
18     __table_args__ = {'sqlite_autoincrement': True}
19 
20     id = sa.Column(sa.Integer, sa.Sequence('task_id_sequence'),
21                    primary_key=True, autoincrement=True)
22     task_id = sa.Column(sa.String(155), unique=True)
23     status = sa.Column(sa.String(50), default=states.PENDING)
24     result = sa.Column(PickleType, nullable=True)
25     date_done = sa.Column(sa.DateTime, default=datetime.utcnow,
26                           onupdate=datetime.utcnow, nullable=True)
27     traceback = sa.Column(sa.Text, nullable=True)
28 
29     def __init__(self, task_id):
30         self.task_id = task_id
31 
32     def to_dict(self):
33         return {
34             'task_id': self.task_id,
35             'status': self.status,
36             'result': self.result,
37             'traceback': self.traceback,
38             'date_done': self.date_done,
39         }
40 
41     def __repr__(self):
42         return '<Task {0.task_id} state: {0.status}>'.format(self)
43 
44     @classmethod
45     def configure(cls, schema=None, name=None):
46         cls.__table__.schema = schema
47         cls.id.default.schema = schema
48         cls.__table__.name = name or cls.__tablename__
49 
50 
51 class TaskExtended(Task):
52     """For the extend result."""
53 
54     __tablename__ = 'celery_taskmeta'
55     __table_args__ = {'sqlite_autoincrement': True, 'extend_existing': True}
56 
57     name = sa.Column(sa.String(155), nullable=True)
58     args = sa.Column(sa.LargeBinary, nullable=True)
59     kwargs = sa.Column(sa.LargeBinary, nullable=True)
60     worker = sa.Column(sa.String(155), nullable=True)
61     retries = sa.Column(sa.Integer, nullable=True)
62     queue = sa.Column(sa.String(155), nullable=True)
63 
64     def to_dict(self):
65         task_dict = super().to_dict()
66         task_dict.update({
67             'name': self.name,
68             'args': self.args,
69             'kwargs': self.kwargs,
70             'worker': self.worker,
71             'retries': self.retries,
72             'queue': self.queue,
73         })
74         return task_dict
75 
76 
77 class TaskSet(ResultModelBase):
78     """TaskSet result."""
79 
80     __tablename__ = 'celery_tasksetmeta'
81     __table_args__ = {'sqlite_autoincrement': True}
82 
83     id = sa.Column(sa.Integer, sa.Sequence('taskset_id_sequence'),
84                    autoincrement=True, primary_key=True)
85     taskset_id = sa.Column(sa.String(155), unique=True)
86     result = sa.Column(PickleType, nullable=True)
87     date_done = sa.Column(sa.DateTime, default=datetime.utcnow,
88                           nullable=True)
89 
90     def __init__(self, taskset_id, result):
91         self.taskset_id = taskset_id
92         self.result = result
93 
94     def to_dict(self):
95         return {
96             'taskset_id': self.taskset_id,
97             'result': self.result,
98             'date_done': self.date_done,
99         }
100 
101     def __repr__(self):
102         return f'<TaskSet: {self.taskset_id}>'
103 
104     @classmethod
105     def configure(cls, schema=None, name=None):
106         cls.__table__.schema = schema
107         cls.id.default.schema = schema
108         cls.__table__.name = name or cls.__tablename__
109
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/celery/backends/database/models.py b/celery/backends/database/models.py
--- a/celery/backends/database/models.py
+++ b/celery/backends/database/models.py
@@ -25,6 +25,7 @@
     date_done = sa.Column(sa.DateTime, default=datetime.utcnow,
                           onupdate=datetime.utcnow, nullable=True)
     traceback = sa.Column(sa.Text, nullable=True)
+    children = sa.Column(PickleType, nullable=True)
 
     def __init__(self, task_id):
         self.task_id = task_id
@@ -36,6 +37,7 @@
             'result': self.result,
             'traceback': self.traceback,
             'date_done': self.date_done,
+            'children': self.children,
         }
 
     def __repr__(self):

{"golden_diff": "diff --git a/celery/backends/database/models.py b/celery/backends/database/models.py\n--- a/celery/backends/database/models.py\n+++ b/celery/backends/database/models.py\n@@ -25,6 +25,7 @@\n     date_done = sa.Column(sa.DateTime, default=datetime.utcnow,\n                           onupdate=datetime.utcnow, nullable=True)\n     traceback = sa.Column(sa.Text, nullable=True)\n+    children = sa.Column(PickleType, nullable=True)\n \n     def __init__(self, task_id):\n         self.task_id = task_id\n@@ -36,6 +37,7 @@\n             'result': self.result,\n             'traceback': self.traceback,\n             'date_done': self.date_done,\n+            'children': self.children,\n         }\n \n     def __repr__(self):\n", "issue": "database backend does not store children\nThe [`Task`](https://github.com/celery/celery/blob/main/celery/backends/database/models.py#L20-L27) and [`TaskExtended`](https://github.com/celery/celery/blob/main/celery/backends/database/models.py#L57-L62) models for the `database` backend do not include `children`. This means that when using any `database` backend, [`AsyncResult.children`](https://github.com/celery/celery/blob/main/celery/result.py#L424) is always empty, even if a task does have children.\n", "before_files": [{"content": "\"\"\"Database models used by the SQLAlchemy result store backend.\"\"\"\nfrom datetime import datetime\n\nimport sqlalchemy as sa\nfrom sqlalchemy.types import PickleType\n\nfrom celery import states\n\nfrom .session import ResultModelBase\n\n__all__ = ('Task', 'TaskExtended', 'TaskSet')\n\n\nclass Task(ResultModelBase):\n    \"\"\"Task result/status.\"\"\"\n\n    __tablename__ = 'celery_taskmeta'\n    __table_args__ = {'sqlite_autoincrement': True}\n\n    id = sa.Column(sa.Integer, sa.Sequence('task_id_sequence'),\n                   primary_key=True, autoincrement=True)\n    task_id = sa.Column(sa.String(155), unique=True)\n    status = sa.Column(sa.String(50), default=states.PENDING)\n    result = sa.Column(PickleType, nullable=True)\n    date_done = sa.Column(sa.DateTime, default=datetime.utcnow,\n                          onupdate=datetime.utcnow, nullable=True)\n    traceback = sa.Column(sa.Text, nullable=True)\n\n    def __init__(self, task_id):\n        self.task_id = task_id\n\n    def to_dict(self):\n        return {\n            'task_id': self.task_id,\n            'status': self.status,\n            'result': self.result,\n            'traceback': self.traceback,\n            'date_done': self.date_done,\n        }\n\n    def __repr__(self):\n        return '<Task {0.task_id} state: {0.status}>'.format(self)\n\n    @classmethod\n    def configure(cls, schema=None, name=None):\n        cls.__table__.schema = schema\n        cls.id.default.schema = schema\n        cls.__table__.name = name or cls.__tablename__\n\n\nclass TaskExtended(Task):\n    \"\"\"For the extend result.\"\"\"\n\n    __tablename__ = 'celery_taskmeta'\n    __table_args__ = {'sqlite_autoincrement': True, 'extend_existing': True}\n\n    name = sa.Column(sa.String(155), nullable=True)\n    args = sa.Column(sa.LargeBinary, nullable=True)\n    kwargs = sa.Column(sa.LargeBinary, nullable=True)\n    worker = sa.Column(sa.String(155), nullable=True)\n    retries = sa.Column(sa.Integer, nullable=True)\n    queue = sa.Column(sa.String(155), nullable=True)\n\n    def to_dict(self):\n        task_dict = super().to_dict()\n        task_dict.update({\n            'name': self.name,\n            'args': self.args,\n            'kwargs': self.kwargs,\n            'worker': self.worker,\n            'retries': self.retries,\n            'queue': self.queue,\n        })\n        return task_dict\n\n\nclass TaskSet(ResultModelBase):\n    \"\"\"TaskSet result.\"\"\"\n\n    __tablename__ = 'celery_tasksetmeta'\n    __table_args__ = {'sqlite_autoincrement': True}\n\n    id = sa.Column(sa.Integer, sa.Sequence('taskset_id_sequence'),\n                   autoincrement=True, primary_key=True)\n    taskset_id = sa.Column(sa.String(155), unique=True)\n    result = sa.Column(PickleType, nullable=True)\n    date_done = sa.Column(sa.DateTime, default=datetime.utcnow,\n                          nullable=True)\n\n    def __init__(self, taskset_id, result):\n        self.taskset_id = taskset_id\n        self.result = result\n\n    def to_dict(self):\n        return {\n            'taskset_id': self.taskset_id,\n            'result': self.result,\n            'date_done': self.date_done,\n        }\n\n    def __repr__(self):\n        return f'<TaskSet: {self.taskset_id}>'\n\n    @classmethod\n    def configure(cls, schema=None, name=None):\n        cls.__table__.schema = schema\n        cls.id.default.schema = schema\n        cls.__table__.name = name or cls.__tablename__\n", "path": "celery/backends/database/models.py"}], "after_files": [{"content": "\"\"\"Database models used by the SQLAlchemy result store backend.\"\"\"\nfrom datetime import datetime\n\nimport sqlalchemy as sa\nfrom sqlalchemy.types import PickleType\n\nfrom celery import states\n\nfrom .session import ResultModelBase\n\n__all__ = ('Task', 'TaskExtended', 'TaskSet')\n\n\nclass Task(ResultModelBase):\n    \"\"\"Task result/status.\"\"\"\n\n    __tablename__ = 'celery_taskmeta'\n    __table_args__ = {'sqlite_autoincrement': True}\n\n    id = sa.Column(sa.Integer, sa.Sequence('task_id_sequence'),\n                   primary_key=True, autoincrement=True)\n    task_id = sa.Column(sa.String(155), unique=True)\n    status = sa.Column(sa.String(50), default=states.PENDING)\n    result = sa.Column(PickleType, nullable=True)\n    date_done = sa.Column(sa.DateTime, default=datetime.utcnow,\n                          onupdate=datetime.utcnow, nullable=True)\n    traceback = sa.Column(sa.Text, nullable=True)\n    children = sa.Column(PickleType, nullable=True)\n\n    def __init__(self, task_id):\n        self.task_id = task_id\n\n    def to_dict(self):\n        return {\n            'task_id': self.task_id,\n            'status': self.status,\n            'result': self.result,\n            'traceback': self.traceback,\n            'date_done': self.date_done,\n            'children': self.children,\n        }\n\n    def __repr__(self):\n        return '<Task {0.task_id} state: {0.status}>'.format(self)\n\n    @classmethod\n    def configure(cls, schema=None, name=None):\n        cls.__table__.schema = schema\n        cls.id.default.schema = schema\n        cls.__table__.name = name or cls.__tablename__\n\n\nclass TaskExtended(Task):\n    \"\"\"For the extend result.\"\"\"\n\n    __tablename__ = 'celery_taskmeta'\n    __table_args__ = {'sqlite_autoincrement': True, 'extend_existing': True}\n\n    name = sa.Column(sa.String(155), nullable=True)\n    args = sa.Column(sa.LargeBinary, nullable=True)\n    kwargs = sa.Column(sa.LargeBinary, nullable=True)\n    worker = sa.Column(sa.String(155), nullable=True)\n    retries = sa.Column(sa.Integer, nullable=True)\n    queue = sa.Column(sa.String(155), nullable=True)\n\n    def to_dict(self):\n        task_dict = super().to_dict()\n        task_dict.update({\n            'name': self.name,\n            'args': self.args,\n            'kwargs': self.kwargs,\n            'worker': self.worker,\n            'retries': self.retries,\n            'queue': self.queue,\n        })\n        return task_dict\n\n\nclass TaskSet(ResultModelBase):\n    \"\"\"TaskSet result.\"\"\"\n\n    __tablename__ = 'celery_tasksetmeta'\n    __table_args__ = {'sqlite_autoincrement': True}\n\n    id = sa.Column(sa.Integer, sa.Sequence('taskset_id_sequence'),\n                   autoincrement=True, primary_key=True)\n    taskset_id = sa.Column(sa.String(155), unique=True)\n    result = sa.Column(PickleType, nullable=True)\n    date_done = sa.Column(sa.DateTime, default=datetime.utcnow,\n                          nullable=True)\n\n    def __init__(self, taskset_id, result):\n        self.taskset_id = taskset_id\n        self.result = result\n\n    def to_dict(self):\n        return {\n            'taskset_id': self.taskset_id,\n            'result': self.result,\n            'date_done': self.date_done,\n        }\n\n    def __repr__(self):\n        return f'<TaskSet: {self.taskset_id}>'\n\n    @classmethod\n    def configure(cls, schema=None, name=None):\n        cls.__table__.schema = schema\n        cls.id.default.schema = schema\n        cls.__table__.name = name or cls.__tablename__\n", "path": "celery/backends/database/models.py"}]}