Skip to content

Commit 63af647

Browse files
committed
GitBucket 4.0 support
1 parent 959c46a commit 63af647

File tree

6 files changed

+47
-38
lines changed

6 files changed

+47
-38
lines changed

Diff for: build.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
val Organization = "gitbucket"
22
val Name = "gitbucket-gist-plugin"
3-
val Version = "3.14.0-SNAPSHOT"
3+
val Version = "2.0.0-SNAPSHOT"
44

55
lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
66

@@ -15,7 +15,7 @@ resolvers ++= Seq(
1515
)
1616

1717
libraryDependencies ++= Seq(
18-
"gitbucket" % "gitbucket-assembly" % "3.14.0-SNAPSHOT" % "provided",
18+
"gitbucket" % "gitbucket-assembly" % "4.0.0-SNAPSHOT" % "provided",
1919
"com.typesafe.play" %% "twirl-compiler" % "1.0.4" % "provided",
2020
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
2121
)

Diff for: install-local.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
./sbt.sh package
3-
cp target/scala-2.11/gitbucket-gist-plugin_2.11-3.14.0-SNAPSHOT.jar ~/.gitbucket/plugins/
3+
cp target/scala-2.11/gitbucket-gist-plugin_2.11-2.0.0-SNAPSHOT.jar ~/.gitbucket/plugins/

Diff for: src/main/resources/update/1_0.sql

-27
This file was deleted.

Diff for: src/main/resources/update/1_3.sql

-2
This file was deleted.

Diff for: src/main/resources/update/gitbucket-gist_2.0.xml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<changeSet>
3+
<!--================================================================================================-->
4+
<!-- GIST -->
5+
<!--================================================================================================-->
6+
<createTable tableName="GIST">
7+
<column name="USER_NAME" type="varchar(100)" nullable="false"/>
8+
<column name="REPOSITORY_NAME" type="varchar(100)" nullable="false"/>
9+
<column name="PRIVATE" type="boolean" nullable="false"/>
10+
<column name="TITLE" type="varchar(100)" nullable="false"/>
11+
<column name="DESCRIPTION" type="text" nullable="true"/>
12+
<column name="ORIGIN_USER_NAME" type="varchar(100)" nullable="true"/>
13+
<column name="ORIGIN_REPOSITORY_NAME" type="varchar(100)" nullable="true"/>
14+
<column name="REGISTERED_DATE" type="datetime" nullable="false"/>
15+
<column name="UPDATED_DATE" type="datetime" nullable="false"/>
16+
</createTable>
17+
18+
<addPrimaryKey constraintName="IDX_GIST_PK" tableName="GIST" columnNames="USER_NAME, REPOSITORY_NAME"/>
19+
<addForeignKeyConstraint constraintName="IDX_GIST_FK0" baseTableName="GIST" baseColumnNames="USER_NAME" referencedTableName="ACCOUNT" referencedColumnNames="USER_NAME"/>
20+
21+
<!--================================================================================================-->
22+
<!-- GIST_COMMENT -->
23+
<!--================================================================================================-->
24+
<createTable tableName="GIST_COMMENT">
25+
<column name="USER_NAME" type="varchar(100)" nullable="false"/>
26+
<column name="REPOSITORY_NAME" type="varchar(100)" nullable="false"/>
27+
<column name="COMMENT_ID" type="int" nullable="false" autoIncrement="true" unique="true"/>
28+
<column name="COMMENTED_USER_NAME" type="varchar(100)" nullable="false"/>
29+
<column name="CONTENT" type="text" nullable="false"/>
30+
<column name="REGISTERED_DATE" type="datetime" nullable="false"/>
31+
<column name="UPDATED_DATE" type="datetime" nullable="false"/>
32+
</createTable>
33+
34+
<addPrimaryKey constraintName="IDX_GIST_COMMENT_PK" tableName="GIST_COMMENT" columnNames="COMMENT_ID"/>
35+
<addUniqueConstraint constraintName="IDX_GIST_COMMENT_1" tableName="GIST_COMMENT" columnNames="USER_NAME, REPOSITORY_NAME, COMMENT_ID"/>
36+
<addForeignKeyConstraint constraintName="IDX_GIST_COMMENT_FK0" baseTableName="GIST_COMMENT" baseColumnNames="USER_NAME, REPOSITORY_NAME" referencedTableName="GIST" referencedColumnNames="USER_NAME, REPOSITORY_NAME"/>
37+
<addForeignKeyConstraint constraintName="IDX_GIST_COMMENT_FK1" baseTableName="GIST_COMMENT" baseColumnNames="COMMENTED_USER_NAME" referencedTableName="ACCOUNT" referencedColumnNames="USER_NAME"/>
38+
39+
</changeSet>

Diff for: src/main/scala/Plugin.scala

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import gitbucket.core.service.AccountService
44
import gitbucket.core.service.SystemSettingsService.SystemSettings
55
import gitbucket.gist.controller.GistController
66
import gitbucket.core.plugin._
7-
import gitbucket.core.util.Version
7+
import io.github.gitbucket.solidbase.migration.LiquibaseMigration
8+
import io.github.gitbucket.solidbase.model.Version
89
import java.io.File
910
import javax.servlet.ServletContext
1011
import gitbucket.gist.util.Configurations._
@@ -18,11 +19,9 @@ class Plugin extends gitbucket.core.plugin.Plugin {
1819
override val description: String = "Provides Gist feature on GitBucket."
1920

2021
override val versions: List[Version] = List(
21-
Version(3, 12),
22-
Version(3, 6),
23-
Version(1, 3),
24-
Version(1, 2),
25-
Version(1, 0)
22+
new Version("2.0.0",
23+
new LiquibaseMigration("update/gitbucket-gist_2.0.xml")
24+
)
2625
)
2726

2827
override def initialize(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {

0 commit comments

Comments
 (0)