// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package migrations
import (
"fmt"
"code.gitea.io/gitea/modules/setting"
"xorm.io/xorm"
)
func fixLanguageStatsToSaveSize(x *xorm.Engine) error {
// LanguageStat see models/repo_language_stats.go
type LanguageStat struct {
Size int64 `xorm:"NOT NULL DEFAULT 0"`
}
// RepoIndexerType specifies the repository indexer type
type RepoIndexerType int
const (
// RepoIndexerTypeCode code indexer
RepoIndexerTypeCode RepoIndexerType = iota // 0
// RepoIndexerTypeStats repository stats indexer
RepoIndexerTypeStats // 1
)
// RepoIndexerStatus see models/repo_indexer.go
type RepoIndexerStatus struct {
IndexerType RepoIndexerType `xorm:"INDEX(s) NOT NULL DEFAULT 0"`
}
if err := x.Sync2(new(LanguageStat)); err != nil {
return fmt.Errorf("Sync2: %v", err)
}
x.Delete(&RepoIndexerStatus{IndexerType: RepoIndexerTypeStats})
// Delete language stat statuses
truncExpr := "TRUNCATE TABLE"
if setting.Database.UseSQLite3 {
truncExpr = "DELETE FROM"
}
// Delete language stats
if _, err := x.Exec(fmt.Sprintf("%s language_stat", truncExpr)); err != nil {
return err
}
sess := x.NewSession()
defer sess.Close()
return dropTableColumns(sess, "language_stat", "percentage")
}
alue='dependabot/gradle/com.github.spotbugs-6.0.24'>dependabot/gradle/com.github.spotbugs-6.0.24
blob: 7d9628dbdf4fecaf7c002b8ef6cec3f27d44118a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/testcases"/>
<classpathentry kind="src" path="src/resources/main"/>
<classpathentry kind="src" path="src/ooxml/java"/>
<classpathentry kind="src" path="src/ooxml/testcases"/>
<classpathentry kind="src" path="src/resources/ooxml"/>
<classpathentry kind="src" path="src/scratchpad/src"/>
<classpathentry kind="src" path="src/scratchpad/testcases"/>
<classpathentry kind="src" path="src/resources/scratchpad"/>
<classpathentry kind="src" path="src/contrib/poi-ruby/java"/>
<classpathentry kind="src" path="src/examples/src"/>
<classpathentry kind="src" path="src/excelant/java"/>
<classpathentry kind="src" path="src/excelant/testcases"/>
<classpathentry kind="src" path="src/excelant/resources"/>
<classpathentry kind="src" path="src/integrationtest"/>
<classpathentry kind="lib" path="lib/ant-1.10.1.jar"/>
<classpathentry kind="lib" path="lib/ant-launcher-1.10.1.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ooxml/xmlbeans-4.0.0.jar" sourcepath="lib/ooxml/xmlbeans-3.1.0.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="lib/junit-4.13.jar"/>
<classpathentry kind="lib" path="lib/ooxml/curvesapi-1.06.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ooxml/ooxml-schemas-1.4.jar" sourcepath="lib/ooxml/ooxml-schemas-1.4-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ooxml/ooxml-security-1.1.jar" sourcepath="lib/ooxml/ooxml-security-1.1-sources.jar"/>
<classpathentry kind="lib" path="lib/jmh-core-1.19.jar"/>
<classpathentry kind="lib" path="lib/jmh-generator-annprocess-1.19.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry exported="true" kind="lib" path="compile-lib/slf4j-api-1.7.30.jar"/>
<classpathentry kind="lib" path="compile-lib/bcpkix-jdk15on-1.66.jar"/>
<classpathentry kind="lib" path="compile-lib/bcprov-ext-jdk15on-1.66.jar"/>
<classpathentry kind="lib" path="ooxml-tests/reflections.jar"/>
<classpathentry kind="lib" path="ooxml-tests/guava.jar"/>
<classpathentry kind="lib" path="ooxml-tests/javassist.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ooxml-provided/xmlsec-2.2.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.15.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-collections4-4.4.jar"/>
<classpathentry kind="lib" path="lib/commons-math3-3.6.1.jar"/>
<classpathentry kind="lib" path="lib/xmlunit-core-2.5.1.jar"/>
<classpathentry kind="lib" path="lib/objenesis-2.6.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.20.jar"/>
<classpathentry kind="lib" path="lib/mockito-core-3.5.15.jar"/>
<classpathentry kind="lib" path="lib/byte-buddy-1.10.1.jar"/>
<classpathentry kind="lib" path="lib/byte-buddy-agent-1.10.1.jar"/>
<classpathentry kind="lib" path="compile-lib/batik-all-1.12.jar"/>
<classpathentry kind="lib" path="lib/SparseBitSet-1.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
|