aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrate.go
Commit message (Collapse)AuthorAgeFilesLines
* DBContext is just a Context (#17100)zeripath2021-09-231-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * DBContext is just a Context This PR removes some of the specialness from the DBContext and makes it context This allows us to simplify the GetEngine code to wrap around any context in future and means that we can change our loadRepo(e Engine) functions to simply take contexts. Signed-off-by: Andrew Thornton <art27@cantab.net> * fix unit tests Signed-off-by: Andrew Thornton <art27@cantab.net> * another place that needs to set the initial context Signed-off-by: Andrew Thornton <art27@cantab.net> * avoid race Signed-off-by: Andrew Thornton <art27@cantab.net> * change attachment error Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move db related basic functions to models/db (#17075)Lunny Xiao2021-09-191-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * Move db related basic functions to models/db * Fix lint * Fix lint * Fix test * Fix lint * Fix lint * revert unnecessary change * Fix test * Fix wrong replace string * Use *Context * Correct committer spelling and fix wrong replaced words Co-authored-by: zeripath <art27@cantab.net>
* Fix delete nonexist oauth application 500 and prevent deadlock (#15384)Lunny Xiao2021-04-101-0/+2
| | | | | | | | | | | | | | | | | | * Fix delete nonexist oauth application 500 * Fix test * Close the session Signed-off-by: Andrew Thornton <art27@cantab.net> * Update integrations/api_oauth2_apps_test.go * Fix more missed sess.Close * Remove unnecessary blank line Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* chore(models): rewrite code format. (#14754)Bo-Yi Wu2021-03-141-3/+3
| | | | | | | | | | | | | | | * chore: rewrite format. * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: Adjacent parameters with the same type should be grouped together * chore: update format.
* [BugFix] remove nil inserts in models (#11096)65432020-04-171-11/+20
| | | | | | | | | | | | | | | | | | | * Fix InsertReleases Nil Insert on Attachments * FIX "No element on slice when insert" & smal refactor * again * impruve * rm useles newline * Apply suggestions from code review Co-Authored-By: zeripath <art27@cantab.net> * process insert as a whole Co-authored-by: zeripath <art27@cantab.net>
* Fix migration information update bug when linked github account (#10310)Lunny Xiao2020-02-171-10/+14
| | | | | | | | * Fix bug on upgrade migrated reactions * Fix migration information update bug when linked github account Co-authored-by: zeripath <art27@cantab.net>
* Migrate reviews when migrating repository from github (#9463)Lunny Xiao2020-01-231-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix typo * Migrate reviews when migrating repository from github * fix lint * Added test and migration when external user login * fix test * fix commented state * Some improvements * fix bug when get pull request and ref original author on code comments * Fix migrated line; Added comment for review * Don't load all pull requests attributes * Fix typo * wrong change copy head * fix tests * fix reactions * Fix test * fix fmt * fix review comment reactions
* Migrate reactions when migrating repository from github (#9599)Lunny Xiao2020-01-151-2/+20
| | | | | | | | | | | | | | | | | | | | * Migrate reactions when migrating repository from github * fix missed sleep * fix tests * update reactions when external user binding * Fix test * fix tests * change the copy head * fix test * fix migrator add/delete reaction
* Upgrade xorm to v0.8.0 (#8536)Lunny Xiao2019-10-171-1/+1
|
* Fix milestone completness calculation when migrating (#7725)Lauris BH2019-08-031-4/+16
|
* Use batch insert on migrating repository to make the process faster (#7050)Lunny Xiao2019-06-291-51/+80
| | | | | | | | | | * Use batch insert on migrating repository to make the process faster * fix lint * fix tests * fix comments
* Improve migrations to support migrating ↵Lunny Xiao2019-05-071-0/+145
milestones/labels/issues/comments/pullrequests (#6290) * add migrations * fix package dependency * fix lints * implements migrations except pull requests * add releases * migrating releases * fix bug * fix lint * fix migrate releases * fix tests * add rollback * pull request migtations * fix import * fix go module vendor * add tests for upload to gitea * more migrate options * fix swagger-check * fix misspell * add options on migration UI * fix log error * improve UI options on migrating * add support for username password when migrating from github * fix tests * remove comments and fix migrate limitation * improve error handles * migrate API will also support migrate milestones/labels/issues/pulls/releases * fix tests and remove unused codes * add DownloaderFactory and docs about how to create a new Downloader * fix misspell * fix migration docs * Add hints about migrate options on migration page * fix tests