summaryrefslogtreecommitdiff
path: root/app/models/upload.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@masterogolowinski-master-patch-80898GitLab Bot2019-12-161-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-131-4/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-061-0/+15
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-161-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-091-5/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-031-9/+36
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-131-0/+2
|
* Externalize strings in app/modelsMartin Wortschack2019-04-121-3/+3
| | | | - Update PO file
* Inherit from ApplicationRecord instead of ActiveRecord::BaseNick Thomas2019-03-281-1/+1
|
* Use FastDestroy for deleting uploadsJan Provaznik2018-12-061-0/+19
| | | | | | | | | | It gathers list of file paths to delete before destroying the parent object. Then after the parent_object is destroyed these paths are scheduled for deletion asynchronously. Carrierwave needed associated model for deleting upload file. To avoid this requirement, simple Fog/File layer is used directly for file deletion, this allows us to use just a simple list of paths.
* Backport changes from EEToon Claes2018-11-071-1/+13
| | | | | | | Now the files are identical again compared to EE. These are backported from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5050
* Enhance performance of counting local UploadsToon Claes2018-11-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an index to the `store` column on `uploads`. This makes counting local uploads faster. Also, there is no longer need to check for objects with `store = NULL`. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18557 --- ### Query plans Query: ```sql SELECT COUNT(*) FROM "uploads" WHERE ("uploads"."store" = ? OR "uploads"."store" IS NULL) ``` #### Without index ``` gitlabhq_production=# EXPLAIN ANALYZE SELECT uploads.* FROM uploads WHERE (uploads.store = 1 OR uploads.store IS NULL); QUERY PLAN --------------------------------------------------------------------------------------------------------------- Seq Scan on uploads (cost=0.00..601729.54 rows=578 width=272) (actual time=6.170..2308.256 rows=545 loops=1) Filter: ((store = 1) OR (store IS NULL)) Rows Removed by Filter: 4411957 Planning time: 38.652 ms Execution time: 2308.454 ms (5 rows) ``` #### Add index ``` gitlabhq_production=# create index uploads_tmp1 on uploads (store); CREATE INDEX ``` #### With index ``` gitlabhq_production=# EXPLAIN ANALYZE SELECT uploads.* FROM uploads WHERE (uploads.store = 1 OR uploads.store IS NULL); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on uploads (cost=11.46..1238.88 rows=574 width=272) (actual time=0.155..0.577 rows=545 loops=1) Recheck Cond: ((store = 1) OR (store IS NULL)) Heap Blocks: exact=217 -> BitmapOr (cost=11.46..11.46 rows=574 width=0) (actual time=0.116..0.116 rows=0 loops=1) -> Bitmap Index Scan on uploads_tmp1 (cost=0.00..8.74 rows=574 width=0) (actual time=0.095..0.095 rows=545 loops=1) Index Cond: (store = 1) -> Bitmap Index Scan on uploads_tmp1 (cost=0.00..2.44 rows=1 width=0) (actual time=0.020..0.020 rows=0 loops=1) Index Cond: (store IS NULL) Planning time: 0.274 ms Execution time: 0.637 ms (10 rows) ``` Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/6070
* Enable frozen string in app/models/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-modelsgfyoung2018-07-261-0/+2
| | | | Partially addresses #47424.
* remove EE-only codeMicaël Bergeron2018-03-221-2/+0
|
* Backport ee-40781-os-to-ceMicaël Bergeron2018-03-221-0/+2
|
* port the object storage to CEMicaël Bergeron2018-03-011-8/+10
|
* Merge commit '7e424eb852716495073881710e8a8851b4a4cd5a' into ↵Kamil Trzciński2018-02-281-3/+22
|\ | | | | | | object-storage-ee-to-ce-backport
| * improvements from feedback14256-upload-destroy-removes-fileMicaël Bergeron2018-02-061-1/+1
| |
| * remove file after `Upload#destroy`Micaël Bergeron2018-02-061-0/+8
| | | | | | | | | | it will also automatically prune empty directories for `FileUploader`-based uploaders.
| * apply fixes from feedback42547-upload-store-mount-pointMicaël Bergeron2018-02-021-2/+1
| |
| * add the uploader context to the upload modelMicaël Bergeron2018-02-021-3/+15
| |
| * fix specsMicaël Bergeron2018-02-011-1/+1
| |
| * port of 594e6a0a625^..f74c90f68c6Micaël Bergeron2018-02-011-20/+29
| |
* | Merge branch '4163-move-uploads-to-object-storage' into 'master'Sean McGivern2018-02-281-19/+31
|/ | | | | | | | Move uploads to object storage Closes #4163 See merge request gitlab-org/gitlab-ee!3867
* Added Cop to blacklist polymorphic associationsYorick Peterse2017-06-071-1/+1
| | | | | | | | One should really use a separate table instead of using polymorphic associations. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11168 for more information.
* Add Upload model and UploadChecksumWorker workerRobert Speicher2017-03-061-0/+63