summaryrefslogtreecommitdiffstats
path: root/models/fixtures
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-09-08 23:19:30 +0800
committerGitHub <noreply@github.com>2021-09-08 17:19:30 +0200
commitddc709ff7f94bd627ac05209a16ea5a5e24b7413 (patch)
tree1420d827e00769c1a8330c6b1a80e7cbbc343332 /models/fixtures
parentf55cd033ed8dbee04e90faede5cca2dcf697e102 (diff)
downloadgitea-ddc709ff7f94bd627ac05209a16ea5a5e24b7413.tar.gz
gitea-ddc709ff7f94bd627ac05209a16ea5a5e24b7413.zip
Add repo_id for attachment (#16958)
When create a new issue or comment and paste/upload an attachment/image, it will not assign an issue id before submit. So if user give up the creating, the attachments will lost key feature and become dirty content. We don't know if we need to delete the attachment even if the repository deleted. This PR add a repo_id in attachment table so that even if a new upload attachment with no issue_id or release_id but should have repo_id. When deleting a repository, they could also be deleted. Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'models/fixtures')
-rw-r--r--models/fixtures/attachment.yml11
1 files changed, 11 insertions, 0 deletions
diff --git a/models/fixtures/attachment.yml b/models/fixtures/attachment.yml
index 2606d52b47..8612f6ece7 100644
--- a/models/fixtures/attachment.yml
+++ b/models/fixtures/attachment.yml
@@ -1,6 +1,7 @@
-
id: 1
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
+ repo_id: 1
issue_id: 1
comment_id: 0
name: attach1
@@ -10,6 +11,7 @@
-
id: 2
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12
+ repo_id: 2
issue_id: 4
comment_id: 0
name: attach2
@@ -19,6 +21,7 @@
-
id: 3
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13
+ repo_id: 1
issue_id: 2
comment_id: 1
name: attach1
@@ -28,6 +31,7 @@
-
id: 4
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14
+ repo_id: 1
issue_id: 3
comment_id: 1
name: attach2
@@ -37,6 +41,7 @@
-
id: 5
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a15
+ repo_id: 2
issue_id: 4
comment_id: 0
name: attach1
@@ -46,6 +51,7 @@
-
id: 6
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a16
+ repo_id: 1
issue_id: 5
comment_id: 2
name: attach1
@@ -55,6 +61,7 @@
-
id: 7
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17
+ repo_id: 1
issue_id: 5
comment_id: 2
name: attach1
@@ -64,6 +71,7 @@
-
id: 8
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a18
+ repo_id: 3
issue_id: 6
comment_id: 0
name: attach1
@@ -73,6 +81,7 @@
-
id: 9
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a19
+ repo_id: 1
release_id: 1
name: attach1
download_count: 0
@@ -81,6 +90,7 @@
-
id: 10
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a20
+ repo_id: 0 # TestGetAttachment/NotLinked
uploader_id: 8
name: attach1
download_count: 0
@@ -89,6 +99,7 @@
-
id: 11
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a21
+ repo_id: 40
release_id: 2
name: attach1
download_count: 0