Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: restructure backend code (#4376)

Danny Xu654b8ebe309a
diff --git a/.dockerignore b/.dockerignore
index 2aeadfc9a6..161f665a15 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,3 +1,3 @@
frontend/node_modules
-server/dist
+backend/server/dist
bytebase-build
diff --git a/.github/workflows/backend-tests-default.yml b/.github/workflows/backend-tests-default.yml
index 35cdc2d6ad..aaa9a64a22 100644
--- a/.github/workflows/backend-tests-default.yml
+++ b/.github/workflows/backend-tests-default.yml
@@ -6,11 +6,8 @@ on:
branches:
- main
- "release/*.*.*"
- paths:
- - "docs/**"
- - "frontend/**"
- - "scripts/**"
- - "quickstart/**"
+ paths-ignore:
+ - "backend/**"
jobs:
golangci-lint:
diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml
index 81ba4a51a6..e5d187f958 100644
--- a/.github/workflows/backend-tests.yml
+++ b/.github/workflows/backend-tests.yml
@@ -5,11 +5,8 @@ on:
branches:
- main
- "release/*.*.*"
- paths-ignore:
- - "docs/**"
- - "frontend/**"
- - "scripts/**"
- - "quickstart/**"
+ paths:
+ - "backend/**"
jobs:
golangci-lint:
@@ -32,8 +29,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
- ./resources/mysql/*.tar.gz
- ./resources/mysql/*.tar.xz
+ ./backend/resources/mysql/*.tar.gz
+ ./backend/resources/mysql/*.tar.xz
key: ${{ runner.OS }}-build-mysql-cache
- name: Install dependencies
run: go generate -tags mysql ./...
@@ -66,8 +63,8 @@ jobs:
uses: actions/cache@v3
with:
path: |
- ./resources/mysql/*.tar.gz
- ./resources/mysql/*.tar.xz
+ ./backend/resources/mysql/*.tar.gz
+ ./backend/resources/mysql/*.tar.xz
key: ${{ runner.OS }}-build-mysql-cache
- name: Install dependencies
run: go generate -tags ${{ matrix.release-tags }} ./...
diff --git a/Dockerfile b/Dockerfile
index 610b2fa980..051f12e5ec 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ RUN pnpm install --frozen-lockfile
COPY ./frontend/ .
# Copy the SQL review config files to the frontend
-COPY ./plugin/advisor/config/ ./src/types
+COPY ./backend/plugin/advisor/config/ ./src/types
# Build frontend
RUN pnpm "${RELEASE}-docker"
@@ -43,7 +43,7 @@ WORKDIR /backend-build
COPY . .
# Copy frontend asset
-COPY --from=frontend /frontend-build/dist ./server/dist
+COPY --from=frontend /frontend-build/dist ./backend/server/dist
COPY ./scripts/VERSION .
@@ -51,9 +51,9 @@ COPY ./scripts/VERSION .
# go-sqlite3 requires CGO_ENABLED
RUN VERSION=`cat ./VERSION`${VERSION_SUFFIX} && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
--tags "${RELEASE},embed_frontend" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \
+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=${BUILD_USER}'" \
-o bytebase \
- ./bin/server/main.go
+ ./backend/bin/server/main.go
# Use debian because mysql requires glibc.
FROM debian:bullseye-slim as monolithic
diff --git a/Dockerfile.bb b/Dockerfile.bb
index 53430e3102..e081df1ba9 100644
--- a/Dockerfile.bb
+++ b/Dockerfile.bb
@@ -20,9 +20,9 @@ COPY . .
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
RUN GOOS=linux GOARCH=amd64 go build \
--tags "release" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/bb/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/bb/cmd.builduser=${BUILD_USER}'" \
+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=${BUILD_USER}'" \
-o bb \
- ./bin/bb/main.go
+ ./backend/bin/bb/main.go
# Use debian because mysql requires glibc.
FROM debian:bullseye-slim as monolithic
diff --git a/Dockerfile.render-demo b/Dockerfile.render-demo
index 2b58d6b6e1..c80f39435a 100644
--- a/Dockerfile.render-demo
+++ b/Dockerfile.render-demo
@@ -14,7 +14,7 @@ RUN pnpm install --frozen-lockfile
COPY ./frontend/ .
# Copy the SQL review config files to the frontend
-COPY ./plugin/advisor/config/ ./src/types
+COPY ./backend/plugin/advisor/config/ ./src/types
# Build frontend
RUN pnpm "${RELEASE}-docker"
@@ -38,7 +38,7 @@ WORKDIR /backend-build
COPY . .
# Copy frontend asset
-COPY --from=frontend /frontend-build/dist ./server/dist
+COPY --from=frontend /frontend-build/dist ./backend/server/dist
COPY ./scripts/VERSION .
@@ -46,9 +46,9 @@ COPY ./scripts/VERSION .
# go-sqlite3 requires CGO_ENABLED
RUN VERSION=`cat ./VERSION` && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
--tags "${RELEASE},embed_frontend" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${RENDER_GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \
+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=${RENDER_GIT_COMMIT}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=${BUILD_USER}'" \
-o bytebase \
- ./bin/server/main.go
+ ./backend/bin/server/main.go
# Use debian because mysql requires glibc.
FROM debian:bullseye-slim as monolithic
diff --git a/Dockerfile.sql-service b/Dockerfile.sql-service
index cedf7b7779..bdd8bc4734 100644
--- a/Dockerfile.sql-service
+++ b/Dockerfile.sql-service
@@ -28,9 +28,9 @@ COPY ./scripts/VERSION .
# go-sqlite3 requires CGO_ENABLED
RUN VERSION=`cat ./VERSION` && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
--tags "${RELEASE}" \
- -ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.builduser=${BUILD_USER}'" \
+ -ldflags="-w -s -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.builduser=${BUILD_USER}'" \
-o sql-service \
- ./bin/sql-service/main.go
+ ./backend/bin/sql-service/main.go
# Use debian because mysql requires glibc.
FROM debian:bullseye-slim as monolithic
diff --git a/LICENSE b/LICENSE
index 49623f3b72..56a453d34a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,7 +2,7 @@ Copyright (c) 2022-present Bytebase (Hong Kong) Limited.
Portions of this software are licensed as follows:
-* All content that resides under the "enterprise/" and "frontend/src/enterprise/" directory of this repository, if that directory exists, is licensed under the license defined in "LICENSE.enterprise".
+* All content that resides under the "backend/enterprise/" and "frontend/src/enterprise/" directory of this repository, if that directory exists, is licensed under the license defined in "LICENSE.enterprise".
* Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below.
Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/LICENSE.enterprise b/LICENSE.enterprise
index 85e14ff901..fe8048c348 100644
--- a/LICENSE.enterprise
+++ b/LICENSE.enterprise
@@ -1,7 +1,7 @@
#####################################################################################
## ##
## NOTE: The following license applies to following code: ##
-## 1. enterprise/ and its subdirectories ##
+## 1. backend/enterprise/ and its subdirectories ##
## 2. frontend/src/enterprise/ and its directories ##
## 3. Any code controlling feature, permission, role and plan enablement ##
## ##
diff --git a/api/api_dependency_gate.go b/api/api_dependency_gate.go
deleted file mode 100644
index 1def5db507..0000000000
--- a/api/api_dependency_gate.go
+++ /dev/null
@@ -1,18 +0,0 @@
-//go:build !release
-// +build !release
-
-package api
-
-// The idea of dependency gate is to use compiler check to prevent introducing unintended dependency.
-// In particular:
-// 1. the plugin package should NOT depend on the api package as the plugin package should be self-contained.
-
-import (
- // dependency gate.
- _ "github.com/bytebase/bytebase/plugin/advisor"
- _ "github.com/bytebase/bytebase/plugin/db"
- _ "github.com/bytebase/bytebase/plugin/metric"
- _ "github.com/bytebase/bytebase/plugin/parser"
- _ "github.com/bytebase/bytebase/plugin/vcs"
- _ "github.com/bytebase/bytebase/plugin/webhook"
-)
diff --git a/api/CODENOTIFY b/backend/api/CODENOTIFY
similarity index 100%
rename from api/CODENOTIFY
rename to backend/api/CODENOTIFY
diff --git a/api/activity.go b/backend/api/activity.go
similarity index 99%
rename from api/activity.go
rename to backend/api/activity.go
index 5873b37bf8..8b824ddd4a 100644
--- a/api/activity.go
+++ b/backend/api/activity.go
@@ -3,8 +3,8 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// ActivityType is the type for an activity.
diff --git a/api/actuator.go b/backend/api/actuator.go
similarity index 100%
rename from api/actuator.go
rename to backend/api/actuator.go
diff --git a/api/anomaly.go b/backend/api/anomaly.go
similarity index 100%
rename from api/anomaly.go
rename to backend/api/anomaly.go
diff --git a/api/api.go b/backend/api/api.go
similarity index 100%
rename from api/api.go
rename to backend/api/api.go
diff --git a/backend/api/api_dependency_gate.go b/backend/api/api_dependency_gate.go
new file mode 100644
index 0000000000..52ff3e8831
--- /dev/null
+++ b/backend/api/api_dependency_gate.go
@@ -0,0 +1,18 @@
+//go:build !release
+// +build !release
+
+package api
+
+// The idea of dependency gate is to use compiler check to prevent introducing unintended dependency.
+// In particular:
+// 1. the plugin package should NOT depend on the api package as the plugin package should be self-contained.
+
+import (
+ // dependency gate.
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ _ "github.com/bytebase/bytebase/backend/plugin/db"
+ _ "github.com/bytebase/bytebase/backend/plugin/metric"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser"
+ _ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ _ "github.com/bytebase/bytebase/backend/plugin/webhook"
+)
diff --git a/api/auth.go b/backend/api/auth.go
similarity index 95%
rename from api/auth.go
rename to backend/api/auth.go
index 194944652a..a6a1fcd58e 100644
--- a/api/auth.go
+++ b/backend/api/auth.go
@@ -1,6 +1,6 @@
package api
-import "github.com/bytebase/bytebase/plugin/vcs"
+import "github.com/bytebase/bytebase/backend/plugin/vcs"
// AuthProvider is the authentication provider which only supports GitLab for now.
type AuthProvider struct {
diff --git a/api/backup.go b/backend/api/backup.go
similarity index 100%
rename from api/backup.go
rename to backend/api/backup.go
diff --git a/api/bookmark.go b/backend/api/bookmark.go
similarity index 100%
rename from api/bookmark.go
rename to backend/api/bookmark.go
diff --git a/api/data_source.go b/backend/api/data_source.go
similarity index 100%
rename from api/data_source.go
rename to backend/api/data_source.go
diff --git a/api/database.go b/backend/api/database.go
similarity index 100%
rename from api/database.go
rename to backend/api/database.go
diff --git a/api/debug.go b/backend/api/debug.go
similarity index 100%
rename from api/debug.go
rename to backend/api/debug.go
diff --git a/api/deploy.go b/backend/api/deploy.go
similarity index 98%
rename from api/deploy.go
rename to backend/api/deploy.go
index fefb83ff0c..be94d39e8b 100644
--- a/api/deploy.go
+++ b/backend/api/deploy.go
@@ -3,7 +3,7 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
// DeploymentConfig is the API message for deployment configurations.
diff --git a/api/deploy_test.go b/backend/api/deploy_test.go
similarity index 100%
rename from api/deploy_test.go
rename to backend/api/deploy_test.go
diff --git a/api/environment.go b/backend/api/environment.go
similarity index 100%
rename from api/environment.go
rename to backend/api/environment.go
diff --git a/api/external_approval.go b/backend/api/external_approval.go
similarity index 100%
rename from api/external_approval.go
rename to backend/api/external_approval.go
diff --git a/api/inbox.go b/backend/api/inbox.go
similarity index 100%
rename from api/inbox.go
rename to backend/api/inbox.go
diff --git a/api/instance.go b/backend/api/instance.go
similarity index 99%
rename from api/instance.go
rename to backend/api/instance.go
index 59cdcdbd18..40ccfd78ff 100644
--- a/api/instance.go
+++ b/backend/api/instance.go
@@ -3,7 +3,7 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// Instance is the API message for an instance.
diff --git a/api/instance_user.go b/backend/api/instance_user.go
similarity index 100%
rename from api/instance_user.go
rename to backend/api/instance_user.go
diff --git a/api/issue.go b/backend/api/issue.go
similarity index 99%
rename from api/issue.go
rename to backend/api/issue.go
index e9ff20a06d..81e618accc 100644
--- a/api/issue.go
+++ b/backend/api/issue.go
@@ -1,8 +1,8 @@
package api
import (
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// IssueStatus is the status of an issue.
diff --git a/api/issue_subscriber.go b/backend/api/issue_subscriber.go
similarity index 100%
rename from api/issue_subscriber.go
rename to backend/api/issue_subscriber.go
diff --git a/api/label.go b/backend/api/label.go
similarity index 100%
rename from api/label.go
rename to backend/api/label.go
diff --git a/api/label_test.go b/backend/api/label_test.go
similarity index 100%
rename from api/label_test.go
rename to backend/api/label_test.go
diff --git a/api/member.go b/backend/api/member.go
similarity index 100%
rename from api/member.go
rename to backend/api/member.go
diff --git a/api/oauth.go b/backend/api/oauth.go
similarity index 100%
rename from api/oauth.go
rename to backend/api/oauth.go
diff --git a/api/pipeline.go b/backend/api/pipeline.go
similarity index 100%
rename from api/pipeline.go
rename to backend/api/pipeline.go
diff --git a/api/plan.go b/backend/api/plan.go
similarity index 100%
rename from api/plan.go
rename to backend/api/plan.go
diff --git a/api/policy.go b/backend/api/policy.go
similarity index 99%
rename from api/policy.go
rename to backend/api/policy.go
index 09c28b7e2e..85ff55b364 100644
--- a/api/policy.go
+++ b/backend/api/policy.go
@@ -5,7 +5,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
)
// PolicyType is the type or name of a policy.
diff --git a/api/principal.go b/backend/api/principal.go
similarity index 100%
rename from api/principal.go
rename to backend/api/principal.go
diff --git a/api/project.go b/backend/api/project.go
similarity index 99%
rename from api/project.go
rename to backend/api/project.go
index 5467e53eab..5cd593a64e 100644
--- a/api/project.go
+++ b/backend/api/project.go
@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
const (
diff --git a/api/project_member.go b/backend/api/project_member.go
similarity index 98%
rename from api/project_member.go
rename to backend/api/project_member.go
index b84d345483..00a6e04963 100644
--- a/api/project_member.go
+++ b/backend/api/project_member.go
@@ -1,7 +1,7 @@
package api
import (
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
// ProjectMember is the API message for project members.
diff --git a/api/project_setting.go b/backend/api/project_setting.go
similarity index 100%
rename from api/project_setting.go
rename to backend/api/project_setting.go
diff --git a/api/project_test.go b/backend/api/project_test.go
similarity index 99%
rename from api/project_test.go
rename to backend/api/project_test.go
index a52211251e..dcd6a811bd 100644
--- a/api/project_test.go
+++ b/backend/api/project_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
func TestGetTemplateTokens(t *testing.T) {
diff --git a/api/project_webhook.go b/backend/api/project_webhook.go
similarity index 100%
rename from api/project_webhook.go
rename to backend/api/project_webhook.go
diff --git a/api/repository.go b/backend/api/repository.go
similarity index 100%
rename from api/repository.go
rename to backend/api/repository.go
diff --git a/api/setting.go b/backend/api/setting.go
similarity index 100%
rename from api/setting.go
rename to backend/api/setting.go
diff --git a/api/sheet.go b/backend/api/sheet.go
similarity index 100%
rename from api/sheet.go
rename to backend/api/sheet.go
diff --git a/api/sheet_organizer.go b/backend/api/sheet_organizer.go
similarity index 100%
rename from api/sheet_organizer.go
rename to backend/api/sheet_organizer.go
diff --git a/api/slug.go b/backend/api/slug.go
similarity index 100%
rename from api/slug.go
rename to backend/api/slug.go
diff --git a/api/sql.go b/backend/api/sql.go
similarity index 95%
rename from api/sql.go
rename to backend/api/sql.go
index 645e7f2249..9d10f429ce 100644
--- a/api/sql.go
+++ b/backend/api/sql.go
@@ -3,8 +3,8 @@ package api
import (
"context"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// ConnectionInfo is the API message for connection infos.
diff --git a/api/stage.go b/backend/api/stage.go
similarity index 100%
rename from api/stage.go
rename to backend/api/stage.go
diff --git a/api/task.go b/backend/api/task.go
similarity index 99%
rename from api/task.go
rename to backend/api/task.go
index 5cef4ee279..466454cd72 100644
--- a/api/task.go
+++ b/backend/api/task.go
@@ -3,8 +3,8 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// TaskStatus is the status of a task.
diff --git a/api/task_check_run.go b/backend/api/task_check_run.go
similarity index 97%
rename from api/task_check_run.go
rename to backend/api/task_check_run.go
index ec42c121a2..070a23a5fe 100644
--- a/api/task_check_run.go
+++ b/backend/api/task_check_run.go
@@ -3,10 +3,10 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/advisor"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// TaskCheckRunStatus is the status of a task check run.
diff --git a/api/task_dag.go b/backend/api/task_dag.go
similarity index 100%
rename from api/task_dag.go
rename to backend/api/task_dag.go
diff --git a/api/task_run.go b/backend/api/task_run.go
similarity index 98%
rename from api/task_run.go
rename to backend/api/task_run.go
index 7f0c526765..7d15806054 100644
--- a/api/task_run.go
+++ b/backend/api/task_run.go
@@ -3,7 +3,7 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
// TaskRunStatus is the status of a task run.
diff --git a/api/v1/docs.go b/backend/api/v1/docs.go
similarity index 100%
rename from api/v1/docs.go
rename to backend/api/v1/docs.go
diff --git a/api/v1/instance.go b/backend/api/v1/instance.go
similarity index 100%
rename from api/v1/instance.go
rename to backend/api/v1/instance.go
diff --git a/api/v1/issue.go b/backend/api/v1/issue.go
similarity index 91%
rename from api/v1/issue.go
rename to backend/api/v1/issue.go
index 94569f8756..64048aadab 100644
--- a/api/v1/issue.go
+++ b/backend/api/v1/issue.go
@@ -1,7 +1,7 @@
package v1
import (
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// IssueCreate is the API message for creating an issue.
diff --git a/api/vcs.go b/backend/api/vcs.go
similarity index 96%
rename from api/vcs.go
rename to backend/api/vcs.go
index 7699d93538..c1f6d980f1 100644
--- a/api/vcs.go
+++ b/backend/api/vcs.go
@@ -3,8 +3,8 @@ package api
import (
"encoding/json"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// VCS is the API message for a VCS (Version Control System).
diff --git a/bin/bb/README.md b/backend/bin/bb/README.md
similarity index 100%
rename from bin/bb/README.md
rename to backend/bin/bb/README.md
diff --git a/bin/bb/cmd/dump.go b/backend/bin/bb/cmd/dump.go
similarity index 100%
rename from bin/bb/cmd/dump.go
rename to backend/bin/bb/cmd/dump.go
diff --git a/bin/bb/cmd/migrate.go b/backend/bin/bb/cmd/migrate.go
similarity index 96%
rename from bin/bb/cmd/migrate.go
rename to backend/bin/bb/cmd/migrate.go
index 51bfdd4d2b..f4b2247fff 100644
--- a/bin/bb/cmd/migrate.go
+++ b/backend/bin/bb/cmd/migrate.go
@@ -12,8 +12,8 @@ import (
"github.com/spf13/cobra"
"github.com/xo/dburl"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
func newMigrateCmd() *cobra.Command {
diff --git a/bin/bb/cmd/restore.go b/backend/bin/bb/cmd/restore.go
similarity index 100%
rename from bin/bb/cmd/restore.go
rename to backend/bin/bb/cmd/restore.go
diff --git a/bin/bb/cmd/root.go b/backend/bin/bb/cmd/root.go
similarity index 92%
rename from bin/bb/cmd/root.go
rename to backend/bin/bb/cmd/root.go
index 903c1d6e47..5b2f87817f 100644
--- a/bin/bb/cmd/root.go
+++ b/backend/bin/bb/cmd/root.go
@@ -4,7 +4,7 @@ package cmd
import (
"github.com/spf13/cobra"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// NewRootCmd creates the root command.
diff --git a/bin/bb/cmd/utils.go b/backend/bin/bb/cmd/utils.go
similarity index 84%
rename from bin/bb/cmd/utils.go
rename to backend/bin/bb/cmd/utils.go
index 02f4d4d35a..7dd0c35518 100644
--- a/bin/bb/cmd/utils.go
+++ b/backend/bin/bb/cmd/utils.go
@@ -7,14 +7,14 @@ import (
"github.com/pkg/errors"
"github.com/xo/dburl"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/mysqlutil"
- "github.com/bytebase/bytebase/resources/postgres"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
// install mysql driver.
- _ "github.com/bytebase/bytebase/plugin/db/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
// register pg driver.
- _ "github.com/bytebase/bytebase/plugin/db/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/pg"
// install pg driver.
)
diff --git a/bin/bb/cmd/var.go b/backend/bin/bb/cmd/var.go
similarity index 100%
rename from bin/bb/cmd/var.go
rename to backend/bin/bb/cmd/var.go
diff --git a/bin/bb/cmd/version.go b/backend/bin/bb/cmd/version.go
similarity index 100%
rename from bin/bb/cmd/version.go
rename to backend/bin/bb/cmd/version.go
diff --git a/bin/bb/main.go b/backend/bin/bb/main.go
similarity index 56%
rename from bin/bb/main.go
rename to backend/bin/bb/main.go
index 058cb46465..7d8445274f 100644
--- a/bin/bb/main.go
+++ b/backend/bin/bb/main.go
@@ -4,12 +4,12 @@ package main
import (
"os"
- "github.com/bytebase/bytebase/bin/bb/cmd"
+ "github.com/bytebase/bytebase/backend/bin/bb/cmd"
// Register mysql driver.
- _ "github.com/bytebase/bytebase/plugin/db/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
// Register postgres driver.
- _ "github.com/bytebase/bytebase/plugin/db/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/pg"
)
func main() {
diff --git a/bin/server/cmd/profile.go b/backend/bin/server/cmd/profile.go
similarity index 84%
rename from bin/server/cmd/profile.go
rename to backend/bin/server/cmd/profile.go
index 8822a1eabb..3cc9ab7eae 100644
--- a/bin/server/cmd/profile.go
+++ b/backend/bin/server/cmd/profile.go
@@ -3,10 +3,10 @@ package cmd
import (
"fmt"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/app/feishu"
- "github.com/bytebase/bytebase/server/component/config"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/app/feishu"
+ "github.com/bytebase/bytebase/backend/server/component/config"
)
func getBaseProfile() config.Profile {
diff --git a/bin/server/cmd/profile_dev.go b/backend/bin/server/cmd/profile_dev.go
similarity index 77%
rename from bin/server/cmd/profile_dev.go
rename to backend/bin/server/cmd/profile_dev.go
index 07f1d34613..f9f27d2804 100644
--- a/bin/server/cmd/profile_dev.go
+++ b/backend/bin/server/cmd/profile_dev.go
@@ -6,8 +6,8 @@ package cmd
import (
"time"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/component/config"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/component/config"
)
func activeProfile(dataDir string) config.Profile {
diff --git a/bin/server/cmd/profile_release.go b/backend/bin/server/cmd/profile_release.go
similarity index 77%
rename from bin/server/cmd/profile_release.go
rename to backend/bin/server/cmd/profile_release.go
index aaa607a6a6..65b92589cf 100644
--- a/bin/server/cmd/profile_release.go
+++ b/backend/bin/server/cmd/profile_release.go
@@ -6,8 +6,8 @@ package cmd
import (
"time"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/component/config"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/component/config"
)
func activeProfile(dataDir string) config.Profile {
diff --git a/bin/server/cmd/root.go b/backend/bin/server/cmd/root.go
similarity index 98%
rename from bin/server/cmd/root.go
rename to backend/bin/server/cmd/root.go
index 573f224c7c..a60bd6b388 100644
--- a/bin/server/cmd/root.go
+++ b/backend/bin/server/cmd/root.go
@@ -17,9 +17,9 @@ import (
"github.com/spf13/cobra"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/server"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/server"
)
// -----------------------------------Global constant BEGIN----------------------------------------.
diff --git a/bin/server/cmd/root_test.go b/backend/bin/server/cmd/root_test.go
similarity index 100%
rename from bin/server/cmd/root_test.go
rename to backend/bin/server/cmd/root_test.go
diff --git a/bin/server/cmd/version.go b/backend/bin/server/cmd/version.go
similarity index 100%
rename from bin/server/cmd/version.go
rename to backend/bin/server/cmd/version.go
diff --git a/bin/server/main.go b/backend/bin/server/main.go
similarity index 74%
rename from bin/server/main.go
rename to backend/bin/server/main.go
index 04dd5eb3f0..6e7afc8463 100644
--- a/bin/server/main.go
+++ b/backend/bin/server/main.go
@@ -4,7 +4,7 @@ package main
import (
"os"
- "github.com/bytebase/bytebase/bin/server/cmd"
+ "github.com/bytebase/bytebase/backend/bin/server/cmd"
)
func main() {
diff --git a/bin/sql-service/README.md b/backend/bin/sql-service/README.md
similarity index 100%
rename from bin/sql-service/README.md
rename to backend/bin/sql-service/README.md
diff --git a/bin/sql-service/cmd/profile_dev.go b/backend/bin/sql-service/cmd/profile_dev.go
similarity index 79%
rename from bin/sql-service/cmd/profile_dev.go
rename to backend/bin/sql-service/cmd/profile_dev.go
index 817fbcf382..a3c33b319b 100644
--- a/bin/sql-service/cmd/profile_dev.go
+++ b/backend/bin/sql-service/cmd/profile_dev.go
@@ -4,8 +4,8 @@
package cmd
import (
- "github.com/bytebase/bytebase/common"
- server "github.com/bytebase/bytebase/sql-server"
+ "github.com/bytebase/bytebase/backend/common"
+ server "github.com/bytebase/bytebase/backend/sql-server"
)
func activeProfile() server.Profile {
diff --git a/bin/sql-service/cmd/profile_release.go b/backend/bin/sql-service/cmd/profile_release.go
similarity index 81%
rename from bin/sql-service/cmd/profile_release.go
rename to backend/bin/sql-service/cmd/profile_release.go
index dc38c30b31..6674fb5164 100644
--- a/bin/sql-service/cmd/profile_release.go
+++ b/backend/bin/sql-service/cmd/profile_release.go
@@ -4,8 +4,8 @@
package cmd
import (
- "github.com/bytebase/bytebase/common"
- server "github.com/bytebase/bytebase/sql-server"
+ "github.com/bytebase/bytebase/backend/common"
+ server "github.com/bytebase/bytebase/backend/sql-server"
)
func activeProfile() server.Profile {
diff --git a/bin/sql-service/cmd/root.go b/backend/bin/sql-service/cmd/root.go
similarity index 93%
rename from bin/sql-service/cmd/root.go
rename to backend/bin/sql-service/cmd/root.go
index 0ca139c033..6acab916b4 100644
--- a/bin/sql-service/cmd/root.go
+++ b/backend/bin/sql-service/cmd/root.go
@@ -12,21 +12,21 @@ import (
"github.com/spf13/cobra"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- server "github.com/bytebase/bytebase/sql-server"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ server "github.com/bytebase/bytebase/backend/sql-server"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
// Register fake advisor.
- _ "github.com/bytebase/bytebase/plugin/advisor/fake"
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor/fake"
// Register mysql advisor.
- _ "github.com/bytebase/bytebase/plugin/advisor/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor/mysql"
// Register postgresql advisor.
- _ "github.com/bytebase/bytebase/plugin/advisor/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor/pg"
// Register postgres parser driver.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
)
// -----------------------------------Global constant BEGIN----------------------------------------.
diff --git a/bin/sql-service/cmd/version.go b/backend/bin/sql-service/cmd/version.go
similarity index 100%
rename from bin/sql-service/cmd/version.go
rename to backend/bin/sql-service/cmd/version.go
diff --git a/bin/sql-service/main.go b/backend/bin/sql-service/main.go
similarity index 73%
rename from bin/sql-service/main.go
rename to backend/bin/sql-service/main.go
index 74b6ad8f98..16e8488838 100644
--- a/bin/sql-service/main.go
+++ b/backend/bin/sql-service/main.go
@@ -4,7 +4,7 @@ package main
import (
"os"
- "github.com/bytebase/bytebase/bin/sql-service/cmd"
+ "github.com/bytebase/bytebase/backend/bin/sql-service/cmd"
)
func main() {
diff --git a/common/config.go b/backend/common/config.go
similarity index 100%
rename from common/config.go
rename to backend/common/config.go
diff --git a/common/context.go b/backend/common/context.go
similarity index 100%
rename from common/context.go
rename to backend/common/context.go
diff --git a/common/counting_reader.go b/backend/common/counting_reader.go
similarity index 100%
rename from common/counting_reader.go
rename to backend/common/counting_reader.go
diff --git a/common/docs.go b/backend/common/docs.go
similarity index 100%
rename from common/docs.go
rename to backend/common/docs.go
diff --git a/common/error.go b/backend/common/error.go
similarity index 100%
rename from common/error.go
rename to backend/common/error.go
diff --git a/common/feature_flag.go b/backend/common/feature_flag.go
similarity index 100%
rename from common/feature_flag.go
rename to backend/common/feature_flag.go
diff --git a/common/feature_flag_dev.go b/backend/common/feature_flag_dev.go
similarity index 100%
rename from common/feature_flag_dev.go
rename to backend/common/feature_flag_dev.go
diff --git a/common/feature_flag_prod.go b/backend/common/feature_flag_prod.go
similarity index 100%
rename from common/feature_flag_prod.go
rename to backend/common/feature_flag_prod.go
diff --git a/common/log/logger.go b/backend/common/log/logger.go
similarity index 100%
rename from common/log/logger.go
rename to backend/common/log/logger.go
diff --git a/common/mock.go b/backend/common/mock.go
similarity index 100%
rename from common/mock.go
rename to backend/common/mock.go
diff --git a/common/oauth.go b/backend/common/oauth.go
similarity index 100%
rename from common/oauth.go
rename to backend/common/oauth.go
diff --git a/common/role.go b/backend/common/role.go
similarity index 100%
rename from common/role.go
rename to backend/common/role.go
diff --git a/common/util.go b/backend/common/util.go
similarity index 100%
rename from common/util.go
rename to backend/common/util.go
diff --git a/common/util_test.go b/backend/common/util_test.go
similarity index 100%
rename from common/util_test.go
rename to backend/common/util_test.go
diff --git a/enterprise/README.md b/backend/enterprise/README.md
similarity index 100%
rename from enterprise/README.md
rename to backend/enterprise/README.md
diff --git a/enterprise/api/license.go b/backend/enterprise/api/license.go
similarity index 97%
rename from enterprise/api/license.go
rename to backend/enterprise/api/license.go
index e6d73d1c58..d706f5fa3c 100644
--- a/enterprise/api/license.go
+++ b/backend/enterprise/api/license.go
@@ -8,7 +8,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// validPlans is a string array of valid plan types.
diff --git a/enterprise/api/subscription.go b/backend/enterprise/api/subscription.go
similarity index 93%
rename from enterprise/api/subscription.go
rename to backend/enterprise/api/subscription.go
index 2be5e585f9..0199fe6f57 100644
--- a/enterprise/api/subscription.go
+++ b/backend/enterprise/api/subscription.go
@@ -1,6 +1,6 @@
package api
-import "github.com/bytebase/bytebase/api"
+import "github.com/bytebase/bytebase/backend/api"
// SubscriptionPatch is the API message for update the subscription.
type SubscriptionPatch struct {
diff --git a/enterprise/config/config.go b/backend/enterprise/config/config.go
similarity index 96%
rename from enterprise/config/config.go
rename to backend/enterprise/config/config.go
index 3dfdf790da..5e5c83f15b 100644
--- a/enterprise/config/config.go
+++ b/backend/enterprise/config/config.go
@@ -8,7 +8,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
//go:embed keys
diff --git a/enterprise/config/keys/README.md b/backend/enterprise/config/keys/README.md
similarity index 100%
rename from enterprise/config/keys/README.md
rename to backend/enterprise/config/keys/README.md
diff --git a/enterprise/config/keys/dev.pub.pem b/backend/enterprise/config/keys/dev.pub.pem
similarity index 100%
rename from enterprise/config/keys/dev.pub.pem
rename to backend/enterprise/config/keys/dev.pub.pem
diff --git a/enterprise/config/keys/prod.pub.pem b/backend/enterprise/config/keys/prod.pub.pem
similarity index 100%
rename from enterprise/config/keys/prod.pub.pem
rename to backend/enterprise/config/keys/prod.pub.pem
diff --git a/enterprise/service/license.go b/backend/enterprise/service/license.go
similarity index 96%
rename from enterprise/service/license.go
rename to backend/enterprise/service/license.go
index 0bb4696f2c..37e024affd 100644
--- a/enterprise/service/license.go
+++ b/backend/enterprise/service/license.go
@@ -10,12 +10,12 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/enterprise/config"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/enterprise/config"
+ "github.com/bytebase/bytebase/backend/store"
)
// LicenseService is the service for enterprise license.
diff --git a/metric/collector/database_count.go b/backend/metric/collector/database_count.go
similarity index 89%
rename from metric/collector/database_count.go
rename to backend/metric/collector/database_count.go
index 37ae353188..5b39004271 100644
--- a/metric/collector/database_count.go
+++ b/backend/metric/collector/database_count.go
@@ -4,9 +4,9 @@ import (
"context"
"strconv"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*databaseCountCollector)(nil)
diff --git a/metric/collector/docs.go b/backend/metric/collector/docs.go
similarity index 100%
rename from metric/collector/docs.go
rename to backend/metric/collector/docs.go
diff --git a/metric/collector/instance_count.go b/backend/metric/collector/instance_count.go
similarity index 86%
rename from metric/collector/instance_count.go
rename to backend/metric/collector/instance_count.go
index 9818b76ec6..0c3f2df33b 100644
--- a/metric/collector/instance_count.go
+++ b/backend/metric/collector/instance_count.go
@@ -5,10 +5,10 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/common/log"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*instanceCountCollector)(nil)
diff --git a/metric/collector/issue_count.go b/backend/metric/collector/issue_count.go
similarity index 86%
rename from metric/collector/issue_count.go
rename to backend/metric/collector/issue_count.go
index 7403f81d1a..29f30d6822 100644
--- a/metric/collector/issue_count.go
+++ b/backend/metric/collector/issue_count.go
@@ -3,9 +3,9 @@ package collector
import (
"context"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*issueCountCollector)(nil)
diff --git a/metric/collector/member_count.go b/backend/metric/collector/member_count.go
similarity index 87%
rename from metric/collector/member_count.go
rename to backend/metric/collector/member_count.go
index 733d351879..3f4e222dd0 100644
--- a/metric/collector/member_count.go
+++ b/backend/metric/collector/member_count.go
@@ -3,9 +3,9 @@ package collector
import (
"context"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*memberCountCollector)(nil)
diff --git a/metric/collector/policy_count.go b/backend/metric/collector/policy_count.go
similarity index 91%
rename from metric/collector/policy_count.go
rename to backend/metric/collector/policy_count.go
index 1cb3f33316..3ee6d741f5 100644
--- a/metric/collector/policy_count.go
+++ b/backend/metric/collector/policy_count.go
@@ -4,10 +4,10 @@ import (
"context"
"fmt"
- "github.com/bytebase/bytebase/api"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*policyCountCollector)(nil)
diff --git a/metric/collector/project_count.go b/backend/metric/collector/project_count.go
similarity index 87%
rename from metric/collector/project_count.go
rename to backend/metric/collector/project_count.go
index c1de0e69b3..aaf8f71160 100644
--- a/metric/collector/project_count.go
+++ b/backend/metric/collector/project_count.go
@@ -3,9 +3,9 @@ package collector
import (
"context"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*projectCountCollector)(nil)
diff --git a/metric/collector/sheet_count.go b/backend/metric/collector/sheet_count.go
similarity index 87%
rename from metric/collector/sheet_count.go
rename to backend/metric/collector/sheet_count.go
index e5416341e6..fd1260dacb 100644
--- a/metric/collector/sheet_count.go
+++ b/backend/metric/collector/sheet_count.go
@@ -3,9 +3,9 @@ package collector
import (
"context"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*sheetCountCollector)(nil)
diff --git a/metric/collector/task_count.go b/backend/metric/collector/task_count.go
similarity index 86%
rename from metric/collector/task_count.go
rename to backend/metric/collector/task_count.go
index 68fe4d7463..66cc4f2000 100644
--- a/metric/collector/task_count.go
+++ b/backend/metric/collector/task_count.go
@@ -3,9 +3,9 @@ package collector
import (
"context"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/store"
)
var _ metric.Collector = (*taskCountCollector)(nil)
diff --git a/metric/metric.go b/backend/metric/metric.go
similarity index 95%
rename from metric/metric.go
rename to backend/metric/metric.go
index c5f6614042..dd4bdc386c 100644
--- a/metric/metric.go
+++ b/backend/metric/metric.go
@@ -2,9 +2,9 @@
package metric
import (
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/metric"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
)
const (
diff --git a/plugin/CODENOTIFY b/backend/plugin/CODENOTIFY
similarity index 100%
rename from plugin/CODENOTIFY
rename to backend/plugin/CODENOTIFY
diff --git a/plugin/advisor/advisor.go b/backend/plugin/advisor/advisor.go
similarity index 99%
rename from plugin/advisor/advisor.go
rename to backend/plugin/advisor/advisor.go
index e7d1b874ac..20bc4c125a 100644
--- a/plugin/advisor/advisor.go
+++ b/backend/plugin/advisor/advisor.go
@@ -11,8 +11,8 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap/zapcore"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
// Status is the advisor result status.
diff --git a/plugin/advisor/catalog/catalog.go b/backend/plugin/advisor/catalog/catalog.go
similarity index 100%
rename from plugin/advisor/catalog/catalog.go
rename to backend/plugin/advisor/catalog/catalog.go
diff --git a/plugin/advisor/catalog/finder.go b/backend/plugin/advisor/catalog/finder.go
similarity index 97%
rename from plugin/advisor/catalog/finder.go
rename to backend/plugin/advisor/catalog/finder.go
index 212569c101..31e9618bb9 100644
--- a/plugin/advisor/catalog/finder.go
+++ b/backend/plugin/advisor/catalog/finder.go
@@ -1,7 +1,7 @@
package catalog
import (
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/advisor/catalog/state.go b/backend/plugin/advisor/catalog/state.go
similarity index 99%
rename from plugin/advisor/catalog/state.go
rename to backend/plugin/advisor/catalog/state.go
index 5f8dda89c9..e7620059dd 100644
--- a/plugin/advisor/catalog/state.go
+++ b/backend/plugin/advisor/catalog/state.go
@@ -7,7 +7,7 @@ package catalog
import (
"strings"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/advisor/catalog/test/mysql_walk_through.yaml b/backend/plugin/advisor/catalog/test/mysql_walk_through.yaml
similarity index 100%
rename from plugin/advisor/catalog/test/mysql_walk_through.yaml
rename to backend/plugin/advisor/catalog/test/mysql_walk_through.yaml
diff --git a/plugin/advisor/catalog/test/mysql_walk_through_for_incomplete.yaml b/backend/plugin/advisor/catalog/test/mysql_walk_through_for_incomplete.yaml
similarity index 100%
rename from plugin/advisor/catalog/test/mysql_walk_through_for_incomplete.yaml
rename to backend/plugin/advisor/catalog/test/mysql_walk_through_for_incomplete.yaml
diff --git a/plugin/advisor/catalog/test/pg_walk_through.yaml b/backend/plugin/advisor/catalog/test/pg_walk_through.yaml
similarity index 100%
rename from plugin/advisor/catalog/test/pg_walk_through.yaml
rename to backend/plugin/advisor/catalog/test/pg_walk_through.yaml
diff --git a/plugin/advisor/catalog/walk_through.go b/backend/plugin/advisor/catalog/walk_through.go
similarity index 99%
rename from plugin/advisor/catalog/walk_through.go
rename to backend/plugin/advisor/catalog/walk_through.go
index 620a6f9f55..fa5dcd7ffa 100644
--- a/plugin/advisor/catalog/walk_through.go
+++ b/backend/plugin/advisor/catalog/walk_through.go
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
tidbparser "github.com/pingcap/tidb/parser"
tidbast "github.com/pingcap/tidb/parser/ast"
diff --git a/plugin/advisor/catalog/walk_through_for_pg.go b/backend/plugin/advisor/catalog/walk_through_for_pg.go
similarity index 99%
rename from plugin/advisor/catalog/walk_through_for_pg.go
rename to backend/plugin/advisor/catalog/walk_through_for_pg.go
index 27fbd9a342..c9fe851a22 100644
--- a/plugin/advisor/catalog/walk_through_for_pg.go
+++ b/backend/plugin/advisor/catalog/walk_through_for_pg.go
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
const (
diff --git a/plugin/advisor/catalog/walk_through_test.go b/backend/plugin/advisor/catalog/walk_through_test.go
similarity index 98%
rename from plugin/advisor/catalog/walk_through_test.go
rename to backend/plugin/advisor/catalog/walk_through_test.go
index 0e5d517009..246986a388 100644
--- a/plugin/advisor/catalog/walk_through_test.go
+++ b/backend/plugin/advisor/catalog/walk_through_test.go
@@ -11,14 +11,14 @@ import (
"google.golang.org/protobuf/types/known/wrapperspb"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
// Register postgresql parser driver.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
)
type testData struct {
diff --git a/plugin/advisor/code.go b/backend/plugin/advisor/code.go
similarity index 100%
rename from plugin/advisor/code.go
rename to backend/plugin/advisor/code.go
diff --git a/plugin/advisor/config.go b/backend/plugin/advisor/config.go
similarity index 100%
rename from plugin/advisor/config.go
rename to backend/plugin/advisor/config.go
diff --git a/plugin/advisor/config/sql-review.dev.yaml b/backend/plugin/advisor/config/sql-review.dev.yaml
similarity index 100%
rename from plugin/advisor/config/sql-review.dev.yaml
rename to backend/plugin/advisor/config/sql-review.dev.yaml
diff --git a/plugin/advisor/config/sql-review.override.yaml b/backend/plugin/advisor/config/sql-review.override.yaml
similarity index 100%
rename from plugin/advisor/config/sql-review.override.yaml
rename to backend/plugin/advisor/config/sql-review.override.yaml
diff --git a/plugin/advisor/config/sql-review.prod.yaml b/backend/plugin/advisor/config/sql-review.prod.yaml
similarity index 100%
rename from plugin/advisor/config/sql-review.prod.yaml
rename to backend/plugin/advisor/config/sql-review.prod.yaml
diff --git a/plugin/advisor/config_test.go b/backend/plugin/advisor/config_test.go
similarity index 100%
rename from plugin/advisor/config_test.go
rename to backend/plugin/advisor/config_test.go
diff --git a/plugin/advisor/db/db.go b/backend/plugin/advisor/db/db.go
similarity index 100%
rename from plugin/advisor/db/db.go
rename to backend/plugin/advisor/db/db.go
diff --git a/plugin/advisor/fake/fake_advisor.go b/backend/plugin/advisor/fake/fake_advisor.go
similarity index 88%
rename from plugin/advisor/fake/fake_advisor.go
rename to backend/plugin/advisor/fake/fake_advisor.go
index cd5434d300..cf4115213f 100644
--- a/plugin/advisor/fake/fake_advisor.go
+++ b/backend/plugin/advisor/fake/fake_advisor.go
@@ -2,8 +2,8 @@
package fake
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/generator/README.md b/backend/plugin/advisor/generator/README.md
similarity index 100%
rename from plugin/advisor/generator/README.md
rename to backend/plugin/advisor/generator/README.md
diff --git a/plugin/advisor/generator/main.go b/backend/plugin/advisor/generator/main.go
similarity index 100%
rename from plugin/advisor/generator/main.go
rename to backend/plugin/advisor/generator/main.go
diff --git a/plugin/advisor/generator/mysql.template b/backend/plugin/advisor/generator/mysql.template
similarity index 93%
rename from plugin/advisor/generator/mysql.template
rename to backend/plugin/advisor/generator/mysql.template
index 822cc40af6..5c8e724c4c 100644
--- a/plugin/advisor/generator/mysql.template
+++ b/backend/plugin/advisor/generator/mysql.template
@@ -3,8 +3,8 @@ package mysql
// Framework code is generated by the generator.
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
"github.com/pingcap/tidb/parser/ast"
)
diff --git a/plugin/advisor/generator/postgresql.template b/backend/plugin/advisor/generator/postgresql.template
similarity index 88%
rename from plugin/advisor/generator/postgresql.template
rename to backend/plugin/advisor/generator/postgresql.template
index dcdb0b1c16..35893297ea 100644
--- a/plugin/advisor/generator/postgresql.template
+++ b/backend/plugin/advisor/generator/postgresql.template
@@ -3,9 +3,9 @@ package pg
// Framework code is generated by the generator.
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/mysql/advisor_charset_allowlist.go b/backend/plugin/advisor/mysql/advisor_charset_allowlist.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_charset_allowlist.go
rename to backend/plugin/advisor/mysql/advisor_charset_allowlist.go
index 0c560787a0..c8e325d067 100644
--- a/plugin/advisor/mysql/advisor_charset_allowlist.go
+++ b/backend/plugin/advisor/mysql/advisor_charset_allowlist.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_collation_allowlist.go b/backend/plugin/advisor/mysql/advisor_collation_allowlist.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_collation_allowlist.go
rename to backend/plugin/advisor/mysql/advisor_collation_allowlist.go
index dc51bc82ec..77b30e8043 100644
--- a/plugin/advisor/mysql/advisor_collation_allowlist.go
+++ b/backend/plugin/advisor/mysql/advisor_collation_allowlist.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_colum_require_default.go b/backend/plugin/advisor/mysql/advisor_colum_require_default.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_colum_require_default.go
rename to backend/plugin/advisor/mysql/advisor_colum_require_default.go
index 21022a9a8e..e47743756d 100644
--- a/plugin/advisor/mysql/advisor_colum_require_default.go
+++ b/backend/plugin/advisor/mysql/advisor_colum_require_default.go
@@ -9,8 +9,8 @@ import (
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/types"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_auto_increment_initial_value.go b/backend/plugin/advisor/mysql/advisor_column_auto_increment_initial_value.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_column_auto_increment_initial_value.go
rename to backend/plugin/advisor/mysql/advisor_column_auto_increment_initial_value.go
index bce2392e0e..49d3308aa7 100644
--- a/plugin/advisor/mysql/advisor_column_auto_increment_initial_value.go
+++ b/backend/plugin/advisor/mysql/advisor_column_auto_increment_initial_value.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_auto_increment_must_integer.go b/backend/plugin/advisor/mysql/advisor_column_auto_increment_must_integer.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_column_auto_increment_must_integer.go
rename to backend/plugin/advisor/mysql/advisor_column_auto_increment_must_integer.go
index 563461adff..48dbdb6ca4 100644
--- a/plugin/advisor/mysql/advisor_column_auto_increment_must_integer.go
+++ b/backend/plugin/advisor/mysql/advisor_column_auto_increment_must_integer.go
@@ -9,8 +9,8 @@ import (
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/types"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_auto_increment_must_unsigned.go b/backend/plugin/advisor/mysql/advisor_column_auto_increment_must_unsigned.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_column_auto_increment_must_unsigned.go
rename to backend/plugin/advisor/mysql/advisor_column_auto_increment_must_unsigned.go
index bbdb8f8144..9ac86ee5cc 100644
--- a/plugin/advisor/mysql/advisor_column_auto_increment_must_unsigned.go
+++ b/backend/plugin/advisor/mysql/advisor_column_auto_increment_must_unsigned.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/mysql"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_comment_convention.go b/backend/plugin/advisor/mysql/advisor_column_comment_convention.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_column_comment_convention.go
rename to backend/plugin/advisor/mysql/advisor_column_comment_convention.go
index fa65e5bd3d..3dcff8482a 100644
--- a/plugin/advisor/mysql/advisor_column_comment_convention.go
+++ b/backend/plugin/advisor/mysql/advisor_column_comment_convention.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/format"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_current_time_count_limit.go b/backend/plugin/advisor/mysql/advisor_column_current_time_count_limit.go
similarity index 98%
rename from plugin/advisor/mysql/advisor_column_current_time_count_limit.go
rename to backend/plugin/advisor/mysql/advisor_column_current_time_count_limit.go
index 3fe0dae35d..c64f687366 100644
--- a/plugin/advisor/mysql/advisor_column_current_time_count_limit.go
+++ b/backend/plugin/advisor/mysql/advisor_column_current_time_count_limit.go
@@ -10,8 +10,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/mysql"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
const (
diff --git a/plugin/advisor/mysql/advisor_column_disallow_changing.go b/backend/plugin/advisor/mysql/advisor_column_disallow_changing.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_column_disallow_changing.go
rename to backend/plugin/advisor/mysql/advisor_column_disallow_changing.go
index 404713edba..19c8a0639d 100644
--- a/plugin/advisor/mysql/advisor_column_disallow_changing.go
+++ b/backend/plugin/advisor/mysql/advisor_column_disallow_changing.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_disallow_changing_order.go b/backend/plugin/advisor/mysql/advisor_column_disallow_changing_order.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_column_disallow_changing_order.go
rename to backend/plugin/advisor/mysql/advisor_column_disallow_changing_order.go
index f4c4213f76..02e66067d5 100644
--- a/plugin/advisor/mysql/advisor_column_disallow_changing_order.go
+++ b/backend/plugin/advisor/mysql/advisor_column_disallow_changing_order.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_disallow_changing_type.go b/backend/plugin/advisor/mysql/advisor_column_disallow_changing_type.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_column_disallow_changing_type.go
rename to backend/plugin/advisor/mysql/advisor_column_disallow_changing_type.go
index cf76a0a3d1..87c360c3e4 100644
--- a/plugin/advisor/mysql/advisor_column_disallow_changing_type.go
+++ b/backend/plugin/advisor/mysql/advisor_column_disallow_changing_type.go
@@ -8,9 +8,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_disallow_set_charset.go b/backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_column_disallow_set_charset.go
rename to backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.go
index 433d3fc80e..e1930909be 100644
--- a/plugin/advisor/mysql/advisor_column_disallow_set_charset.go
+++ b/backend/plugin/advisor/mysql/advisor_column_disallow_set_charset.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_maximum_character_length.go b/backend/plugin/advisor/mysql/advisor_column_maximum_character_length.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_column_maximum_character_length.go
rename to backend/plugin/advisor/mysql/advisor_column_maximum_character_length.go
index fe6cddcdcb..c20bb03bde 100644
--- a/plugin/advisor/mysql/advisor_column_maximum_character_length.go
+++ b/backend/plugin/advisor/mysql/advisor_column_maximum_character_length.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/mysql"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_no_null.go b/backend/plugin/advisor/mysql/advisor_column_no_null.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_column_no_null.go
rename to backend/plugin/advisor/mysql/advisor_column_no_null.go
index fa6f957265..6f4dbb4058 100644
--- a/plugin/advisor/mysql/advisor_column_no_null.go
+++ b/backend/plugin/advisor/mysql/advisor_column_no_null.go
@@ -6,9 +6,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_required.go b/backend/plugin/advisor/mysql/advisor_column_required.go
similarity index 98%
rename from plugin/advisor/mysql/advisor_column_required.go
rename to backend/plugin/advisor/mysql/advisor_column_required.go
index c6ae234f40..95d7a6aa69 100644
--- a/plugin/advisor/mysql/advisor_column_required.go
+++ b/backend/plugin/advisor/mysql/advisor_column_required.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_set_default_for_not_null.go b/backend/plugin/advisor/mysql/advisor_column_set_default_for_not_null.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_column_set_default_for_not_null.go
rename to backend/plugin/advisor/mysql/advisor_column_set_default_for_not_null.go
index e5910634f9..7a8992447c 100644
--- a/plugin/advisor/mysql/advisor_column_set_default_for_not_null.go
+++ b/backend/plugin/advisor/mysql/advisor_column_set_default_for_not_null.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_column_type_restriction.go b/backend/plugin/advisor/mysql/advisor_column_type_restriction.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_column_type_restriction.go
rename to backend/plugin/advisor/mysql/advisor_column_type_restriction.go
index 56e205887f..c3a14d195b 100644
--- a/plugin/advisor/mysql/advisor_column_type_restriction.go
+++ b/backend/plugin/advisor/mysql/advisor_column_type_restriction.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_database_drop_empty_db.go b/backend/plugin/advisor/mysql/advisor_database_drop_empty_db.go
similarity index 93%
rename from plugin/advisor/mysql/advisor_database_drop_empty_db.go
rename to backend/plugin/advisor/mysql/advisor_database_drop_empty_db.go
index 25dbd2e632..09048cabbd 100644
--- a/plugin/advisor/mysql/advisor_database_drop_empty_db.go
+++ b/backend/plugin/advisor/mysql/advisor_database_drop_empty_db.go
@@ -5,9 +5,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_index_key_number_limit.go b/backend/plugin/advisor/mysql/advisor_index_key_number_limit.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_index_key_number_limit.go
rename to backend/plugin/advisor/mysql/advisor_index_key_number_limit.go
index c7de6c27aa..04de632436 100644
--- a/plugin/advisor/mysql/advisor_index_key_number_limit.go
+++ b/backend/plugin/advisor/mysql/advisor_index_key_number_limit.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_index_no_duplicate_column.go b/backend/plugin/advisor/mysql/advisor_index_no_duplicate_column.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_index_no_duplicate_column.go
rename to backend/plugin/advisor/mysql/advisor_index_no_duplicate_column.go
index 2671756f3a..ff91ceef7f 100644
--- a/plugin/advisor/mysql/advisor_index_no_duplicate_column.go
+++ b/backend/plugin/advisor/mysql/advisor_index_no_duplicate_column.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_index_pk_type.go b/backend/plugin/advisor/mysql/advisor_index_pk_type.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_index_pk_type.go
rename to backend/plugin/advisor/mysql/advisor_index_pk_type.go
index 6d4dca5144..e63ca3d5a7 100644
--- a/plugin/advisor/mysql/advisor_index_pk_type.go
+++ b/backend/plugin/advisor/mysql/advisor_index_pk_type.go
@@ -10,9 +10,9 @@ import (
"github.com/pingcap/tidb/parser/types"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_index_total_number_limit.go b/backend/plugin/advisor/mysql/advisor_index_total_number_limit.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_index_total_number_limit.go
rename to backend/plugin/advisor/mysql/advisor_index_total_number_limit.go
index 0c7aa97f93..c3208cef06 100644
--- a/plugin/advisor/mysql/advisor_index_total_number_limit.go
+++ b/backend/plugin/advisor/mysql/advisor_index_total_number_limit.go
@@ -8,9 +8,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_index_type_no_blob.go b/backend/plugin/advisor/mysql/advisor_index_type_no_blob.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_index_type_no_blob.go
rename to backend/plugin/advisor/mysql/advisor_index_type_no_blob.go
index 83c7ec0e16..6d8f9f5f8c 100644
--- a/plugin/advisor/mysql/advisor_index_type_no_blob.go
+++ b/backend/plugin/advisor/mysql/advisor_index_type_no_blob.go
@@ -11,9 +11,9 @@ import (
"github.com/pingcap/tidb/parser/types"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_insert_disallow_order_by_rand.go b/backend/plugin/advisor/mysql/advisor_insert_disallow_order_by_rand.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_insert_disallow_order_by_rand.go
rename to backend/plugin/advisor/mysql/advisor_insert_disallow_order_by_rand.go
index 8379a60e47..8a035b831a 100644
--- a/plugin/advisor/mysql/advisor_insert_disallow_order_by_rand.go
+++ b/backend/plugin/advisor/mysql/advisor_insert_disallow_order_by_rand.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_insert_must_specify_column.go b/backend/plugin/advisor/mysql/advisor_insert_must_specify_column.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_insert_must_specify_column.go
rename to backend/plugin/advisor/mysql/advisor_insert_must_specify_column.go
index a7ce7ce928..666a61922a 100644
--- a/plugin/advisor/mysql/advisor_insert_must_specify_column.go
+++ b/backend/plugin/advisor/mysql/advisor_insert_must_specify_column.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_insert_row_limit.go b/backend/plugin/advisor/mysql/advisor_insert_row_limit.go
similarity index 98%
rename from plugin/advisor/mysql/advisor_insert_row_limit.go
rename to backend/plugin/advisor/mysql/advisor_insert_row_limit.go
index c32b945f29..80fa8b2db7 100644
--- a/plugin/advisor/mysql/advisor_insert_row_limit.go
+++ b/backend/plugin/advisor/mysql/advisor_insert_row_limit.go
@@ -11,8 +11,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_migration_compatibility.go b/backend/plugin/advisor/mysql/advisor_migration_compatibility.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_migration_compatibility.go
rename to backend/plugin/advisor/mysql/advisor_migration_compatibility.go
index f0274fa6bf..89def71e3e 100644
--- a/plugin/advisor/mysql/advisor_migration_compatibility.go
+++ b/backend/plugin/advisor/mysql/advisor_migration_compatibility.go
@@ -3,8 +3,8 @@ package mysql
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
"github.com/pingcap/tidb/parser/ast"
)
diff --git a/plugin/advisor/mysql/advisor_naming_auto_increment_column.go b/backend/plugin/advisor/mysql/advisor_naming_auto_increment_column.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_naming_auto_increment_column.go
rename to backend/plugin/advisor/mysql/advisor_naming_auto_increment_column.go
index 6076efeaab..5741944f6b 100644
--- a/plugin/advisor/mysql/advisor_naming_auto_increment_column.go
+++ b/backend/plugin/advisor/mysql/advisor_naming_auto_increment_column.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_naming_column.go b/backend/plugin/advisor/mysql/advisor_naming_column.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_naming_column.go
rename to backend/plugin/advisor/mysql/advisor_naming_column.go
index de98190bb4..656d0fc125 100644
--- a/plugin/advisor/mysql/advisor_naming_column.go
+++ b/backend/plugin/advisor/mysql/advisor_naming_column.go
@@ -6,8 +6,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go b/backend/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go
similarity index 98%
rename from plugin/advisor/mysql/advisor_naming_foreign_key_convention.go
rename to backend/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go
index db531aab22..a84628891f 100644
--- a/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go
+++ b/backend/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go
@@ -6,8 +6,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_naming_index_convention.go b/backend/plugin/advisor/mysql/advisor_naming_index_convention.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_naming_index_convention.go
rename to backend/plugin/advisor/mysql/advisor_naming_index_convention.go
index 8d65596c45..a3c76e7c69 100644
--- a/plugin/advisor/mysql/advisor_naming_index_convention.go
+++ b/backend/plugin/advisor/mysql/advisor_naming_index_convention.go
@@ -7,9 +7,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_naming_table.go b/backend/plugin/advisor/mysql/advisor_naming_table.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_naming_table.go
rename to backend/plugin/advisor/mysql/advisor_naming_table.go
index 2e852f0e2e..7be3425f26 100644
--- a/plugin/advisor/mysql/advisor_naming_table.go
+++ b/backend/plugin/advisor/mysql/advisor_naming_table.go
@@ -6,8 +6,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_naming_unique_key_convention.go b/backend/plugin/advisor/mysql/advisor_naming_unique_key_convention.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_naming_unique_key_convention.go
rename to backend/plugin/advisor/mysql/advisor_naming_unique_key_convention.go
index 3a742671bb..272d4c978d 100644
--- a/plugin/advisor/mysql/advisor_naming_unique_key_convention.go
+++ b/backend/plugin/advisor/mysql/advisor_naming_unique_key_convention.go
@@ -6,9 +6,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_statement_affected_row_limit.go b/backend/plugin/advisor/mysql/advisor_statement_affected_row_limit.go
similarity index 97%
rename from plugin/advisor/mysql/advisor_statement_affected_row_limit.go
rename to backend/plugin/advisor/mysql/advisor_statement_affected_row_limit.go
index 94a3336918..acb028432c 100644
--- a/plugin/advisor/mysql/advisor_statement_affected_row_limit.go
+++ b/backend/plugin/advisor/mysql/advisor_statement_affected_row_limit.go
@@ -11,8 +11,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_statement_dml_dry_run.go b/backend/plugin/advisor/mysql/advisor_statement_dml_dry_run.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_statement_dml_dry_run.go
rename to backend/plugin/advisor/mysql/advisor_statement_dml_dry_run.go
index 38bb8f33e6..158b4bdbd9 100644
--- a/plugin/advisor/mysql/advisor_statement_dml_dry_run.go
+++ b/backend/plugin/advisor/mysql/advisor_statement_dml_dry_run.go
@@ -9,8 +9,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_statement_merge_alter_table.go b/backend/plugin/advisor/mysql/advisor_statement_merge_alter_table.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_statement_merge_alter_table.go
rename to backend/plugin/advisor/mysql/advisor_statement_merge_alter_table.go
index c69b788f3a..39bdd2b9f9 100644
--- a/plugin/advisor/mysql/advisor_statement_merge_alter_table.go
+++ b/backend/plugin/advisor/mysql/advisor_statement_merge_alter_table.go
@@ -8,8 +8,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_stmt_disallow_commit.go b/backend/plugin/advisor/mysql/advisor_stmt_disallow_commit.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_stmt_disallow_commit.go
rename to backend/plugin/advisor/mysql/advisor_stmt_disallow_commit.go
index 44cf16bc85..9476156336 100644
--- a/plugin/advisor/mysql/advisor_stmt_disallow_commit.go
+++ b/backend/plugin/advisor/mysql/advisor_stmt_disallow_commit.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_stmt_disallow_limit.go b/backend/plugin/advisor/mysql/advisor_stmt_disallow_limit.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_stmt_disallow_limit.go
rename to backend/plugin/advisor/mysql/advisor_stmt_disallow_limit.go
index f043f01cb3..46ad4332b7 100644
--- a/plugin/advisor/mysql/advisor_stmt_disallow_limit.go
+++ b/backend/plugin/advisor/mysql/advisor_stmt_disallow_limit.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_stmt_disallow_order_by.go b/backend/plugin/advisor/mysql/advisor_stmt_disallow_order_by.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_stmt_disallow_order_by.go
rename to backend/plugin/advisor/mysql/advisor_stmt_disallow_order_by.go
index 35aa19fd39..75092cadf4 100644
--- a/plugin/advisor/mysql/advisor_stmt_disallow_order_by.go
+++ b/backend/plugin/advisor/mysql/advisor_stmt_disallow_order_by.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go b/backend/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go
rename to backend/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go
index 2881ae9d8f..a8050213b2 100644
--- a/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go
+++ b/backend/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go
@@ -6,8 +6,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/format"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
const (
diff --git a/plugin/advisor/mysql/advisor_stmt_no_select_all.go b/backend/plugin/advisor/mysql/advisor_stmt_no_select_all.go
similarity index 94%
rename from plugin/advisor/mysql/advisor_stmt_no_select_all.go
rename to backend/plugin/advisor/mysql/advisor_stmt_no_select_all.go
index 65f9cf00df..67d5ca528c 100644
--- a/plugin/advisor/mysql/advisor_stmt_no_select_all.go
+++ b/backend/plugin/advisor/mysql/advisor_stmt_no_select_all.go
@@ -5,8 +5,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_stmt_where_required.go b/backend/plugin/advisor/mysql/advisor_stmt_where_required.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_stmt_where_required.go
rename to backend/plugin/advisor/mysql/advisor_stmt_where_required.go
index fb0039e155..947be23d5f 100644
--- a/plugin/advisor/mysql/advisor_stmt_where_required.go
+++ b/backend/plugin/advisor/mysql/advisor_stmt_where_required.go
@@ -3,8 +3,8 @@ package mysql
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
"github.com/pingcap/tidb/parser/ast"
)
diff --git a/plugin/advisor/mysql/advisor_syntax.go b/backend/plugin/advisor/mysql/advisor_syntax.go
similarity index 90%
rename from plugin/advisor/mysql/advisor_syntax.go
rename to backend/plugin/advisor/mysql/advisor_syntax.go
index f9b7860eb3..1a6d23d346 100644
--- a/plugin/advisor/mysql/advisor_syntax.go
+++ b/backend/plugin/advisor/mysql/advisor_syntax.go
@@ -1,9 +1,9 @@
package mysql
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
var (
diff --git a/plugin/advisor/mysql/advisor_table_comment_convention.go b/backend/plugin/advisor/mysql/advisor_table_comment_convention.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_table_comment_convention.go
rename to backend/plugin/advisor/mysql/advisor_table_comment_convention.go
index b8f2653b11..33d1cf95eb 100644
--- a/plugin/advisor/mysql/advisor_table_comment_convention.go
+++ b/backend/plugin/advisor/mysql/advisor_table_comment_convention.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_table_disallow_partition.go b/backend/plugin/advisor/mysql/advisor_table_disallow_partition.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_table_disallow_partition.go
rename to backend/plugin/advisor/mysql/advisor_table_disallow_partition.go
index 86b3aada3a..90cedceef5 100644
--- a/plugin/advisor/mysql/advisor_table_disallow_partition.go
+++ b/backend/plugin/advisor/mysql/advisor_table_disallow_partition.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_table_drop_naming_convention.go b/backend/plugin/advisor/mysql/advisor_table_drop_naming_convention.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_table_drop_naming_convention.go
rename to backend/plugin/advisor/mysql/advisor_table_drop_naming_convention.go
index e1d2187065..9f640aaa22 100644
--- a/plugin/advisor/mysql/advisor_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/mysql/advisor_table_drop_naming_convention.go
@@ -6,8 +6,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_table_no_fk.go b/backend/plugin/advisor/mysql/advisor_table_no_fk.go
similarity index 95%
rename from plugin/advisor/mysql/advisor_table_no_fk.go
rename to backend/plugin/advisor/mysql/advisor_table_no_fk.go
index 186c719582..3b492af0aa 100644
--- a/plugin/advisor/mysql/advisor_table_no_fk.go
+++ b/backend/plugin/advisor/mysql/advisor_table_no_fk.go
@@ -5,8 +5,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/mysql/advisor_table_require_pk.go b/backend/plugin/advisor/mysql/advisor_table_require_pk.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_table_require_pk.go
rename to backend/plugin/advisor/mysql/advisor_table_require_pk.go
index 8892197e26..31adc1117f 100644
--- a/plugin/advisor/mysql/advisor_table_require_pk.go
+++ b/backend/plugin/advisor/mysql/advisor_table_require_pk.go
@@ -6,9 +6,9 @@ import (
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
const (
diff --git a/plugin/advisor/mysql/advisor_use_innodb.go b/backend/plugin/advisor/mysql/advisor_use_innodb.go
similarity index 96%
rename from plugin/advisor/mysql/advisor_use_innodb.go
rename to backend/plugin/advisor/mysql/advisor_use_innodb.go
index f58dc1efa2..a4d3138ef2 100644
--- a/plugin/advisor/mysql/advisor_use_innodb.go
+++ b/backend/plugin/advisor/mysql/advisor_use_innodb.go
@@ -7,8 +7,8 @@ import (
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/format"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
const (
diff --git a/plugin/advisor/mysql/mysql_rules_test.go b/backend/plugin/advisor/mysql/mysql_rules_test.go
similarity index 98%
rename from plugin/advisor/mysql/mysql_rules_test.go
rename to backend/plugin/advisor/mysql/mysql_rules_test.go
index 7450f8cc1d..56c0dae770 100644
--- a/plugin/advisor/mysql/mysql_rules_test.go
+++ b/backend/plugin/advisor/mysql/mysql_rules_test.go
@@ -3,8 +3,8 @@ package mysql
import (
"testing"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
diff --git a/plugin/advisor/mysql/parser.go b/backend/plugin/advisor/mysql/parser.go
similarity index 94%
rename from plugin/advisor/mysql/parser.go
rename to backend/plugin/advisor/mysql/parser.go
index bec1d9e27e..5565269f29 100644
--- a/plugin/advisor/mysql/parser.go
+++ b/backend/plugin/advisor/mysql/parser.go
@@ -7,8 +7,8 @@ import (
tidbparser "github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// Wrapper for parser.New().
diff --git a/plugin/advisor/mysql/parser_test.go b/backend/plugin/advisor/mysql/parser_test.go
similarity index 100%
rename from plugin/advisor/mysql/parser_test.go
rename to backend/plugin/advisor/mysql/parser_test.go
diff --git a/plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml b/backend/plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml
rename to backend/plugin/advisor/mysql/test/column_auto_increment_initial_value.yaml
diff --git a/plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml b/backend/plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml
rename to backend/plugin/advisor/mysql/test/column_auto_increment_must_integer.yaml
diff --git a/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml b/backend/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml
rename to backend/plugin/advisor/mysql/test/column_auto_increment_must_unsigned.yaml
diff --git a/plugin/advisor/mysql/test/column_comment.yaml b/backend/plugin/advisor/mysql/test/column_comment.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_comment.yaml
rename to backend/plugin/advisor/mysql/test/column_comment.yaml
diff --git a/plugin/advisor/mysql/test/column_current_time_count_limit.yaml b/backend/plugin/advisor/mysql/test/column_current_time_count_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_current_time_count_limit.yaml
rename to backend/plugin/advisor/mysql/test/column_current_time_count_limit.yaml
diff --git a/plugin/advisor/mysql/test/column_disallow_change.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_disallow_change.yaml
rename to backend/plugin/advisor/mysql/test/column_disallow_change.yaml
diff --git a/plugin/advisor/mysql/test/column_disallow_change_type.yaml b/backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_disallow_change_type.yaml
rename to backend/plugin/advisor/mysql/test/column_disallow_change_type.yaml
diff --git a/plugin/advisor/mysql/test/column_disallow_changing_order.yaml b/backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_disallow_changing_order.yaml
rename to backend/plugin/advisor/mysql/test/column_disallow_changing_order.yaml
diff --git a/plugin/advisor/mysql/test/column_disallow_set_charset.yaml b/backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_disallow_set_charset.yaml
rename to backend/plugin/advisor/mysql/test/column_disallow_set_charset.yaml
diff --git a/plugin/advisor/mysql/test/column_maximum_character_length.yaml b/backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_maximum_character_length.yaml
rename to backend/plugin/advisor/mysql/test/column_maximum_character_length.yaml
diff --git a/plugin/advisor/mysql/test/column_no_null.yaml b/backend/plugin/advisor/mysql/test/column_no_null.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_no_null.yaml
rename to backend/plugin/advisor/mysql/test/column_no_null.yaml
diff --git a/plugin/advisor/mysql/test/column_require_default.yaml b/backend/plugin/advisor/mysql/test/column_require_default.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_require_default.yaml
rename to backend/plugin/advisor/mysql/test/column_require_default.yaml
diff --git a/plugin/advisor/mysql/test/column_required.yaml b/backend/plugin/advisor/mysql/test/column_required.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_required.yaml
rename to backend/plugin/advisor/mysql/test/column_required.yaml
diff --git a/plugin/advisor/mysql/test/column_set_default_for_not_null.yaml b/backend/plugin/advisor/mysql/test/column_set_default_for_not_null.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_set_default_for_not_null.yaml
rename to backend/plugin/advisor/mysql/test/column_set_default_for_not_null.yaml
diff --git a/plugin/advisor/mysql/test/column_type_disallow_list.yaml b/backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/column_type_disallow_list.yaml
rename to backend/plugin/advisor/mysql/test/column_type_disallow_list.yaml
diff --git a/plugin/advisor/mysql/test/database_drop_empty_database.yaml b/backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/database_drop_empty_database.yaml
rename to backend/plugin/advisor/mysql/test/database_drop_empty_database.yaml
diff --git a/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml b/backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml
rename to backend/plugin/advisor/mysql/test/engine_mysql_use_innodb.yaml
diff --git a/plugin/advisor/mysql/test/index_key_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_key_number_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/index_key_number_limit.yaml
rename to backend/plugin/advisor/mysql/test/index_key_number_limit.yaml
diff --git a/plugin/advisor/mysql/test/index_no_duplicate_column.yaml b/backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/index_no_duplicate_column.yaml
rename to backend/plugin/advisor/mysql/test/index_no_duplicate_column.yaml
diff --git a/plugin/advisor/mysql/test/index_pk_type_limit.yaml b/backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/index_pk_type_limit.yaml
rename to backend/plugin/advisor/mysql/test/index_pk_type_limit.yaml
diff --git a/plugin/advisor/mysql/test/index_total_number_limit.yaml b/backend/plugin/advisor/mysql/test/index_total_number_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/index_total_number_limit.yaml
rename to backend/plugin/advisor/mysql/test/index_total_number_limit.yaml
diff --git a/plugin/advisor/mysql/test/index_type_no_blob.yaml b/backend/plugin/advisor/mysql/test/index_type_no_blob.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/index_type_no_blob.yaml
rename to backend/plugin/advisor/mysql/test/index_type_no_blob.yaml
diff --git a/plugin/advisor/mysql/test/naming_column.yaml b/backend/plugin/advisor/mysql/test/naming_column.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/naming_column.yaml
rename to backend/plugin/advisor/mysql/test/naming_column.yaml
diff --git a/plugin/advisor/mysql/test/naming_column_auto_increment.yaml b/backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/naming_column_auto_increment.yaml
rename to backend/plugin/advisor/mysql/test/naming_column_auto_increment.yaml
diff --git a/plugin/advisor/mysql/test/naming_index_fk.yaml b/backend/plugin/advisor/mysql/test/naming_index_fk.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/naming_index_fk.yaml
rename to backend/plugin/advisor/mysql/test/naming_index_fk.yaml
diff --git a/plugin/advisor/mysql/test/naming_index_idx.yaml b/backend/plugin/advisor/mysql/test/naming_index_idx.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/naming_index_idx.yaml
rename to backend/plugin/advisor/mysql/test/naming_index_idx.yaml
diff --git a/plugin/advisor/mysql/test/naming_index_uk.yaml b/backend/plugin/advisor/mysql/test/naming_index_uk.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/naming_index_uk.yaml
rename to backend/plugin/advisor/mysql/test/naming_index_uk.yaml
diff --git a/plugin/advisor/mysql/test/naming_table.yaml b/backend/plugin/advisor/mysql/test/naming_table.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/naming_table.yaml
rename to backend/plugin/advisor/mysql/test/naming_table.yaml
diff --git a/plugin/advisor/mysql/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/schema_backward_compatibility.yaml
rename to backend/plugin/advisor/mysql/test/schema_backward_compatibility.yaml
diff --git a/plugin/advisor/mysql/test/statement_affected_row_limit.yaml b/backend/plugin/advisor/mysql/test/statement_affected_row_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_affected_row_limit.yaml
rename to backend/plugin/advisor/mysql/test/statement_affected_row_limit.yaml
diff --git a/plugin/advisor/mysql/test/statement_disallow_commit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_disallow_commit.yaml
rename to backend/plugin/advisor/mysql/test/statement_disallow_commit.yaml
diff --git a/plugin/advisor/mysql/test/statement_disallow_limit.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_disallow_limit.yaml
rename to backend/plugin/advisor/mysql/test/statement_disallow_limit.yaml
diff --git a/plugin/advisor/mysql/test/statement_disallow_order_by.yaml b/backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_disallow_order_by.yaml
rename to backend/plugin/advisor/mysql/test/statement_disallow_order_by.yaml
diff --git a/plugin/advisor/mysql/test/statement_dml_dry_run.yaml b/backend/plugin/advisor/mysql/test/statement_dml_dry_run.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_dml_dry_run.yaml
rename to backend/plugin/advisor/mysql/test/statement_dml_dry_run.yaml
diff --git a/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml b/backend/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml
rename to backend/plugin/advisor/mysql/test/statement_insert_disallow_order_by_rand.yaml
diff --git a/plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml b/backend/plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml
rename to backend/plugin/advisor/mysql/test/statement_insert_must_specify_column.yaml
diff --git a/plugin/advisor/mysql/test/statement_insert_row_limit.yaml b/backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_insert_row_limit.yaml
rename to backend/plugin/advisor/mysql/test/statement_insert_row_limit.yaml
diff --git a/plugin/advisor/mysql/test/statement_merge_alter_table.yaml b/backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_merge_alter_table.yaml
rename to backend/plugin/advisor/mysql/test/statement_merge_alter_table.yaml
diff --git a/plugin/advisor/mysql/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/mysql/test/statement_select_no_select_all.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_select_no_select_all.yaml
rename to backend/plugin/advisor/mysql/test/statement_select_no_select_all.yaml
diff --git a/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml b/backend/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml
rename to backend/plugin/advisor/mysql/test/statement_where_no_leading_wildcard_like.yaml
diff --git a/plugin/advisor/mysql/test/statement_where_require.yaml b/backend/plugin/advisor/mysql/test/statement_where_require.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/statement_where_require.yaml
rename to backend/plugin/advisor/mysql/test/statement_where_require.yaml
diff --git a/plugin/advisor/mysql/test/system_charset_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/system_charset_allowlist.yaml
rename to backend/plugin/advisor/mysql/test/system_charset_allowlist.yaml
diff --git a/plugin/advisor/mysql/test/system_collation_allowlist.yaml b/backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/system_collation_allowlist.yaml
rename to backend/plugin/advisor/mysql/test/system_collation_allowlist.yaml
diff --git a/plugin/advisor/mysql/test/table_comment.yaml b/backend/plugin/advisor/mysql/test/table_comment.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/table_comment.yaml
rename to backend/plugin/advisor/mysql/test/table_comment.yaml
diff --git a/plugin/advisor/mysql/test/table_disallow_partition.yaml b/backend/plugin/advisor/mysql/test/table_disallow_partition.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/table_disallow_partition.yaml
rename to backend/plugin/advisor/mysql/test/table_disallow_partition.yaml
diff --git a/plugin/advisor/mysql/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/table_drop_naming_convention.yaml
rename to backend/plugin/advisor/mysql/test/table_drop_naming_convention.yaml
diff --git a/plugin/advisor/mysql/test/table_no_foreign_key.yaml b/backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/table_no_foreign_key.yaml
rename to backend/plugin/advisor/mysql/test/table_no_foreign_key.yaml
diff --git a/plugin/advisor/mysql/test/table_require_pk.yaml b/backend/plugin/advisor/mysql/test/table_require_pk.yaml
similarity index 100%
rename from plugin/advisor/mysql/test/table_require_pk.yaml
rename to backend/plugin/advisor/mysql/test/table_require_pk.yaml
diff --git a/plugin/advisor/mysql/utils.go b/backend/plugin/advisor/mysql/utils.go
similarity index 100%
rename from plugin/advisor/mysql/utils.go
rename to backend/plugin/advisor/mysql/utils.go
diff --git a/plugin/advisor/pg/advisor_collation_allowlist.go b/backend/plugin/advisor/pg/advisor_collation_allowlist.go
similarity index 95%
rename from plugin/advisor/pg/advisor_collation_allowlist.go
rename to backend/plugin/advisor/pg/advisor_collation_allowlist.go
index 95c2e47c25..ae340433a9 100644
--- a/plugin/advisor/pg/advisor_collation_allowlist.go
+++ b/backend/plugin/advisor/pg/advisor_collation_allowlist.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_column_disallow_changing_type.go b/backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go
similarity index 92%
rename from plugin/advisor/pg/advisor_column_disallow_changing_type.go
rename to backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go
index 95a57e762e..1ba034fb32 100644
--- a/plugin/advisor/pg/advisor_column_disallow_changing_type.go
+++ b/backend/plugin/advisor/pg/advisor_column_disallow_changing_type.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_column_maximum_character_length.go b/backend/plugin/advisor/pg/advisor_column_maximum_character_length.go
similarity index 95%
rename from plugin/advisor/pg/advisor_column_maximum_character_length.go
rename to backend/plugin/advisor/pg/advisor_column_maximum_character_length.go
index 2287ad27e0..2bd7ca9526 100644
--- a/plugin/advisor/pg/advisor_column_maximum_character_length.go
+++ b/backend/plugin/advisor/pg/advisor_column_maximum_character_length.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_column_no_null.go b/backend/plugin/advisor/pg/advisor_column_no_null.go
similarity index 95%
rename from plugin/advisor/pg/advisor_column_no_null.go
rename to backend/plugin/advisor/pg/advisor_column_no_null.go
index fb86d9f964..69b90ac546 100644
--- a/plugin/advisor/pg/advisor_column_no_null.go
+++ b/backend/plugin/advisor/pg/advisor_column_no_null.go
@@ -4,10 +4,10 @@ import (
"fmt"
"sort"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_column_require_default.go b/backend/plugin/advisor/pg/advisor_column_require_default.go
similarity index 93%
rename from plugin/advisor/pg/advisor_column_require_default.go
rename to backend/plugin/advisor/pg/advisor_column_require_default.go
index 902c4c3e09..b8e231c5d1 100644
--- a/plugin/advisor/pg/advisor_column_require_default.go
+++ b/backend/plugin/advisor/pg/advisor_column_require_default.go
@@ -6,10 +6,10 @@ import (
"fmt"
"sort"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_column_required.go b/backend/plugin/advisor/pg/advisor_column_required.go
similarity index 94%
rename from plugin/advisor/pg/advisor_column_required.go
rename to backend/plugin/advisor/pg/advisor_column_required.go
index 7734d42094..1e2a0c7100 100644
--- a/plugin/advisor/pg/advisor_column_required.go
+++ b/backend/plugin/advisor/pg/advisor_column_required.go
@@ -5,9 +5,9 @@ import (
"sort"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_column_type_disallow_list.go b/backend/plugin/advisor/pg/advisor_column_type_disallow_list.go
similarity index 95%
rename from plugin/advisor/pg/advisor_column_type_disallow_list.go
rename to backend/plugin/advisor/pg/advisor_column_type_disallow_list.go
index 95b6863b61..ca02fedfff 100644
--- a/plugin/advisor/pg/advisor_column_type_disallow_list.go
+++ b/backend/plugin/advisor/pg/advisor_column_type_disallow_list.go
@@ -4,9 +4,9 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
func init() {
diff --git a/plugin/advisor/pg/advisor_comment_convention.go b/backend/plugin/advisor/pg/advisor_comment_convention.go
similarity index 92%
rename from plugin/advisor/pg/advisor_comment_convention.go
rename to backend/plugin/advisor/pg/advisor_comment_convention.go
index 085d4a9809..69c6001fc0 100644
--- a/plugin/advisor/pg/advisor_comment_convention.go
+++ b/backend/plugin/advisor/pg/advisor_comment_convention.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_encoding_allowlist.go b/backend/plugin/advisor/pg/advisor_encoding_allowlist.go
similarity index 93%
rename from plugin/advisor/pg/advisor_encoding_allowlist.go
rename to backend/plugin/advisor/pg/advisor_encoding_allowlist.go
index 457a4224a2..6a7d44e9c0 100644
--- a/plugin/advisor/pg/advisor_encoding_allowlist.go
+++ b/backend/plugin/advisor/pg/advisor_encoding_allowlist.go
@@ -4,9 +4,9 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_index_create_concurrently.go b/backend/plugin/advisor/pg/advisor_index_create_concurrently.go
similarity index 91%
rename from plugin/advisor/pg/advisor_index_create_concurrently.go
rename to backend/plugin/advisor/pg/advisor_index_create_concurrently.go
index 3af37cb8d5..c98444c3fa 100644
--- a/plugin/advisor/pg/advisor_index_create_concurrently.go
+++ b/backend/plugin/advisor/pg/advisor_index_create_concurrently.go
@@ -3,9 +3,9 @@ package pg
// Framework code is generated by the generator.
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_index_key_number_limit.go b/backend/plugin/advisor/pg/advisor_index_key_number_limit.go
similarity index 94%
rename from plugin/advisor/pg/advisor_index_key_number_limit.go
rename to backend/plugin/advisor/pg/advisor_index_key_number_limit.go
index 1d880d4de2..48bc908613 100644
--- a/plugin/advisor/pg/advisor_index_key_number_limit.go
+++ b/backend/plugin/advisor/pg/advisor_index_key_number_limit.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_index_no_duplicate_column.go b/backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go
similarity index 96%
rename from plugin/advisor/pg/advisor_index_no_duplicate_column.go
rename to backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go
index 3f7079b05e..a291467ca9 100644
--- a/plugin/advisor/pg/advisor_index_no_duplicate_column.go
+++ b/backend/plugin/advisor/pg/advisor_index_no_duplicate_column.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
func init() {
diff --git a/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go b/backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
similarity index 92%
rename from plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
rename to backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
index 1722dc10d7..c56a1ad8d9 100644
--- a/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
+++ b/backend/plugin/advisor/pg/advisor_index_primary_key_type_allowlist.go
@@ -7,11 +7,11 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_index_total_number_limit.go b/backend/plugin/advisor/pg/advisor_index_total_number_limit.go
similarity index 94%
rename from plugin/advisor/pg/advisor_index_total_number_limit.go
rename to backend/plugin/advisor/pg/advisor_index_total_number_limit.go
index b1ed38bdc0..c3691e2cfd 100644
--- a/plugin/advisor/pg/advisor_index_total_number_limit.go
+++ b/backend/plugin/advisor/pg/advisor_index_total_number_limit.go
@@ -6,10 +6,10 @@ import (
"fmt"
"sort"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go b/backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
similarity index 93%
rename from plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
rename to backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
index d7958a3795..b0b7dc92d9 100644
--- a/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
+++ b/backend/plugin/advisor/pg/advisor_insert_disallow_order_by_rand.go
@@ -6,9 +6,9 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_insert_must_specify_column.go b/backend/plugin/advisor/pg/advisor_insert_must_specify_column.go
similarity index 91%
rename from plugin/advisor/pg/advisor_insert_must_specify_column.go
rename to backend/plugin/advisor/pg/advisor_insert_must_specify_column.go
index 0fb47cdd4a..a18ef0f36c 100644
--- a/plugin/advisor/pg/advisor_insert_must_specify_column.go
+++ b/backend/plugin/advisor/pg/advisor_insert_must_specify_column.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_insert_row_limit.go b/backend/plugin/advisor/pg/advisor_insert_row_limit.go
similarity index 96%
rename from plugin/advisor/pg/advisor_insert_row_limit.go
rename to backend/plugin/advisor/pg/advisor_insert_row_limit.go
index fd9bed621a..cb460381ad 100644
--- a/plugin/advisor/pg/advisor_insert_row_limit.go
+++ b/backend/plugin/advisor/pg/advisor_insert_row_limit.go
@@ -9,9 +9,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_migration_compatibility.go b/backend/plugin/advisor/pg/advisor_migration_compatibility.go
similarity index 95%
rename from plugin/advisor/pg/advisor_migration_compatibility.go
rename to backend/plugin/advisor/pg/advisor_migration_compatibility.go
index bafa3bf975..c1fa419564 100644
--- a/plugin/advisor/pg/advisor_migration_compatibility.go
+++ b/backend/plugin/advisor/pg/advisor_migration_compatibility.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_naming_column.go b/backend/plugin/advisor/pg/advisor_naming_column.go
similarity index 95%
rename from plugin/advisor/pg/advisor_naming_column.go
rename to backend/plugin/advisor/pg/advisor_naming_column.go
index b9e1c3a0d5..0d70e683ff 100644
--- a/plugin/advisor/pg/advisor_naming_column.go
+++ b/backend/plugin/advisor/pg/advisor_naming_column.go
@@ -4,9 +4,9 @@ import (
"fmt"
"regexp"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_naming_foreign_key_convention.go b/backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
similarity index 97%
rename from plugin/advisor/pg/advisor_naming_foreign_key_convention.go
rename to backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
index 3c52af9d2a..0aa0a28976 100644
--- a/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_foreign_key_convention.go
@@ -5,9 +5,9 @@ import (
"regexp"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_naming_index_convention.go b/backend/plugin/advisor/pg/advisor_naming_index_convention.go
similarity index 94%
rename from plugin/advisor/pg/advisor_naming_index_convention.go
rename to backend/plugin/advisor/pg/advisor_naming_index_convention.go
index 607e64c169..695a050469 100644
--- a/plugin/advisor/pg/advisor_naming_index_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_index_convention.go
@@ -4,10 +4,10 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_naming_primary_key_convention.go b/backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go
similarity index 96%
rename from plugin/advisor/pg/advisor_naming_primary_key_convention.go
rename to backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go
index e0180e332a..1e4da51066 100644
--- a/plugin/advisor/pg/advisor_naming_primary_key_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_primary_key_convention.go
@@ -4,10 +4,10 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_naming_table.go b/backend/plugin/advisor/pg/advisor_naming_table.go
similarity index 94%
rename from plugin/advisor/pg/advisor_naming_table.go
rename to backend/plugin/advisor/pg/advisor_naming_table.go
index ae97267df3..0cdfb89d64 100644
--- a/plugin/advisor/pg/advisor_naming_table.go
+++ b/backend/plugin/advisor/pg/advisor_naming_table.go
@@ -4,9 +4,9 @@ import (
"fmt"
"regexp"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_naming_unique_key_convention.go b/backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go
similarity index 96%
rename from plugin/advisor/pg/advisor_naming_unique_key_convention.go
rename to backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go
index c6a5daf538..a1e12572bc 100644
--- a/plugin/advisor/pg/advisor_naming_unique_key_convention.go
+++ b/backend/plugin/advisor/pg/advisor_naming_unique_key_convention.go
@@ -4,10 +4,10 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_add_check_not_valid.go b/backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
similarity index 92%
rename from plugin/advisor/pg/advisor_statement_add_check_not_valid.go
rename to backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
index 4438a3fd78..7185bfdb6e 100644
--- a/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
+++ b/backend/plugin/advisor/pg/advisor_statement_add_check_not_valid.go
@@ -3,9 +3,9 @@ package pg
// Framework code is generated by the generator.
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_affected_row_limit.go b/backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go
similarity index 95%
rename from plugin/advisor/pg/advisor_statement_affected_row_limit.go
rename to backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go
index cd8e4b35b8..ef052bf433 100644
--- a/plugin/advisor/pg/advisor_statement_affected_row_limit.go
+++ b/backend/plugin/advisor/pg/advisor_statement_affected_row_limit.go
@@ -7,9 +7,9 @@ import (
"database/sql"
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go b/backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
similarity index 93%
rename from plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
rename to backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
index b51b18cbd8..78e739c3d2 100644
--- a/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_add_column_with_default.go
@@ -3,9 +3,9 @@ package pg
// Framework code is generated by the generator.
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go b/backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
similarity index 91%
rename from plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
rename to backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
index ec78af9fd6..5c254fcb5f 100644
--- a/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_add_not_null.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_disallow_commit.go b/backend/plugin/advisor/pg/advisor_statement_disallow_commit.go
similarity index 91%
rename from plugin/advisor/pg/advisor_statement_disallow_commit.go
rename to backend/plugin/advisor/pg/advisor_statement_disallow_commit.go
index f438e8357c..c3aec35e11 100644
--- a/plugin/advisor/pg/advisor_statement_disallow_commit.go
+++ b/backend/plugin/advisor/pg/advisor_statement_disallow_commit.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_dml_dry_run.go b/backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go
similarity index 92%
rename from plugin/advisor/pg/advisor_statement_dml_dry_run.go
rename to backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go
index d167c46524..3fdf5d702b 100644
--- a/plugin/advisor/pg/advisor_statement_dml_dry_run.go
+++ b/backend/plugin/advisor/pg/advisor_statement_dml_dry_run.go
@@ -7,9 +7,9 @@ import (
"database/sql"
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_statement_merge_alter_table.go b/backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go
similarity index 94%
rename from plugin/advisor/pg/advisor_statement_merge_alter_table.go
rename to backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go
index 0ee5536b52..37c0a47ff4 100644
--- a/plugin/advisor/pg/advisor_statement_merge_alter_table.go
+++ b/backend/plugin/advisor/pg/advisor_statement_merge_alter_table.go
@@ -6,9 +6,9 @@ import (
"fmt"
"sort"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go b/backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
similarity index 92%
rename from plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
rename to backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
index 257be56b28..4684cb688e 100644
--- a/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_no_leading_wildcard_like.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
const (
diff --git a/plugin/advisor/pg/advisor_stmt_no_select_all.go b/backend/plugin/advisor/pg/advisor_stmt_no_select_all.go
similarity index 91%
rename from plugin/advisor/pg/advisor_stmt_no_select_all.go
rename to backend/plugin/advisor/pg/advisor_stmt_no_select_all.go
index fddc6f3d87..8bc7dcafd6 100644
--- a/plugin/advisor/pg/advisor_stmt_no_select_all.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_no_select_all.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_stmt_where_required.go b/backend/plugin/advisor/pg/advisor_stmt_where_required.go
similarity index 92%
rename from plugin/advisor/pg/advisor_stmt_where_required.go
rename to backend/plugin/advisor/pg/advisor_stmt_where_required.go
index ff3bafb223..4b522d4080 100644
--- a/plugin/advisor/pg/advisor_stmt_where_required.go
+++ b/backend/plugin/advisor/pg/advisor_stmt_where_required.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_syntax.go b/backend/plugin/advisor/pg/advisor_syntax.go
similarity index 90%
rename from plugin/advisor/pg/advisor_syntax.go
rename to backend/plugin/advisor/pg/advisor_syntax.go
index 40f20d691d..3d3525245d 100644
--- a/plugin/advisor/pg/advisor_syntax.go
+++ b/backend/plugin/advisor/pg/advisor_syntax.go
@@ -1,8 +1,8 @@
package pg
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
var (
diff --git a/plugin/advisor/pg/advisor_syntax_test.go b/backend/plugin/advisor/pg/advisor_syntax_test.go
similarity index 87%
rename from plugin/advisor/pg/advisor_syntax_test.go
rename to backend/plugin/advisor/pg/advisor_syntax_test.go
index 582d1bf690..a4b75e52e7 100644
--- a/plugin/advisor/pg/advisor_syntax_test.go
+++ b/backend/plugin/advisor/pg/advisor_syntax_test.go
@@ -6,9 +6,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
)
func TestPostgreSQLSyntax(t *testing.T) {
diff --git a/plugin/advisor/pg/advisor_table_disallow_partition.go b/backend/plugin/advisor/pg/advisor_table_disallow_partition.go
similarity index 92%
rename from plugin/advisor/pg/advisor_table_disallow_partition.go
rename to backend/plugin/advisor/pg/advisor_table_disallow_partition.go
index d85875af32..b558dbc876 100644
--- a/plugin/advisor/pg/advisor_table_disallow_partition.go
+++ b/backend/plugin/advisor/pg/advisor_table_disallow_partition.go
@@ -5,9 +5,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_table_drop_naming_convention.go b/backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go
similarity index 92%
rename from plugin/advisor/pg/advisor_table_drop_naming_convention.go
rename to backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go
index 29ae683d86..f98566dcde 100644
--- a/plugin/advisor/pg/advisor_table_drop_naming_convention.go
+++ b/backend/plugin/advisor/pg/advisor_table_drop_naming_convention.go
@@ -6,9 +6,9 @@ import (
"fmt"
"regexp"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_table_no_fk.go b/backend/plugin/advisor/pg/advisor_table_no_fk.go
similarity index 93%
rename from plugin/advisor/pg/advisor_table_no_fk.go
rename to backend/plugin/advisor/pg/advisor_table_no_fk.go
index f4cae104b0..13d6004d9a 100644
--- a/plugin/advisor/pg/advisor_table_no_fk.go
+++ b/backend/plugin/advisor/pg/advisor_table_no_fk.go
@@ -3,9 +3,9 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/advisor_table_require_pk.go b/backend/plugin/advisor/pg/advisor_table_require_pk.go
similarity index 92%
rename from plugin/advisor/pg/advisor_table_require_pk.go
rename to backend/plugin/advisor/pg/advisor_table_require_pk.go
index d63c8d4b08..ab63a142ae 100644
--- a/plugin/advisor/pg/advisor_table_require_pk.go
+++ b/backend/plugin/advisor/pg/advisor_table_require_pk.go
@@ -3,10 +3,10 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/advisor/pg/parser.go b/backend/plugin/advisor/pg/parser.go
similarity index 81%
rename from plugin/advisor/pg/parser.go
rename to backend/plugin/advisor/pg/parser.go
index 18ef09139d..28308ad2e6 100644
--- a/plugin/advisor/pg/parser.go
+++ b/backend/plugin/advisor/pg/parser.go
@@ -1,9 +1,9 @@
package pg
import (
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
func parseStatement(statement string) ([]ast.Node, []advisor.Advice) {
diff --git a/plugin/advisor/pg/pg_rules_test.go b/backend/plugin/advisor/pg/pg_rules_test.go
similarity index 94%
rename from plugin/advisor/pg/pg_rules_test.go
rename to backend/plugin/advisor/pg/pg_rules_test.go
index a78eeff803..8f2d2939bd 100644
--- a/plugin/advisor/pg/pg_rules_test.go
+++ b/backend/plugin/advisor/pg/pg_rules_test.go
@@ -3,8 +3,8 @@ package pg
import (
"testing"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
func TestPostgreSQLRules(t *testing.T) {
diff --git a/plugin/advisor/pg/test/column_disallow_change_type.yaml b/backend/plugin/advisor/pg/test/column_disallow_change_type.yaml
similarity index 100%
rename from plugin/advisor/pg/test/column_disallow_change_type.yaml
rename to backend/plugin/advisor/pg/test/column_disallow_change_type.yaml
diff --git a/plugin/advisor/pg/test/column_maximum_character_length.yaml b/backend/plugin/advisor/pg/test/column_maximum_character_length.yaml
similarity index 100%
rename from plugin/advisor/pg/test/column_maximum_character_length.yaml
rename to backend/plugin/advisor/pg/test/column_maximum_character_length.yaml
diff --git a/plugin/advisor/pg/test/column_no_null.yaml b/backend/plugin/advisor/pg/test/column_no_null.yaml
similarity index 100%
rename from plugin/advisor/pg/test/column_no_null.yaml
rename to backend/plugin/advisor/pg/test/column_no_null.yaml
diff --git a/plugin/advisor/pg/test/column_require_default.yaml b/backend/plugin/advisor/pg/test/column_require_default.yaml
similarity index 100%
rename from plugin/advisor/pg/test/column_require_default.yaml
rename to backend/plugin/advisor/pg/test/column_require_default.yaml
diff --git a/plugin/advisor/pg/test/column_required.yaml b/backend/plugin/advisor/pg/test/column_required.yaml
similarity index 100%
rename from plugin/advisor/pg/test/column_required.yaml
rename to backend/plugin/advisor/pg/test/column_required.yaml
diff --git a/plugin/advisor/pg/test/column_type_disallow_list.yaml b/backend/plugin/advisor/pg/test/column_type_disallow_list.yaml
similarity index 100%
rename from plugin/advisor/pg/test/column_type_disallow_list.yaml
rename to backend/plugin/advisor/pg/test/column_type_disallow_list.yaml
diff --git a/plugin/advisor/pg/test/comment_length.yaml b/backend/plugin/advisor/pg/test/comment_length.yaml
similarity index 100%
rename from plugin/advisor/pg/test/comment_length.yaml
rename to backend/plugin/advisor/pg/test/comment_length.yaml
diff --git a/plugin/advisor/pg/test/index_create_concurrently.yaml b/backend/plugin/advisor/pg/test/index_create_concurrently.yaml
similarity index 100%
rename from plugin/advisor/pg/test/index_create_concurrently.yaml
rename to backend/plugin/advisor/pg/test/index_create_concurrently.yaml
diff --git a/plugin/advisor/pg/test/index_key_number_limit.yaml b/backend/plugin/advisor/pg/test/index_key_number_limit.yaml
similarity index 100%
rename from plugin/advisor/pg/test/index_key_number_limit.yaml
rename to backend/plugin/advisor/pg/test/index_key_number_limit.yaml
diff --git a/plugin/advisor/pg/test/index_no_duplicate_column.yaml b/backend/plugin/advisor/pg/test/index_no_duplicate_column.yaml
similarity index 100%
rename from plugin/advisor/pg/test/index_no_duplicate_column.yaml
rename to backend/plugin/advisor/pg/test/index_no_duplicate_column.yaml
diff --git a/plugin/advisor/pg/test/index_primary_key_type_allowlist.yaml b/backend/plugin/advisor/pg/test/index_primary_key_type_allowlist.yaml
similarity index 100%
rename from plugin/advisor/pg/test/index_primary_key_type_allowlist.yaml
rename to backend/plugin/advisor/pg/test/index_primary_key_type_allowlist.yaml
diff --git a/plugin/advisor/pg/test/index_total_number_limit.yaml b/backend/plugin/advisor/pg/test/index_total_number_limit.yaml
similarity index 100%
rename from plugin/advisor/pg/test/index_total_number_limit.yaml
rename to backend/plugin/advisor/pg/test/index_total_number_limit.yaml
diff --git a/plugin/advisor/pg/test/naming_column.yaml b/backend/plugin/advisor/pg/test/naming_column.yaml
similarity index 100%
rename from plugin/advisor/pg/test/naming_column.yaml
rename to backend/plugin/advisor/pg/test/naming_column.yaml
diff --git a/plugin/advisor/pg/test/naming_index_fk.yaml b/backend/plugin/advisor/pg/test/naming_index_fk.yaml
similarity index 100%
rename from plugin/advisor/pg/test/naming_index_fk.yaml
rename to backend/plugin/advisor/pg/test/naming_index_fk.yaml
diff --git a/plugin/advisor/pg/test/naming_index_idx.yaml b/backend/plugin/advisor/pg/test/naming_index_idx.yaml
similarity index 100%
rename from plugin/advisor/pg/test/naming_index_idx.yaml
rename to backend/plugin/advisor/pg/test/naming_index_idx.yaml
diff --git a/plugin/advisor/pg/test/naming_index_pk.yaml b/backend/plugin/advisor/pg/test/naming_index_pk.yaml
similarity index 100%
rename from plugin/advisor/pg/test/naming_index_pk.yaml
rename to backend/plugin/advisor/pg/test/naming_index_pk.yaml
diff --git a/plugin/advisor/pg/test/naming_index_uk.yaml b/backend/plugin/advisor/pg/test/naming_index_uk.yaml
similarity index 100%
rename from plugin/advisor/pg/test/naming_index_uk.yaml
rename to backend/plugin/advisor/pg/test/naming_index_uk.yaml
diff --git a/plugin/advisor/pg/test/naming_table.yaml b/backend/plugin/advisor/pg/test/naming_table.yaml
similarity index 100%
rename from plugin/advisor/pg/test/naming_table.yaml
rename to backend/plugin/advisor/pg/test/naming_table.yaml
diff --git a/plugin/advisor/pg/test/schema_backward_compatibility.yaml b/backend/plugin/advisor/pg/test/schema_backward_compatibility.yaml
similarity index 100%
rename from plugin/advisor/pg/test/schema_backward_compatibility.yaml
rename to backend/plugin/advisor/pg/test/schema_backward_compatibility.yaml
diff --git a/plugin/advisor/pg/test/statement_add_check_not_valid.yaml b/backend/plugin/advisor/pg/test/statement_add_check_not_valid.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_add_check_not_valid.yaml
rename to backend/plugin/advisor/pg/test/statement_add_check_not_valid.yaml
diff --git a/plugin/advisor/pg/test/statement_affected_row_limit.yaml b/backend/plugin/advisor/pg/test/statement_affected_row_limit.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_affected_row_limit.yaml
rename to backend/plugin/advisor/pg/test/statement_affected_row_limit.yaml
diff --git a/plugin/advisor/pg/test/statement_disallow_add_column_with_default.yaml b/backend/plugin/advisor/pg/test/statement_disallow_add_column_with_default.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_disallow_add_column_with_default.yaml
rename to backend/plugin/advisor/pg/test/statement_disallow_add_column_with_default.yaml
diff --git a/plugin/advisor/pg/test/statement_disallow_add_not_null.yaml b/backend/plugin/advisor/pg/test/statement_disallow_add_not_null.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_disallow_add_not_null.yaml
rename to backend/plugin/advisor/pg/test/statement_disallow_add_not_null.yaml
diff --git a/plugin/advisor/pg/test/statement_disallow_commit.yaml b/backend/plugin/advisor/pg/test/statement_disallow_commit.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_disallow_commit.yaml
rename to backend/plugin/advisor/pg/test/statement_disallow_commit.yaml
diff --git a/plugin/advisor/pg/test/statement_dml_dry_run.yaml b/backend/plugin/advisor/pg/test/statement_dml_dry_run.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_dml_dry_run.yaml
rename to backend/plugin/advisor/pg/test/statement_dml_dry_run.yaml
diff --git a/plugin/advisor/pg/test/statement_insert_disallow_order_by_rand.yaml b/backend/plugin/advisor/pg/test/statement_insert_disallow_order_by_rand.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_insert_disallow_order_by_rand.yaml
rename to backend/plugin/advisor/pg/test/statement_insert_disallow_order_by_rand.yaml
diff --git a/plugin/advisor/pg/test/statement_insert_must_specify_column.yaml b/backend/plugin/advisor/pg/test/statement_insert_must_specify_column.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_insert_must_specify_column.yaml
rename to backend/plugin/advisor/pg/test/statement_insert_must_specify_column.yaml
diff --git a/plugin/advisor/pg/test/statement_insert_row_limit.yaml b/backend/plugin/advisor/pg/test/statement_insert_row_limit.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_insert_row_limit.yaml
rename to backend/plugin/advisor/pg/test/statement_insert_row_limit.yaml
diff --git a/plugin/advisor/pg/test/statement_merge_alter_table.yaml b/backend/plugin/advisor/pg/test/statement_merge_alter_table.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_merge_alter_table.yaml
rename to backend/plugin/advisor/pg/test/statement_merge_alter_table.yaml
diff --git a/plugin/advisor/pg/test/statement_select_no_select_all.yaml b/backend/plugin/advisor/pg/test/statement_select_no_select_all.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_select_no_select_all.yaml
rename to backend/plugin/advisor/pg/test/statement_select_no_select_all.yaml
diff --git a/plugin/advisor/pg/test/statement_where_no_leading_wildcard_like.yaml b/backend/plugin/advisor/pg/test/statement_where_no_leading_wildcard_like.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_where_no_leading_wildcard_like.yaml
rename to backend/plugin/advisor/pg/test/statement_where_no_leading_wildcard_like.yaml
diff --git a/plugin/advisor/pg/test/statement_where_require.yaml b/backend/plugin/advisor/pg/test/statement_where_require.yaml
similarity index 100%
rename from plugin/advisor/pg/test/statement_where_require.yaml
rename to backend/plugin/advisor/pg/test/statement_where_require.yaml
diff --git a/plugin/advisor/pg/test/system_charset_allowlist.yaml b/backend/plugin/advisor/pg/test/system_charset_allowlist.yaml
similarity index 100%
rename from plugin/advisor/pg/test/system_charset_allowlist.yaml
rename to backend/plugin/advisor/pg/test/system_charset_allowlist.yaml
diff --git a/plugin/advisor/pg/test/system_collation_allowlist.yaml b/backend/plugin/advisor/pg/test/system_collation_allowlist.yaml
similarity index 100%
rename from plugin/advisor/pg/test/system_collation_allowlist.yaml
rename to backend/plugin/advisor/pg/test/system_collation_allowlist.yaml
diff --git a/plugin/advisor/pg/test/table_disallow_partition.yaml b/backend/plugin/advisor/pg/test/table_disallow_partition.yaml
similarity index 100%
rename from plugin/advisor/pg/test/table_disallow_partition.yaml
rename to backend/plugin/advisor/pg/test/table_disallow_partition.yaml
diff --git a/plugin/advisor/pg/test/table_drop_naming_convention.yaml b/backend/plugin/advisor/pg/test/table_drop_naming_convention.yaml
similarity index 100%
rename from plugin/advisor/pg/test/table_drop_naming_convention.yaml
rename to backend/plugin/advisor/pg/test/table_drop_naming_convention.yaml
diff --git a/plugin/advisor/pg/test/table_no_foreign_key.yaml b/backend/plugin/advisor/pg/test/table_no_foreign_key.yaml
similarity index 100%
rename from plugin/advisor/pg/test/table_no_foreign_key.yaml
rename to backend/plugin/advisor/pg/test/table_no_foreign_key.yaml
diff --git a/plugin/advisor/pg/test/table_require_pk.yaml b/backend/plugin/advisor/pg/test/table_require_pk.yaml
similarity index 100%
rename from plugin/advisor/pg/test/table_require_pk.yaml
rename to backend/plugin/advisor/pg/test/table_require_pk.yaml
diff --git a/plugin/advisor/pg/utils.go b/backend/plugin/advisor/pg/utils.go
similarity index 93%
rename from plugin/advisor/pg/utils.go
rename to backend/plugin/advisor/pg/utils.go
index 7514c04d4b..e4ae1e56af 100644
--- a/plugin/advisor/pg/utils.go
+++ b/backend/plugin/advisor/pg/utils.go
@@ -4,7 +4,7 @@ package pg
import (
"fmt"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
const (
diff --git a/plugin/advisor/sql_review.go b/backend/plugin/advisor/sql_review.go
similarity index 99%
rename from plugin/advisor/sql_review.go
rename to backend/plugin/advisor/sql_review.go
index 84d13b09a8..7c597f69b0 100644
--- a/plugin/advisor/sql_review.go
+++ b/backend/plugin/advisor/sql_review.go
@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
)
// How to add a SQL review rule:
diff --git a/plugin/advisor/utils.go b/backend/plugin/advisor/utils.go
similarity index 100%
rename from plugin/advisor/utils.go
rename to backend/plugin/advisor/utils.go
diff --git a/plugin/advisor/utils_for_tests.go b/backend/plugin/advisor/utils_for_tests.go
similarity index 98%
rename from plugin/advisor/utils_for_tests.go
rename to backend/plugin/advisor/utils_for_tests.go
index f9d97e2dfc..d0552a9d91 100644
--- a/plugin/advisor/utils_for_tests.go
+++ b/backend/plugin/advisor/utils_for_tests.go
@@ -16,9 +16,9 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- "github.com/bytebase/bytebase/plugin/advisor/db"
- database "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ database "github.com/bytebase/bytebase/backend/plugin/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/app/feishu/feishu.go b/backend/plugin/app/feishu/feishu.go
similarity index 99%
rename from plugin/app/feishu/feishu.go
rename to backend/plugin/app/feishu/feishu.go
index 8ba5ebecbf..98c2d11bf2 100644
--- a/plugin/app/feishu/feishu.go
+++ b/backend/plugin/app/feishu/feishu.go
@@ -15,7 +15,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
// Response code definition in feishu response body.
diff --git a/plugin/app/feishu/feishu_test.go b/backend/plugin/app/feishu/feishu_test.go
similarity index 99%
rename from plugin/app/feishu/feishu_test.go
rename to backend/plugin/app/feishu/feishu_test.go
index eb1037adc7..c6dbbc1cb2 100644
--- a/plugin/app/feishu/feishu_test.go
+++ b/backend/plugin/app/feishu/feishu_test.go
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
func TestProvider_CreateApprovalDefinition(t *testing.T) {
diff --git a/plugin/db/clickhouse/clickhouse.go b/backend/plugin/db/clickhouse/clickhouse.go
similarity index 95%
rename from plugin/db/clickhouse/clickhouse.go
rename to backend/plugin/db/clickhouse/clickhouse.go
index 38bb1fd980..a455c660fe 100644
--- a/plugin/db/clickhouse/clickhouse.go
+++ b/backend/plugin/db/clickhouse/clickhouse.go
@@ -12,10 +12,10 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/clickhouse/clickhouse_migration_schema.sql b/backend/plugin/db/clickhouse/clickhouse_migration_schema.sql
similarity index 100%
rename from plugin/db/clickhouse/clickhouse_migration_schema.sql
rename to backend/plugin/db/clickhouse/clickhouse_migration_schema.sql
diff --git a/plugin/db/clickhouse/dump.go b/backend/plugin/db/clickhouse/dump.go
similarity index 98%
rename from plugin/db/clickhouse/dump.go
rename to backend/plugin/db/clickhouse/dump.go
index d3c7459615..56b9a51232 100644
--- a/plugin/db/clickhouse/dump.go
+++ b/backend/plugin/db/clickhouse/dump.go
@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
// Dump and restore.
diff --git a/plugin/db/clickhouse/migrate.go b/backend/plugin/db/clickhouse/migrate.go
similarity index 97%
rename from plugin/db/clickhouse/migrate.go
rename to backend/plugin/db/clickhouse/migrate.go
index dc81bba32d..d8ea1bf3f9 100644
--- a/plugin/db/clickhouse/migrate.go
+++ b/backend/plugin/db/clickhouse/migrate.go
@@ -11,10 +11,10 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/clickhouse/role.go b/backend/plugin/db/clickhouse/role.go
similarity index 96%
rename from plugin/db/clickhouse/role.go
rename to backend/plugin/db/clickhouse/role.go
index 9f118ad838..06ac8dfb34 100644
--- a/plugin/db/clickhouse/role.go
+++ b/backend/plugin/db/clickhouse/role.go
@@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/clickhouse/sync.go b/backend/plugin/db/clickhouse/sync.go
similarity index 97%
rename from plugin/db/clickhouse/sync.go
rename to backend/plugin/db/clickhouse/sync.go
index 1ffc3df82a..1851c6804c 100644
--- a/plugin/db/clickhouse/sync.go
+++ b/backend/plugin/db/clickhouse/sync.go
@@ -9,8 +9,8 @@ import (
"google.golang.org/protobuf/types/known/wrapperspb"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/driver.go b/backend/plugin/db/driver.go
similarity index 99%
rename from plugin/db/driver.go
rename to backend/plugin/db/driver.go
index f031428fa4..238f8a2f5e 100644
--- a/plugin/db/driver.go
+++ b/backend/plugin/db/driver.go
@@ -13,7 +13,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/driver_test.go b/backend/plugin/db/driver_test.go
similarity index 100%
rename from plugin/db/driver_test.go
rename to backend/plugin/db/driver_test.go
diff --git a/plugin/db/mongodb/collmod_migrationHistory_collection_command.json b/backend/plugin/db/mongodb/collmod_migrationHistory_collection_command.json
similarity index 100%
rename from plugin/db/mongodb/collmod_migrationHistory_collection_command.json
rename to backend/plugin/db/mongodb/collmod_migrationHistory_collection_command.json
diff --git a/plugin/db/mongodb/create_index_on_migrationHistory_collection_command.json b/backend/plugin/db/mongodb/create_index_on_migrationHistory_collection_command.json
similarity index 100%
rename from plugin/db/mongodb/create_index_on_migrationHistory_collection_command.json
rename to backend/plugin/db/mongodb/create_index_on_migrationHistory_collection_command.json
diff --git a/plugin/db/mongodb/migrate.go b/backend/plugin/db/mongodb/migrate.go
similarity index 99%
rename from plugin/db/mongodb/migrate.go
rename to backend/plugin/db/mongodb/migrate.go
index 45853f807a..8ebdcff973 100644
--- a/plugin/db/mongodb/migrate.go
+++ b/backend/plugin/db/mongodb/migrate.go
@@ -18,9 +18,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
const (
diff --git a/plugin/db/mongodb/mongodb.go b/backend/plugin/db/mongodb/mongodb.go
similarity index 98%
rename from plugin/db/mongodb/mongodb.go
rename to backend/plugin/db/mongodb/mongodb.go
index 4d30d5bb19..ac123ed0eb 100644
--- a/plugin/db/mongodb/mongodb.go
+++ b/backend/plugin/db/mongodb/mongodb.go
@@ -16,8 +16,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/mongoutil"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mongoutil"
)
var (
diff --git a/plugin/db/mongodb/mongodb_test.go b/backend/plugin/db/mongodb/mongodb_test.go
similarity index 97%
rename from plugin/db/mongodb/mongodb_test.go
rename to backend/plugin/db/mongodb/mongodb_test.go
index edc1a4ef89..3e9e8f7b40 100644
--- a/plugin/db/mongodb/mongodb_test.go
+++ b/backend/plugin/db/mongodb/mongodb_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
func TestGetMongoDBConnectionURL(t *testing.T) {
diff --git a/plugin/db/mongodb/role.go b/backend/plugin/db/mongodb/role.go
similarity index 95%
rename from plugin/db/mongodb/role.go
rename to backend/plugin/db/mongodb/role.go
index 8cf6c0aa3a..c51a93f5fa 100644
--- a/plugin/db/mongodb/role.go
+++ b/backend/plugin/db/mongodb/role.go
@@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/mongodb/sync.go b/backend/plugin/db/mongodb/sync.go
similarity index 98%
rename from plugin/db/mongodb/sync.go
rename to backend/plugin/db/mongodb/sync.go
index add1811ecb..c9f45bf75a 100644
--- a/plugin/db/mongodb/sync.go
+++ b/backend/plugin/db/mongodb/sync.go
@@ -12,8 +12,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/mysql/binlog_stream_parser.go b/backend/plugin/db/mysql/binlog_stream_parser.go
similarity index 100%
rename from plugin/db/mysql/binlog_stream_parser.go
rename to backend/plugin/db/mysql/binlog_stream_parser.go
diff --git a/plugin/db/mysql/binlog_stream_parser_test.go b/backend/plugin/db/mysql/binlog_stream_parser_test.go
similarity index 100%
rename from plugin/db/mysql/binlog_stream_parser_test.go
rename to backend/plugin/db/mysql/binlog_stream_parser_test.go
diff --git a/plugin/db/mysql/dump.go b/backend/plugin/db/mysql/dump.go
similarity index 98%
rename from plugin/db/mysql/dump.go
rename to backend/plugin/db/mysql/dump.go
index 0bcb38dcc6..cdeb56b3ac 100644
--- a/plugin/db/mysql/dump.go
+++ b/backend/plugin/db/mysql/dump.go
@@ -16,11 +16,11 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db/util"
- "github.com/bytebase/bytebase/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
)
// Dump and restore.
diff --git a/plugin/db/mysql/dump_test.go b/backend/plugin/db/mysql/dump_test.go
similarity index 100%
rename from plugin/db/mysql/dump_test.go
rename to backend/plugin/db/mysql/dump_test.go
diff --git a/plugin/db/mysql/migrate.go b/backend/plugin/db/mysql/migrate.go
similarity index 97%
rename from plugin/db/mysql/migrate.go
rename to backend/plugin/db/mysql/migrate.go
index ef782ac690..1e95d5bd27 100644
--- a/plugin/db/mysql/migrate.go
+++ b/backend/plugin/db/mysql/migrate.go
@@ -10,10 +10,10 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/mysql/mysql.go b/backend/plugin/db/mysql/mysql.go
similarity index 96%
rename from plugin/db/mysql/mysql.go
rename to backend/plugin/db/mysql/mysql.go
index 71e61990ad..4e7b2dd779 100644
--- a/plugin/db/mysql/mysql.go
+++ b/backend/plugin/db/mysql/mysql.go
@@ -13,11 +13,11 @@ import (
"go.uber.org/multierr"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
- bbparser "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ bbparser "github.com/bytebase/bytebase/backend/plugin/parser"
)
var (
diff --git a/plugin/db/mysql/mysql_migration_schema.sql b/backend/plugin/db/mysql/mysql_migration_schema.sql
similarity index 100%
rename from plugin/db/mysql/mysql_migration_schema.sql
rename to backend/plugin/db/mysql/mysql_migration_schema.sql
diff --git a/plugin/db/mysql/mysql_test.go b/backend/plugin/db/mysql/mysql_test.go
similarity index 100%
rename from plugin/db/mysql/mysql_test.go
rename to backend/plugin/db/mysql/mysql_test.go
diff --git a/plugin/db/mysql/restore.go b/backend/plugin/db/mysql/restore.go
similarity index 99%
rename from plugin/db/mysql/restore.go
rename to backend/plugin/db/mysql/restore.go
index e93e786358..d71dd6bdb5 100644
--- a/plugin/db/mysql/restore.go
+++ b/backend/plugin/db/mysql/restore.go
@@ -28,12 +28,12 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db/util"
- bbs3 "github.com/bytebase/bytebase/plugin/storage/s3"
- "github.com/bytebase/bytebase/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
"github.com/blang/semver/v4"
)
diff --git a/plugin/db/mysql/restore_test.go b/backend/plugin/db/mysql/restore_test.go
similarity index 99%
rename from plugin/db/mysql/restore_test.go
rename to backend/plugin/db/mysql/restore_test.go
index 89b5d654f6..145d45f0b6 100644
--- a/plugin/db/mysql/restore_test.go
+++ b/backend/plugin/db/mysql/restore_test.go
@@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
func TestGetSafeName(t *testing.T) {
diff --git a/plugin/db/mysql/role.go b/backend/plugin/db/mysql/role.go
similarity index 96%
rename from plugin/db/mysql/role.go
rename to backend/plugin/db/mysql/role.go
index d70860a217..5ff3ffead6 100644
--- a/plugin/db/mysql/role.go
+++ b/backend/plugin/db/mysql/role.go
@@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/mysql/rollback.go b/backend/plugin/db/mysql/rollback.go
similarity index 98%
rename from plugin/db/mysql/rollback.go
rename to backend/plugin/db/mysql/rollback.go
index e68d0f05fa..3245e46330 100644
--- a/plugin/db/mysql/rollback.go
+++ b/backend/plugin/db/mysql/rollback.go
@@ -16,9 +16,9 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- bbparser "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/common/log"
+ bbparser "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
)
var (
diff --git a/plugin/db/mysql/rollback_test.go b/backend/plugin/db/mysql/rollback_test.go
similarity index 100%
rename from plugin/db/mysql/rollback_test.go
rename to backend/plugin/db/mysql/rollback_test.go
diff --git a/plugin/db/mysql/sync.go b/backend/plugin/db/mysql/sync.go
similarity index 98%
rename from plugin/db/mysql/sync.go
rename to backend/plugin/db/mysql/sync.go
index 5be89d07af..f820683716 100644
--- a/plugin/db/mysql/sync.go
+++ b/backend/plugin/db/mysql/sync.go
@@ -9,9 +9,9 @@ import (
"google.golang.org/protobuf/types/known/wrapperspb"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/pg/dump.go b/backend/plugin/db/pg/dump.go
similarity index 98%
rename from plugin/db/pg/dump.go
rename to backend/plugin/db/pg/dump.go
index 595ded4782..507f77e23d 100644
--- a/plugin/db/pg/dump.go
+++ b/backend/plugin/db/pg/dump.go
@@ -11,8 +11,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// Dump dumps the database.
diff --git a/plugin/db/pg/migrate.go b/backend/plugin/db/pg/migrate.go
similarity index 98%
rename from plugin/db/pg/migrate.go
rename to backend/plugin/db/pg/migrate.go
index 44cb5c160d..bc777bdd05 100644
--- a/plugin/db/pg/migrate.go
+++ b/backend/plugin/db/pg/migrate.go
@@ -11,9 +11,9 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
similarity index 98%
rename from plugin/db/pg/pg.go
rename to backend/plugin/db/pg/pg.go
index 64138ea024..304a379062 100644
--- a/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -14,11 +14,11 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/pg/pg_migration_schema.sql b/backend/plugin/db/pg/pg_migration_schema.sql
similarity index 100%
rename from plugin/db/pg/pg_migration_schema.sql
rename to backend/plugin/db/pg/pg_migration_schema.sql
diff --git a/plugin/db/pg/pg_test.go b/backend/plugin/db/pg/pg_test.go
similarity index 100%
rename from plugin/db/pg/pg_test.go
rename to backend/plugin/db/pg/pg_test.go
diff --git a/plugin/db/pg/role.go b/backend/plugin/db/pg/role.go
similarity index 98%
rename from plugin/db/pg/role.go
rename to backend/plugin/db/pg/role.go
index 3c1aa7f49b..167475dd9a 100644
--- a/plugin/db/pg/role.go
+++ b/backend/plugin/db/pg/role.go
@@ -6,9 +6,9 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/pg/sync.go b/backend/plugin/db/pg/sync.go
similarity index 99%
rename from plugin/db/pg/sync.go
rename to backend/plugin/db/pg/sync.go
index f8a44db777..f317c5d23b 100644
--- a/plugin/db/pg/sync.go
+++ b/backend/plugin/db/pg/sync.go
@@ -11,9 +11,9 @@ import (
"github.com/pkg/errors"
"google.golang.org/protobuf/types/known/wrapperspb"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/snowflake/dump.go b/backend/plugin/db/snowflake/dump.go
similarity index 98%
rename from plugin/db/snowflake/dump.go
rename to backend/plugin/db/snowflake/dump.go
index e0d6b53f67..212b06c3c6 100644
--- a/plugin/db/snowflake/dump.go
+++ b/backend/plugin/db/snowflake/dump.go
@@ -9,7 +9,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
// Dump and restore.
diff --git a/plugin/db/snowflake/migrate.go b/backend/plugin/db/snowflake/migrate.go
similarity index 97%
rename from plugin/db/snowflake/migrate.go
rename to backend/plugin/db/snowflake/migrate.go
index 87a2b21bd5..fdaf7f6055 100644
--- a/plugin/db/snowflake/migrate.go
+++ b/backend/plugin/db/snowflake/migrate.go
@@ -10,10 +10,10 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/snowflake/role.go b/backend/plugin/db/snowflake/role.go
similarity index 96%
rename from plugin/db/snowflake/role.go
rename to backend/plugin/db/snowflake/role.go
index d820517b86..64b7dc88cc 100644
--- a/plugin/db/snowflake/role.go
+++ b/backend/plugin/db/snowflake/role.go
@@ -6,8 +6,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/snowflake/snowflake.go b/backend/plugin/db/snowflake/snowflake.go
similarity index 97%
rename from plugin/db/snowflake/snowflake.go
rename to backend/plugin/db/snowflake/snowflake.go
index a81de40ac1..5f1de9b88b 100644
--- a/plugin/db/snowflake/snowflake.go
+++ b/backend/plugin/db/snowflake/snowflake.go
@@ -9,10 +9,10 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
snow "github.com/snowflakedb/gosnowflake"
"go.uber.org/zap"
diff --git a/plugin/db/snowflake/snowflake_migration_schema.sql b/backend/plugin/db/snowflake/snowflake_migration_schema.sql
similarity index 100%
rename from plugin/db/snowflake/snowflake_migration_schema.sql
rename to backend/plugin/db/snowflake/snowflake_migration_schema.sql
diff --git a/plugin/db/snowflake/sync.go b/backend/plugin/db/snowflake/sync.go
similarity index 98%
rename from plugin/db/snowflake/sync.go
rename to backend/plugin/db/snowflake/sync.go
index 3e8797d70e..cbad2f26f3 100644
--- a/plugin/db/snowflake/sync.go
+++ b/backend/plugin/db/snowflake/sync.go
@@ -9,9 +9,9 @@ import (
"google.golang.org/protobuf/types/known/wrapperspb"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/spanner/dump.go b/backend/plugin/db/spanner/dump.go
similarity index 100%
rename from plugin/db/spanner/dump.go
rename to backend/plugin/db/spanner/dump.go
diff --git a/plugin/db/spanner/migrate.go b/backend/plugin/db/spanner/migrate.go
similarity index 98%
rename from plugin/db/spanner/migrate.go
rename to backend/plugin/db/spanner/migrate.go
index 65345ef70f..09e9a01fdb 100644
--- a/plugin/db/spanner/migrate.go
+++ b/backend/plugin/db/spanner/migrate.go
@@ -14,10 +14,10 @@ import (
"github.com/google/uuid"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
"google.golang.org/api/iterator"
"google.golang.org/grpc/codes"
diff --git a/plugin/db/spanner/role.go b/backend/plugin/db/spanner/role.go
similarity index 95%
rename from plugin/db/spanner/role.go
rename to backend/plugin/db/spanner/role.go
index 2395488b04..91571ee989 100644
--- a/plugin/db/spanner/role.go
+++ b/backend/plugin/db/spanner/role.go
@@ -5,7 +5,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// CreateRole creates the role.
diff --git a/plugin/db/spanner/spanner.go b/backend/plugin/db/spanner/spanner.go
similarity index 99%
rename from plugin/db/spanner/spanner.go
rename to backend/plugin/db/spanner/spanner.go
index 8b1d66fc3d..cdd2fa163a 100644
--- a/plugin/db/spanner/spanner.go
+++ b/backend/plugin/db/spanner/spanner.go
@@ -17,8 +17,8 @@ import (
sppb "cloud.google.com/go/spanner/apiv1/spannerpb"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
diff --git a/plugin/db/spanner/spanner_migration_schema.sql b/backend/plugin/db/spanner/spanner_migration_schema.sql
similarity index 100%
rename from plugin/db/spanner/spanner_migration_schema.sql
rename to backend/plugin/db/spanner/spanner_migration_schema.sql
diff --git a/plugin/db/spanner/spanner_test.go b/backend/plugin/db/spanner/spanner_test.go
similarity index 100%
rename from plugin/db/spanner/spanner_test.go
rename to backend/plugin/db/spanner/spanner_test.go
diff --git a/plugin/db/spanner/statement_parser.go b/backend/plugin/db/spanner/statement_parser.go
similarity index 100%
rename from plugin/db/spanner/statement_parser.go
rename to backend/plugin/db/spanner/statement_parser.go
diff --git a/plugin/db/spanner/statement_parser_test.go b/backend/plugin/db/spanner/statement_parser_test.go
similarity index 100%
rename from plugin/db/spanner/statement_parser_test.go
rename to backend/plugin/db/spanner/statement_parser_test.go
diff --git a/plugin/db/spanner/sync.go b/backend/plugin/db/spanner/sync.go
similarity index 99%
rename from plugin/db/spanner/sync.go
rename to backend/plugin/db/spanner/sync.go
index 3cfa02c69c..c76837b1a4 100644
--- a/plugin/db/spanner/sync.go
+++ b/backend/plugin/db/spanner/sync.go
@@ -11,8 +11,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/sqlite/dump.go b/backend/plugin/db/sqlite/dump.go
similarity index 98%
rename from plugin/db/sqlite/dump.go
rename to backend/plugin/db/sqlite/dump.go
index 895f84ecbe..51f4010a92 100644
--- a/plugin/db/sqlite/dump.go
+++ b/backend/plugin/db/sqlite/dump.go
@@ -9,7 +9,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
// Dump dumps the database.
diff --git a/plugin/db/sqlite/migrate.go b/backend/plugin/db/sqlite/migrate.go
similarity index 97%
rename from plugin/db/sqlite/migrate.go
rename to backend/plugin/db/sqlite/migrate.go
index 2abf041bfb..9307ca1371 100644
--- a/plugin/db/sqlite/migrate.go
+++ b/backend/plugin/db/sqlite/migrate.go
@@ -12,10 +12,10 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/sqlite/role.go b/backend/plugin/db/sqlite/role.go
similarity index 95%
rename from plugin/db/sqlite/role.go
rename to backend/plugin/db/sqlite/role.go
index 6716e982e1..951e40e693 100644
--- a/plugin/db/sqlite/role.go
+++ b/backend/plugin/db/sqlite/role.go
@@ -5,7 +5,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// CreateRole creates the role.
diff --git a/plugin/db/sqlite/sqlite.go b/backend/plugin/db/sqlite/sqlite.go
similarity index 96%
rename from plugin/db/sqlite/sqlite.go
rename to backend/plugin/db/sqlite/sqlite.go
index 3d02053c31..798f0c83bb 100644
--- a/plugin/db/sqlite/sqlite.go
+++ b/backend/plugin/db/sqlite/sqlite.go
@@ -14,9 +14,9 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
)
var (
diff --git a/plugin/db/sqlite/sqlite_migration_schema.sql b/backend/plugin/db/sqlite/sqlite_migration_schema.sql
similarity index 100%
rename from plugin/db/sqlite/sqlite_migration_schema.sql
rename to backend/plugin/db/sqlite/sqlite_migration_schema.sql
diff --git a/plugin/db/sqlite/sync.go b/backend/plugin/db/sqlite/sync.go
similarity index 97%
rename from plugin/db/sqlite/sync.go
rename to backend/plugin/db/sqlite/sync.go
index c348db6c94..6071f4a627 100644
--- a/plugin/db/sqlite/sync.go
+++ b/backend/plugin/db/sqlite/sync.go
@@ -9,9 +9,9 @@ import (
"github.com/pkg/errors"
"google.golang.org/protobuf/types/known/wrapperspb"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/plugin/db/ssl.go b/backend/plugin/db/ssl.go
similarity index 100%
rename from plugin/db/ssl.go
rename to backend/plugin/db/ssl.go
diff --git a/plugin/db/util/driverutil.go b/backend/plugin/db/util/driverutil.go
similarity index 99%
rename from plugin/db/util/driverutil.go
rename to backend/plugin/db/util/driverutil.go
index a495650050..e083f90532 100644
--- a/plugin/db/util/driverutil.go
+++ b/backend/plugin/db/util/driverutil.go
@@ -23,9 +23,9 @@ import (
"github.com/shopspring/decimal"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// FormatErrorWithQuery will format the error with failed query.
diff --git a/plugin/db/util/driverutil_test.go b/backend/plugin/db/util/driverutil_test.go
similarity index 99%
rename from plugin/db/util/driverutil_test.go
rename to backend/plugin/db/util/driverutil_test.go
index 1e6bdec8ce..679bf4c33d 100644
--- a/plugin/db/util/driverutil_test.go
+++ b/backend/plugin/db/util/driverutil_test.go
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
diff --git a/plugin/db/util/mask_sensitive_data.go b/backend/plugin/db/util/mask_sensitive_data.go
similarity index 99%
rename from plugin/db/util/mask_sensitive_data.go
rename to backend/plugin/db/util/mask_sensitive_data.go
index 52df461657..7912a25188 100644
--- a/plugin/db/util/mask_sensitive_data.go
+++ b/backend/plugin/db/util/mask_sensitive_data.go
@@ -3,8 +3,8 @@ package util
import (
"strings"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
"github.com/pkg/errors"
diff --git a/plugin/db/util/restore.go b/backend/plugin/db/util/restore.go
similarity index 100%
rename from plugin/db/util/restore.go
rename to backend/plugin/db/util/restore.go
diff --git a/plugin/metric/collector.go b/backend/plugin/metric/collector.go
similarity index 100%
rename from plugin/metric/collector.go
rename to backend/plugin/metric/collector.go
diff --git a/plugin/metric/metric.go b/backend/plugin/metric/metric.go
similarity index 100%
rename from plugin/metric/metric.go
rename to backend/plugin/metric/metric.go
diff --git a/plugin/metric/reporter.go b/backend/plugin/metric/reporter.go
similarity index 100%
rename from plugin/metric/reporter.go
rename to backend/plugin/metric/reporter.go
diff --git a/plugin/metric/segment/reporter.go b/backend/plugin/metric/segment/reporter.go
similarity index 96%
rename from plugin/metric/segment/reporter.go
rename to backend/plugin/metric/segment/reporter.go
index 01c80640ff..fc645c610b 100644
--- a/plugin/metric/segment/reporter.go
+++ b/backend/plugin/metric/segment/reporter.go
@@ -4,7 +4,7 @@ package segment
import (
"time"
- "github.com/bytebase/bytebase/plugin/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
"github.com/segmentio/analytics-go"
)
diff --git a/plugin/parser/ast/add_column_list_stmt.go b/backend/plugin/parser/ast/add_column_list_stmt.go
similarity index 100%
rename from plugin/parser/ast/add_column_list_stmt.go
rename to backend/plugin/parser/ast/add_column_list_stmt.go
diff --git a/plugin/parser/ast/add_constraint_stmt.go b/backend/plugin/parser/ast/add_constraint_stmt.go
similarity index 100%
rename from plugin/parser/ast/add_constraint_stmt.go
rename to backend/plugin/parser/ast/add_constraint_stmt.go
diff --git a/plugin/parser/ast/add_enum_label_stmt.go b/backend/plugin/parser/ast/add_enum_label_stmt.go
similarity index 100%
rename from plugin/parser/ast/add_enum_label_stmt.go
rename to backend/plugin/parser/ast/add_enum_label_stmt.go
diff --git a/plugin/parser/ast/alter_column_type_stmt.go b/backend/plugin/parser/ast/alter_column_type_stmt.go
similarity index 100%
rename from plugin/parser/ast/alter_column_type_stmt.go
rename to backend/plugin/parser/ast/alter_column_type_stmt.go
diff --git a/plugin/parser/ast/alter_sequence_stmt.go b/backend/plugin/parser/ast/alter_sequence_stmt.go
similarity index 100%
rename from plugin/parser/ast/alter_sequence_stmt.go
rename to backend/plugin/parser/ast/alter_sequence_stmt.go
diff --git a/plugin/parser/ast/alter_table_stmt.go b/backend/plugin/parser/ast/alter_table_stmt.go
similarity index 100%
rename from plugin/parser/ast/alter_table_stmt.go
rename to backend/plugin/parser/ast/alter_table_stmt.go
diff --git a/plugin/parser/ast/alter_type_stmt.go b/backend/plugin/parser/ast/alter_type_stmt.go
similarity index 100%
rename from plugin/parser/ast/alter_type_stmt.go
rename to backend/plugin/parser/ast/alter_type_stmt.go
diff --git a/plugin/parser/ast/attach_partition_stmt.go b/backend/plugin/parser/ast/attach_partition_stmt.go
similarity index 100%
rename from plugin/parser/ast/attach_partition_stmt.go
rename to backend/plugin/parser/ast/attach_partition_stmt.go
diff --git a/plugin/parser/ast/change_column_stmt.go b/backend/plugin/parser/ast/change_column_stmt.go
similarity index 100%
rename from plugin/parser/ast/change_column_stmt.go
rename to backend/plugin/parser/ast/change_column_stmt.go
diff --git a/plugin/parser/ast/character.go b/backend/plugin/parser/ast/character.go
similarity index 100%
rename from plugin/parser/ast/character.go
rename to backend/plugin/parser/ast/character.go
diff --git a/plugin/parser/ast/character_varying.go b/backend/plugin/parser/ast/character_varying.go
similarity index 100%
rename from plugin/parser/ast/character_varying.go
rename to backend/plugin/parser/ast/character_varying.go
diff --git a/plugin/parser/ast/column_def.go b/backend/plugin/parser/ast/column_def.go
similarity index 100%
rename from plugin/parser/ast/column_def.go
rename to backend/plugin/parser/ast/column_def.go
diff --git a/plugin/parser/ast/column_name_def.go b/backend/plugin/parser/ast/column_name_def.go
similarity index 100%
rename from plugin/parser/ast/column_name_def.go
rename to backend/plugin/parser/ast/column_name_def.go
diff --git a/plugin/parser/ast/comment_stmt.go b/backend/plugin/parser/ast/comment_stmt.go
similarity index 100%
rename from plugin/parser/ast/comment_stmt.go
rename to backend/plugin/parser/ast/comment_stmt.go
diff --git a/plugin/parser/ast/commit_stmt.go b/backend/plugin/parser/ast/commit_stmt.go
similarity index 100%
rename from plugin/parser/ast/commit_stmt.go
rename to backend/plugin/parser/ast/commit_stmt.go
diff --git a/plugin/parser/ast/constraint_def.go b/backend/plugin/parser/ast/constraint_def.go
similarity index 100%
rename from plugin/parser/ast/constraint_def.go
rename to backend/plugin/parser/ast/constraint_def.go
diff --git a/plugin/parser/ast/copy_stmt.go b/backend/plugin/parser/ast/copy_stmt.go
similarity index 100%
rename from plugin/parser/ast/copy_stmt.go
rename to backend/plugin/parser/ast/copy_stmt.go
diff --git a/plugin/parser/ast/create_database_stmt.go b/backend/plugin/parser/ast/create_database_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_database_stmt.go
rename to backend/plugin/parser/ast/create_database_stmt.go
diff --git a/plugin/parser/ast/create_extension_stmt.go b/backend/plugin/parser/ast/create_extension_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_extension_stmt.go
rename to backend/plugin/parser/ast/create_extension_stmt.go
diff --git a/plugin/parser/ast/create_function_stmt.go b/backend/plugin/parser/ast/create_function_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_function_stmt.go
rename to backend/plugin/parser/ast/create_function_stmt.go
diff --git a/plugin/parser/ast/create_index_stmt.go b/backend/plugin/parser/ast/create_index_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_index_stmt.go
rename to backend/plugin/parser/ast/create_index_stmt.go
diff --git a/plugin/parser/ast/create_schema_stmt.go b/backend/plugin/parser/ast/create_schema_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_schema_stmt.go
rename to backend/plugin/parser/ast/create_schema_stmt.go
diff --git a/plugin/parser/ast/create_sequence_stmt.go b/backend/plugin/parser/ast/create_sequence_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_sequence_stmt.go
rename to backend/plugin/parser/ast/create_sequence_stmt.go
diff --git a/plugin/parser/ast/create_table_stmt.go b/backend/plugin/parser/ast/create_table_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_table_stmt.go
rename to backend/plugin/parser/ast/create_table_stmt.go
diff --git a/plugin/parser/ast/create_trigger_stmt.go b/backend/plugin/parser/ast/create_trigger_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_trigger_stmt.go
rename to backend/plugin/parser/ast/create_trigger_stmt.go
diff --git a/plugin/parser/ast/create_type_stmt.go b/backend/plugin/parser/ast/create_type_stmt.go
similarity index 100%
rename from plugin/parser/ast/create_type_stmt.go
rename to backend/plugin/parser/ast/create_type_stmt.go
diff --git a/plugin/parser/ast/data_type.go b/backend/plugin/parser/ast/data_type.go
similarity index 100%
rename from plugin/parser/ast/data_type.go
rename to backend/plugin/parser/ast/data_type.go
diff --git a/plugin/parser/ast/database_option_def.go b/backend/plugin/parser/ast/database_option_def.go
similarity index 100%
rename from plugin/parser/ast/database_option_def.go
rename to backend/plugin/parser/ast/database_option_def.go
diff --git a/plugin/parser/ast/ddl_node.go b/backend/plugin/parser/ast/ddl_node.go
similarity index 100%
rename from plugin/parser/ast/ddl_node.go
rename to backend/plugin/parser/ast/ddl_node.go
diff --git a/plugin/parser/ast/decimal.go b/backend/plugin/parser/ast/decimal.go
similarity index 100%
rename from plugin/parser/ast/decimal.go
rename to backend/plugin/parser/ast/decimal.go
diff --git a/plugin/parser/ast/delete_stmt.go b/backend/plugin/parser/ast/delete_stmt.go
similarity index 100%
rename from plugin/parser/ast/delete_stmt.go
rename to backend/plugin/parser/ast/delete_stmt.go
diff --git a/plugin/parser/ast/dml_node.go b/backend/plugin/parser/ast/dml_node.go
similarity index 100%
rename from plugin/parser/ast/dml_node.go
rename to backend/plugin/parser/ast/dml_node.go
diff --git a/plugin/parser/ast/docs.go b/backend/plugin/parser/ast/docs.go
similarity index 100%
rename from plugin/parser/ast/docs.go
rename to backend/plugin/parser/ast/docs.go
diff --git a/plugin/parser/ast/drop_column_stmt.go b/backend/plugin/parser/ast/drop_column_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_column_stmt.go
rename to backend/plugin/parser/ast/drop_column_stmt.go
diff --git a/plugin/parser/ast/drop_constraint_stmt.go b/backend/plugin/parser/ast/drop_constraint_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_constraint_stmt.go
rename to backend/plugin/parser/ast/drop_constraint_stmt.go
diff --git a/plugin/parser/ast/drop_database_stmt.go b/backend/plugin/parser/ast/drop_database_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_database_stmt.go
rename to backend/plugin/parser/ast/drop_database_stmt.go
diff --git a/plugin/parser/ast/drop_default_stmt.go b/backend/plugin/parser/ast/drop_default_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_default_stmt.go
rename to backend/plugin/parser/ast/drop_default_stmt.go
diff --git a/plugin/parser/ast/drop_extension_stmt.go b/backend/plugin/parser/ast/drop_extension_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_extension_stmt.go
rename to backend/plugin/parser/ast/drop_extension_stmt.go
diff --git a/plugin/parser/ast/drop_function_stmt.go b/backend/plugin/parser/ast/drop_function_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_function_stmt.go
rename to backend/plugin/parser/ast/drop_function_stmt.go
diff --git a/plugin/parser/ast/drop_index_stmt.go b/backend/plugin/parser/ast/drop_index_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_index_stmt.go
rename to backend/plugin/parser/ast/drop_index_stmt.go
diff --git a/plugin/parser/ast/drop_not_null_stmt.go b/backend/plugin/parser/ast/drop_not_null_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_not_null_stmt.go
rename to backend/plugin/parser/ast/drop_not_null_stmt.go
diff --git a/plugin/parser/ast/drop_schema_stmt.go b/backend/plugin/parser/ast/drop_schema_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_schema_stmt.go
rename to backend/plugin/parser/ast/drop_schema_stmt.go
diff --git a/plugin/parser/ast/drop_sequence_stmt.go b/backend/plugin/parser/ast/drop_sequence_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_sequence_stmt.go
rename to backend/plugin/parser/ast/drop_sequence_stmt.go
diff --git a/plugin/parser/ast/drop_table_stmt.go b/backend/plugin/parser/ast/drop_table_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_table_stmt.go
rename to backend/plugin/parser/ast/drop_table_stmt.go
diff --git a/plugin/parser/ast/drop_trigger_stmt.go b/backend/plugin/parser/ast/drop_trigger_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_trigger_stmt.go
rename to backend/plugin/parser/ast/drop_trigger_stmt.go
diff --git a/plugin/parser/ast/drop_type_stmt.go b/backend/plugin/parser/ast/drop_type_stmt.go
similarity index 100%
rename from plugin/parser/ast/drop_type_stmt.go
rename to backend/plugin/parser/ast/drop_type_stmt.go
diff --git a/plugin/parser/ast/enum_type_def.go b/backend/plugin/parser/ast/enum_type_def.go
similarity index 100%
rename from plugin/parser/ast/enum_type_def.go
rename to backend/plugin/parser/ast/enum_type_def.go
diff --git a/plugin/parser/ast/explain_stmt.go b/backend/plugin/parser/ast/explain_stmt.go
similarity index 100%
rename from plugin/parser/ast/explain_stmt.go
rename to backend/plugin/parser/ast/explain_stmt.go
diff --git a/plugin/parser/ast/expression_def.go b/backend/plugin/parser/ast/expression_def.go
similarity index 100%
rename from plugin/parser/ast/expression_def.go
rename to backend/plugin/parser/ast/expression_def.go
diff --git a/plugin/parser/ast/float.go b/backend/plugin/parser/ast/float.go
similarity index 100%
rename from plugin/parser/ast/float.go
rename to backend/plugin/parser/ast/float.go
diff --git a/plugin/parser/ast/foreign_def.go b/backend/plugin/parser/ast/foreign_def.go
similarity index 100%
rename from plugin/parser/ast/foreign_def.go
rename to backend/plugin/parser/ast/foreign_def.go
diff --git a/plugin/parser/ast/function_def.go b/backend/plugin/parser/ast/function_def.go
similarity index 100%
rename from plugin/parser/ast/function_def.go
rename to backend/plugin/parser/ast/function_def.go
diff --git a/plugin/parser/ast/index_def.go b/backend/plugin/parser/ast/index_def.go
similarity index 100%
rename from plugin/parser/ast/index_def.go
rename to backend/plugin/parser/ast/index_def.go
diff --git a/plugin/parser/ast/index_key_def.go b/backend/plugin/parser/ast/index_key_def.go
similarity index 100%
rename from plugin/parser/ast/index_key_def.go
rename to backend/plugin/parser/ast/index_key_def.go
diff --git a/plugin/parser/ast/insert_stmt.go b/backend/plugin/parser/ast/insert_stmt.go
similarity index 100%
rename from plugin/parser/ast/insert_stmt.go
rename to backend/plugin/parser/ast/insert_stmt.go
diff --git a/plugin/parser/ast/integer.go b/backend/plugin/parser/ast/integer.go
similarity index 100%
rename from plugin/parser/ast/integer.go
rename to backend/plugin/parser/ast/integer.go
diff --git a/plugin/parser/ast/node.go b/backend/plugin/parser/ast/node.go
similarity index 100%
rename from plugin/parser/ast/node.go
rename to backend/plugin/parser/ast/node.go
diff --git a/plugin/parser/ast/pattern_like_def.go b/backend/plugin/parser/ast/pattern_like_def.go
similarity index 100%
rename from plugin/parser/ast/pattern_like_def.go
rename to backend/plugin/parser/ast/pattern_like_def.go
diff --git a/plugin/parser/ast/referential_action_def.go b/backend/plugin/parser/ast/referential_action_def.go
similarity index 100%
rename from plugin/parser/ast/referential_action_def.go
rename to backend/plugin/parser/ast/referential_action_def.go
diff --git a/plugin/parser/ast/rename_column_stmt.go b/backend/plugin/parser/ast/rename_column_stmt.go
similarity index 100%
rename from plugin/parser/ast/rename_column_stmt.go
rename to backend/plugin/parser/ast/rename_column_stmt.go
diff --git a/plugin/parser/ast/rename_constraint_stmt.go b/backend/plugin/parser/ast/rename_constraint_stmt.go
similarity index 100%
rename from plugin/parser/ast/rename_constraint_stmt.go
rename to backend/plugin/parser/ast/rename_constraint_stmt.go
diff --git a/plugin/parser/ast/rename_index_stmt.go b/backend/plugin/parser/ast/rename_index_stmt.go
similarity index 100%
rename from plugin/parser/ast/rename_index_stmt.go
rename to backend/plugin/parser/ast/rename_index_stmt.go
diff --git a/plugin/parser/ast/rename_schema_stmt.go b/backend/plugin/parser/ast/rename_schema_stmt.go
similarity index 100%
rename from plugin/parser/ast/rename_schema_stmt.go
rename to backend/plugin/parser/ast/rename_schema_stmt.go
diff --git a/plugin/parser/ast/rename_table_stmt.go b/backend/plugin/parser/ast/rename_table_stmt.go
similarity index 100%
rename from plugin/parser/ast/rename_table_stmt.go
rename to backend/plugin/parser/ast/rename_table_stmt.go
diff --git a/plugin/parser/ast/role_spec.go b/backend/plugin/parser/ast/role_spec.go
similarity index 100%
rename from plugin/parser/ast/role_spec.go
rename to backend/plugin/parser/ast/role_spec.go
diff --git a/plugin/parser/ast/select_stmt.go b/backend/plugin/parser/ast/select_stmt.go
similarity index 100%
rename from plugin/parser/ast/select_stmt.go
rename to backend/plugin/parser/ast/select_stmt.go
diff --git a/plugin/parser/ast/sequence_def.go b/backend/plugin/parser/ast/sequence_def.go
similarity index 100%
rename from plugin/parser/ast/sequence_def.go
rename to backend/plugin/parser/ast/sequence_def.go
diff --git a/plugin/parser/ast/serial.go b/backend/plugin/parser/ast/serial.go
similarity index 100%
rename from plugin/parser/ast/serial.go
rename to backend/plugin/parser/ast/serial.go
diff --git a/plugin/parser/ast/set_default_stmt.go b/backend/plugin/parser/ast/set_default_stmt.go
similarity index 100%
rename from plugin/parser/ast/set_default_stmt.go
rename to backend/plugin/parser/ast/set_default_stmt.go
diff --git a/plugin/parser/ast/set_not_null_stmt.go b/backend/plugin/parser/ast/set_not_null_stmt.go
similarity index 100%
rename from plugin/parser/ast/set_not_null_stmt.go
rename to backend/plugin/parser/ast/set_not_null_stmt.go
diff --git a/plugin/parser/ast/set_schema_stmt.go b/backend/plugin/parser/ast/set_schema_stmt.go
similarity index 100%
rename from plugin/parser/ast/set_schema_stmt.go
rename to backend/plugin/parser/ast/set_schema_stmt.go
diff --git a/plugin/parser/ast/string_def.go b/backend/plugin/parser/ast/string_def.go
similarity index 100%
rename from plugin/parser/ast/string_def.go
rename to backend/plugin/parser/ast/string_def.go
diff --git a/plugin/parser/ast/subquery_def.go b/backend/plugin/parser/ast/subquery_def.go
similarity index 100%
rename from plugin/parser/ast/subquery_def.go
rename to backend/plugin/parser/ast/subquery_def.go
diff --git a/plugin/parser/ast/table_def.go b/backend/plugin/parser/ast/table_def.go
similarity index 100%
rename from plugin/parser/ast/table_def.go
rename to backend/plugin/parser/ast/table_def.go
diff --git a/plugin/parser/ast/text.go b/backend/plugin/parser/ast/text.go
similarity index 100%
rename from plugin/parser/ast/text.go
rename to backend/plugin/parser/ast/text.go
diff --git a/plugin/parser/ast/trigger_def.go b/backend/plugin/parser/ast/trigger_def.go
similarity index 100%
rename from plugin/parser/ast/trigger_def.go
rename to backend/plugin/parser/ast/trigger_def.go
diff --git a/plugin/parser/ast/unconverted_data_type.go b/backend/plugin/parser/ast/unconverted_data_type.go
similarity index 100%
rename from plugin/parser/ast/unconverted_data_type.go
rename to backend/plugin/parser/ast/unconverted_data_type.go
diff --git a/plugin/parser/ast/unconverted_expression_def.go b/backend/plugin/parser/ast/unconverted_expression_def.go
similarity index 100%
rename from plugin/parser/ast/unconverted_expression_def.go
rename to backend/plugin/parser/ast/unconverted_expression_def.go
diff --git a/plugin/parser/ast/unconverted_stmt.go b/backend/plugin/parser/ast/unconverted_stmt.go
similarity index 100%
rename from plugin/parser/ast/unconverted_stmt.go
rename to backend/plugin/parser/ast/unconverted_stmt.go
diff --git a/plugin/parser/ast/update_stmt.go b/backend/plugin/parser/ast/update_stmt.go
similarity index 100%
rename from plugin/parser/ast/update_stmt.go
rename to backend/plugin/parser/ast/update_stmt.go
diff --git a/plugin/parser/ast/utils.go b/backend/plugin/parser/ast/utils.go
similarity index 100%
rename from plugin/parser/ast/utils.go
rename to backend/plugin/parser/ast/utils.go
diff --git a/plugin/parser/differ/differ.go b/backend/plugin/parser/differ/differ.go
similarity index 95%
rename from plugin/parser/differ/differ.go
rename to backend/plugin/parser/differ/differ.go
index bec4aa8d6a..4949be6dd2 100644
--- a/plugin/parser/differ/differ.go
+++ b/backend/plugin/parser/differ/differ.go
@@ -6,7 +6,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// SchemaDiffer is the interface for schema differ.
diff --git a/plugin/parser/differ/mysql/column_test.go b/backend/plugin/parser/differ/mysql/column_test.go
similarity index 100%
rename from plugin/parser/differ/mysql/column_test.go
rename to backend/plugin/parser/differ/mysql/column_test.go
diff --git a/plugin/parser/differ/mysql/constraint_test.go b/backend/plugin/parser/differ/mysql/constraint_test.go
similarity index 100%
rename from plugin/parser/differ/mysql/constraint_test.go
rename to backend/plugin/parser/differ/mysql/constraint_test.go
diff --git a/plugin/parser/differ/mysql/differ.go b/backend/plugin/parser/differ/mysql/differ.go
similarity index 99%
rename from plugin/parser/differ/mysql/differ.go
rename to backend/plugin/parser/differ/mysql/differ.go
index 8e3a39f502..5db20f2c24 100644
--- a/plugin/parser/differ/mysql/differ.go
+++ b/backend/plugin/parser/differ/mysql/differ.go
@@ -10,7 +10,7 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
@@ -19,9 +19,9 @@ import (
"github.com/pingcap/tidb/types"
"github.com/pkg/errors"
- bbparser "github.com/bytebase/bytebase/plugin/parser"
+ bbparser "github.com/bytebase/bytebase/backend/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/differ"
+ "github.com/bytebase/bytebase/backend/plugin/parser/differ"
// Register pingcap parser driver.
driver "github.com/pingcap/tidb/types/parser_driver"
diff --git a/plugin/parser/differ/mysql/differ_test.go b/backend/plugin/parser/differ/mysql/differ_test.go
similarity index 100%
rename from plugin/parser/differ/mysql/differ_test.go
rename to backend/plugin/parser/differ/mysql/differ_test.go
diff --git a/plugin/parser/differ/mysql/table_test.go b/backend/plugin/parser/differ/mysql/table_test.go
similarity index 100%
rename from plugin/parser/differ/mysql/table_test.go
rename to backend/plugin/parser/differ/mysql/table_test.go
diff --git a/plugin/parser/differ/mysql/utils.go b/backend/plugin/parser/differ/mysql/utils.go
similarity index 100%
rename from plugin/parser/differ/mysql/utils.go
rename to backend/plugin/parser/differ/mysql/utils.go
diff --git a/plugin/parser/differ/mysql/utils_test.go b/backend/plugin/parser/differ/mysql/utils_test.go
similarity index 100%
rename from plugin/parser/differ/mysql/utils_test.go
rename to backend/plugin/parser/differ/mysql/utils_test.go
diff --git a/plugin/parser/differ/pg/differ.go b/backend/plugin/parser/differ/pg/differ.go
similarity index 99%
rename from plugin/parser/differ/pg/differ.go
rename to backend/plugin/parser/differ/pg/differ.go
index 5b20845751..91322a370e 100644
--- a/plugin/parser/differ/pg/differ.go
+++ b/backend/plugin/parser/differ/pg/differ.go
@@ -8,9 +8,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
- "github.com/bytebase/bytebase/plugin/parser/differ"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser/differ"
)
var (
diff --git a/plugin/parser/differ/pg/differ_test.go b/backend/plugin/parser/differ/pg/differ_test.go
similarity index 95%
rename from plugin/parser/differ/pg/differ_test.go
rename to backend/plugin/parser/differ/pg/differ_test.go
index 206d26e58d..66bf8dc23c 100644
--- a/plugin/parser/differ/pg/differ_test.go
+++ b/backend/plugin/parser/differ/pg/differ_test.go
@@ -10,7 +10,7 @@ import (
"gopkg.in/yaml.v3"
// Register PostgreSQL parser engine.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
)
type DifferTestData struct {
diff --git a/plugin/parser/differ/pg/test-data/test_differ_constraint.yaml b/backend/plugin/parser/differ/pg/test-data/test_differ_constraint.yaml
similarity index 100%
rename from plugin/parser/differ/pg/test-data/test_differ_constraint.yaml
rename to backend/plugin/parser/differ/pg/test-data/test_differ_constraint.yaml
diff --git a/plugin/parser/differ/pg/test-data/test_differ_data.yaml b/backend/plugin/parser/differ/pg/test-data/test_differ_data.yaml
similarity index 100%
rename from plugin/parser/differ/pg/test-data/test_differ_data.yaml
rename to backend/plugin/parser/differ/pg/test-data/test_differ_data.yaml
diff --git a/plugin/parser/differ/pg/test-data/test_differ_merge.yaml b/backend/plugin/parser/differ/pg/test-data/test_differ_merge.yaml
similarity index 100%
rename from plugin/parser/differ/pg/test-data/test_differ_merge.yaml
rename to backend/plugin/parser/differ/pg/test-data/test_differ_merge.yaml
diff --git a/plugin/parser/differ/pg/test-data/test_differ_schema.yaml b/backend/plugin/parser/differ/pg/test-data/test_differ_schema.yaml
similarity index 100%
rename from plugin/parser/differ/pg/test-data/test_differ_schema.yaml
rename to backend/plugin/parser/differ/pg/test-data/test_differ_schema.yaml
diff --git a/plugin/parser/differ/pg/test-data/test_differ_sequence.yaml b/backend/plugin/parser/differ/pg/test-data/test_differ_sequence.yaml
similarity index 100%
rename from plugin/parser/differ/pg/test-data/test_differ_sequence.yaml
rename to backend/plugin/parser/differ/pg/test-data/test_differ_sequence.yaml
diff --git a/plugin/parser/edit/edit.go b/backend/plugin/parser/edit/edit.go
similarity index 94%
rename from plugin/parser/edit/edit.go
rename to backend/plugin/parser/edit/edit.go
index caae3d6672..b6962a4948 100644
--- a/plugin/parser/edit/edit.go
+++ b/backend/plugin/parser/edit/edit.go
@@ -6,8 +6,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// SchemaEditor is the interface for schema editor.
diff --git a/plugin/parser/edit/mysql/deparse.go b/backend/plugin/parser/edit/mysql/deparse.go
similarity index 99%
rename from plugin/parser/edit/mysql/deparse.go
rename to backend/plugin/parser/edit/mysql/deparse.go
index e42de114db..1214834b0b 100644
--- a/plugin/parser/edit/mysql/deparse.go
+++ b/backend/plugin/parser/edit/mysql/deparse.go
@@ -12,7 +12,7 @@ import (
"github.com/pingcap/tidb/types"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// DeparseDatabaseEdit deparses DatabaseEdit to DDL statement.
diff --git a/plugin/parser/edit/mysql/deparse_test.go b/backend/plugin/parser/edit/mysql/deparse_test.go
similarity index 99%
rename from plugin/parser/edit/mysql/deparse_test.go
rename to backend/plugin/parser/edit/mysql/deparse_test.go
index f76d04a325..1d0a4f0599 100644
--- a/plugin/parser/edit/mysql/deparse_test.go
+++ b/backend/plugin/parser/edit/mysql/deparse_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
diff --git a/plugin/parser/edit/mysql/edit.go b/backend/plugin/parser/edit/mysql/edit.go
similarity index 69%
rename from plugin/parser/edit/mysql/edit.go
rename to backend/plugin/parser/edit/mysql/edit.go
index 47cf02a35d..dcef5f2c95 100644
--- a/plugin/parser/edit/mysql/edit.go
+++ b/backend/plugin/parser/edit/mysql/edit.go
@@ -2,9 +2,9 @@
package mysql
import (
- bbparser "github.com/bytebase/bytebase/plugin/parser"
+ bbparser "github.com/bytebase/bytebase/backend/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/edit"
+ "github.com/bytebase/bytebase/backend/plugin/parser/edit"
)
var (
diff --git a/plugin/parser/edit/mysql/validate.go b/backend/plugin/parser/edit/mysql/validate.go
similarity index 98%
rename from plugin/parser/edit/mysql/validate.go
rename to backend/plugin/parser/edit/mysql/validate.go
index b5f7af9ba9..f2e75f460e 100644
--- a/plugin/parser/edit/mysql/validate.go
+++ b/backend/plugin/parser/edit/mysql/validate.go
@@ -5,7 +5,7 @@ import (
"github.com/pingcap/tidb/parser/mysql"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// ValidateDatabaseEdit validates the api message DatabaseEdit, including related column type.
diff --git a/plugin/parser/edit/mysql/validate_test.go b/backend/plugin/parser/edit/mysql/validate_test.go
similarity index 98%
rename from plugin/parser/edit/mysql/validate_test.go
rename to backend/plugin/parser/edit/mysql/validate_test.go
index 6d74863867..620d40a082 100644
--- a/plugin/parser/edit/mysql/validate_test.go
+++ b/backend/plugin/parser/edit/mysql/validate_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func TestValidateDatabaseEditColumnType(t *testing.T) {
diff --git a/plugin/parser/edit/pg/deparse.go b/backend/plugin/parser/edit/pg/deparse.go
similarity index 98%
rename from plugin/parser/edit/pg/deparse.go
rename to backend/plugin/parser/edit/pg/deparse.go
index b8346c195e..ec09983fb0 100644
--- a/plugin/parser/edit/pg/deparse.go
+++ b/backend/plugin/parser/edit/pg/deparse.go
@@ -6,9 +6,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
// DeparseContext is the context including walkthrough nodes and comment statements.
diff --git a/plugin/parser/edit/pg/deparse_test.go b/backend/plugin/parser/edit/pg/deparse_test.go
similarity index 99%
rename from plugin/parser/edit/pg/deparse_test.go
rename to backend/plugin/parser/edit/pg/deparse_test.go
index 339694b41e..4a422a3fd9 100644
--- a/plugin/parser/edit/pg/deparse_test.go
+++ b/backend/plugin/parser/edit/pg/deparse_test.go
@@ -5,10 +5,10 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
// Register PostgreSQL parser engine.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
)
func TestDeparseRenameSchema(t *testing.T) {
diff --git a/plugin/parser/edit/pg/edit.go b/backend/plugin/parser/edit/pg/edit.go
similarity index 69%
rename from plugin/parser/edit/pg/edit.go
rename to backend/plugin/parser/edit/pg/edit.go
index 9840f80f6c..5ab79ed82f 100644
--- a/plugin/parser/edit/pg/edit.go
+++ b/backend/plugin/parser/edit/pg/edit.go
@@ -2,9 +2,9 @@
package pg
import (
- bbparser "github.com/bytebase/bytebase/plugin/parser"
+ bbparser "github.com/bytebase/bytebase/backend/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/edit"
+ "github.com/bytebase/bytebase/backend/plugin/parser/edit"
)
var (
diff --git a/plugin/parser/edit/pg/validate.go b/backend/plugin/parser/edit/pg/validate.go
similarity index 87%
rename from plugin/parser/edit/pg/validate.go
rename to backend/plugin/parser/edit/pg/validate.go
index b55c34f1ea..de65a587d4 100644
--- a/plugin/parser/edit/pg/validate.go
+++ b/backend/plugin/parser/edit/pg/validate.go
@@ -1,7 +1,7 @@
package pg
import (
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// ValidateDatabaseEdit validates the api message DatabaseEdit, including related column type.
diff --git a/plugin/parser/edit/pg/validate_test.go b/backend/plugin/parser/edit/pg/validate_test.go
similarity index 91%
rename from plugin/parser/edit/pg/validate_test.go
rename to backend/plugin/parser/edit/pg/validate_test.go
index ddad9d4ba7..37695f2fa6 100644
--- a/plugin/parser/edit/pg/validate_test.go
+++ b/backend/plugin/parser/edit/pg/validate_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func TestValidateDatabaseEditColumnType(t *testing.T) {
diff --git a/plugin/parser/engine/pg/convert.go b/backend/plugin/parser/engine/pg/convert.go
similarity index 99%
rename from plugin/parser/engine/pg/convert.go
rename to backend/plugin/parser/engine/pg/convert.go
index b69d6c2a26..14a9c0e999 100644
--- a/plugin/parser/engine/pg/convert.go
+++ b/backend/plugin/parser/engine/pg/convert.go
@@ -8,8 +8,8 @@ import (
pgquery "github.com/pganalyze/pg_query_go/v2"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
// convert converts the pg_query.Node to ast.Node.
diff --git a/plugin/parser/engine/pg/convert_test.go b/backend/plugin/parser/engine/pg/convert_test.go
similarity index 99%
rename from plugin/parser/engine/pg/convert_test.go
rename to backend/plugin/parser/engine/pg/convert_test.go
index ecce185be4..920a2fe745 100644
--- a/plugin/parser/engine/pg/convert_test.go
+++ b/backend/plugin/parser/engine/pg/convert_test.go
@@ -5,8 +5,8 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
type testData struct {
diff --git a/plugin/parser/engine/pg/data_type_test.go b/backend/plugin/parser/engine/pg/data_type_test.go
similarity index 91%
rename from plugin/parser/engine/pg/data_type_test.go
rename to backend/plugin/parser/engine/pg/data_type_test.go
index 1bbb1393f4..c180a84568 100644
--- a/plugin/parser/engine/pg/data_type_test.go
+++ b/backend/plugin/parser/engine/pg/data_type_test.go
@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
func TestEquivalentType(t *testing.T) {
diff --git a/plugin/parser/engine/pg/deparse.go b/backend/plugin/parser/engine/pg/deparse.go
similarity index 99%
rename from plugin/parser/engine/pg/deparse.go
rename to backend/plugin/parser/engine/pg/deparse.go
index ad281536b3..3db786db06 100644
--- a/plugin/parser/engine/pg/deparse.go
+++ b/backend/plugin/parser/engine/pg/deparse.go
@@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
func deparse(context parser.DeparseContext, in ast.Node, buf *strings.Builder) error {
diff --git a/plugin/parser/engine/pg/deparse_test.go b/backend/plugin/parser/engine/pg/deparse_test.go
similarity index 97%
rename from plugin/parser/engine/pg/deparse_test.go
rename to backend/plugin/parser/engine/pg/deparse_test.go
index b6af8781c5..fb5b3877d2 100644
--- a/plugin/parser/engine/pg/deparse_test.go
+++ b/backend/plugin/parser/engine/pg/deparse_test.go
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// TestDeparseData is the test data struct.
diff --git a/plugin/parser/engine/pg/empty_for_release.go b/backend/plugin/parser/engine/pg/empty_for_release.go
similarity index 100%
rename from plugin/parser/engine/pg/empty_for_release.go
rename to backend/plugin/parser/engine/pg/empty_for_release.go
diff --git a/plugin/parser/engine/pg/parser.go b/backend/plugin/parser/engine/pg/parser.go
similarity index 93%
rename from plugin/parser/engine/pg/parser.go
rename to backend/plugin/parser/engine/pg/parser.go
index 7235bbe58f..c0356ed792 100644
--- a/plugin/parser/engine/pg/parser.go
+++ b/backend/plugin/parser/engine/pg/parser.go
@@ -7,8 +7,8 @@ import (
pgquery "github.com/pganalyze/pg_query_go/v2"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
var (
diff --git a/plugin/parser/engine/pg/test-data/test_alter_sequence_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_alter_sequence_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_alter_sequence_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_alter_sequence_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_alter_table_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_alter_table_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_alter_table_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_alter_table_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_create_index_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_create_index_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_create_index_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_create_index_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_create_schema_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_create_schema_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_create_schema_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_create_schema_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_create_sequence_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_create_sequence_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_create_sequence_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_create_sequence_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_create_table_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_create_table_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_create_table_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_create_table_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_drop_index_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_drop_index_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_drop_index_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_drop_index_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_drop_schema_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_drop_schema_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_drop_schema_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_drop_schema_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_drop_sequence_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_drop_sequence_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_drop_sequence_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_drop_sequence_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_drop_table_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_drop_table_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_drop_table_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_drop_table_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_extension_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_extension_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_extension_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_extension_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_function_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_function_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_function_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_function_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_rename_schema_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_rename_schema_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_rename_schema_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_rename_schema_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_trigger_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_trigger_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_trigger_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_trigger_data.yaml
diff --git a/plugin/parser/engine/pg/test-data/test_type_data.yaml b/backend/plugin/parser/engine/pg/test-data/test_type_data.yaml
similarity index 100%
rename from plugin/parser/engine/pg/test-data/test_type_data.yaml
rename to backend/plugin/parser/engine/pg/test-data/test_type_data.yaml
diff --git a/plugin/parser/error.go b/backend/plugin/parser/error.go
similarity index 100%
rename from plugin/parser/error.go
rename to backend/plugin/parser/error.go
diff --git a/plugin/parser/parser.go b/backend/plugin/parser/parser.go
similarity index 97%
rename from plugin/parser/parser.go
rename to backend/plugin/parser/parser.go
index 3235e00c8a..1314237655 100644
--- a/plugin/parser/parser.go
+++ b/backend/plugin/parser/parser.go
@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
// EngineType is the type of a parser engine.
diff --git a/plugin/parser/set_line_for_create_table_test.go b/backend/plugin/parser/set_line_for_create_table_test.go
similarity index 96%
rename from plugin/parser/set_line_for_create_table_test.go
rename to backend/plugin/parser/set_line_for_create_table_test.go
index ee304d60ac..4d7ef15944 100644
--- a/plugin/parser/set_line_for_create_table_test.go
+++ b/backend/plugin/parser/set_line_for_create_table_test.go
@@ -8,11 +8,11 @@ import (
tidbast "github.com/pingcap/tidb/parser/ast"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
// Register postgres parser driver.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
)
diff --git a/plugin/parser/split_multi_sql_test.go b/backend/plugin/parser/split_multi_sql_test.go
similarity index 100%
rename from plugin/parser/split_multi_sql_test.go
rename to backend/plugin/parser/split_multi_sql_test.go
diff --git a/plugin/parser/tokenizer.go b/backend/plugin/parser/tokenizer.go
similarity index 99%
rename from plugin/parser/tokenizer.go
rename to backend/plugin/parser/tokenizer.go
index 2037e4b62a..b10add7133 100644
--- a/plugin/parser/tokenizer.go
+++ b/backend/plugin/parser/tokenizer.go
@@ -9,7 +9,7 @@ import (
tidbast "github.com/pingcap/tidb/parser/ast"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
const (
diff --git a/plugin/parser/transform/mysql/transform.go b/backend/plugin/parser/transform/mysql/transform.go
similarity index 96%
rename from plugin/parser/transform/mysql/transform.go
rename to backend/plugin/parser/transform/mysql/transform.go
index 91049afc52..1bcc97e285 100644
--- a/plugin/parser/transform/mysql/transform.go
+++ b/backend/plugin/parser/transform/mysql/transform.go
@@ -10,9 +10,9 @@ import (
"github.com/pingcap/tidb/parser/model"
"github.com/pkg/errors"
- bbparser "github.com/bytebase/bytebase/plugin/parser"
+ bbparser "github.com/bytebase/bytebase/backend/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/transform"
+ "github.com/bytebase/bytebase/backend/plugin/parser/transform"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
)
diff --git a/plugin/parser/transform/mysql/transform_test.go b/backend/plugin/parser/transform/mysql/transform_test.go
similarity index 100%
rename from plugin/parser/transform/mysql/transform_test.go
rename to backend/plugin/parser/transform/mysql/transform_test.go
diff --git a/plugin/parser/transform/transform.go b/backend/plugin/parser/transform/transform.go
similarity index 95%
rename from plugin/parser/transform/transform.go
rename to backend/plugin/parser/transform/transform.go
index 5b6e03c782..eb486fd625 100644
--- a/plugin/parser/transform/transform.go
+++ b/backend/plugin/parser/transform/transform.go
@@ -6,7 +6,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// SchemaTransformer is the interface for schema transformer.
diff --git a/plugin/parser/utils.go b/backend/plugin/parser/utils.go
similarity index 99%
rename from plugin/parser/utils.go
rename to backend/plugin/parser/utils.go
index 2e8a8edc42..4bade4835f 100644
--- a/plugin/parser/utils.go
+++ b/backend/plugin/parser/utils.go
@@ -13,7 +13,7 @@ import (
"github.com/pingcap/tidb/parser/model"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
)
// SingleSQL is a separate SQL split from multi-SQL.
diff --git a/plugin/parser/utils_test.go b/backend/plugin/parser/utils_test.go
similarity index 100%
rename from plugin/parser/utils_test.go
rename to backend/plugin/parser/utils_test.go
diff --git a/plugin/storage/s3/s3.go b/backend/plugin/storage/s3/s3.go
similarity index 100%
rename from plugin/storage/s3/s3.go
rename to backend/plugin/storage/s3/s3.go
diff --git a/plugin/storage/s3/s3_test.go b/backend/plugin/storage/s3/s3_test.go
similarity index 96%
rename from plugin/storage/s3/s3_test.go
rename to backend/plugin/storage/s3/s3_test.go
index 72b579b8a1..fe433aca2f 100644
--- a/plugin/storage/s3/s3_test.go
+++ b/backend/plugin/storage/s3/s3_test.go
@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
)
const (
diff --git a/plugin/vcs/CODENOTIFY b/backend/plugin/vcs/CODENOTIFY
similarity index 100%
rename from plugin/vcs/CODENOTIFY
rename to backend/plugin/vcs/CODENOTIFY
diff --git a/plugin/vcs/github/bytebase-sql-review.yml b/backend/plugin/vcs/github/bytebase-sql-review.yml
similarity index 100%
rename from plugin/vcs/github/bytebase-sql-review.yml
rename to backend/plugin/vcs/github/bytebase-sql-review.yml
diff --git a/plugin/vcs/github/github.go b/backend/plugin/vcs/github/github.go
similarity index 99%
rename from plugin/vcs/github/github.go
rename to backend/plugin/vcs/github/github.go
index 2a5e04502c..3f499f09cb 100644
--- a/plugin/vcs/github/github.go
+++ b/backend/plugin/vcs/github/github.go
@@ -21,10 +21,10 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/internal/oauth"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/internal/oauth"
)
const (
diff --git a/plugin/vcs/github/github_test.go b/backend/plugin/vcs/github/github_test.go
similarity index 99%
rename from plugin/vcs/github/github_test.go
rename to backend/plugin/vcs/github/github_test.go
index 35ed4b7a1a..ff251dba7f 100644
--- a/plugin/vcs/github/github_test.go
+++ b/backend/plugin/vcs/github/github_test.go
@@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/internal/oauth"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/internal/oauth"
)
func TestProvider_FetchUserInfo(t *testing.T) {
diff --git a/plugin/vcs/github/sql_review.go b/backend/plugin/vcs/github/sql_review.go
similarity index 91%
rename from plugin/vcs/github/sql_review.go
rename to backend/plugin/vcs/github/sql_review.go
index 49f04172e3..966c7b1c1b 100644
--- a/plugin/vcs/github/sql_review.go
+++ b/backend/plugin/vcs/github/sql_review.go
@@ -4,7 +4,7 @@ import (
_ "embed"
"fmt"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// sqlReviewAction is the GitHub action for SQL review in VCS workflow.
diff --git a/plugin/vcs/gitlab/bytebase-sql-review.yml b/backend/plugin/vcs/gitlab/bytebase-sql-review.yml
similarity index 100%
rename from plugin/vcs/gitlab/bytebase-sql-review.yml
rename to backend/plugin/vcs/gitlab/bytebase-sql-review.yml
diff --git a/plugin/vcs/gitlab/gitlab.go b/backend/plugin/vcs/gitlab/gitlab.go
similarity index 99%
rename from plugin/vcs/gitlab/gitlab.go
rename to backend/plugin/vcs/gitlab/gitlab.go
index eda585524b..259ebd923c 100644
--- a/plugin/vcs/gitlab/gitlab.go
+++ b/backend/plugin/vcs/gitlab/gitlab.go
@@ -15,9 +15,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/internal/oauth"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/internal/oauth"
)
const (
diff --git a/plugin/vcs/gitlab/gitlab_test.go b/backend/plugin/vcs/gitlab/gitlab_test.go
similarity index 99%
rename from plugin/vcs/gitlab/gitlab_test.go
rename to backend/plugin/vcs/gitlab/gitlab_test.go
index c14884bbc8..5d61c090be 100644
--- a/plugin/vcs/gitlab/gitlab_test.go
+++ b/backend/plugin/vcs/gitlab/gitlab_test.go
@@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/internal/oauth"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/internal/oauth"
)
func TestProvider_FetchUserInfo(t *testing.T) {
diff --git a/plugin/vcs/gitlab/sql_review.go b/backend/plugin/vcs/gitlab/sql_review.go
similarity index 97%
rename from plugin/vcs/gitlab/sql_review.go
rename to backend/plugin/vcs/gitlab/sql_review.go
index db17cb635d..09cc52657d 100644
--- a/plugin/vcs/gitlab/sql_review.go
+++ b/backend/plugin/vcs/gitlab/sql_review.go
@@ -6,7 +6,7 @@ import (
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
const (
diff --git a/plugin/vcs/gitlab/sql_review_test.go b/backend/plugin/vcs/gitlab/sql_review_test.go
similarity index 100%
rename from plugin/vcs/gitlab/sql_review_test.go
rename to backend/plugin/vcs/gitlab/sql_review_test.go
diff --git a/plugin/vcs/internal/oauth/oauth.go b/backend/plugin/vcs/internal/oauth/oauth.go
similarity index 100%
rename from plugin/vcs/internal/oauth/oauth.go
rename to backend/plugin/vcs/internal/oauth/oauth.go
diff --git a/plugin/vcs/internal/oauth/oauth_test.go b/backend/plugin/vcs/internal/oauth/oauth_test.go
similarity index 98%
rename from plugin/vcs/internal/oauth/oauth_test.go
rename to backend/plugin/vcs/internal/oauth/oauth_test.go
index d54ba90496..014df5e3d0 100644
--- a/plugin/vcs/internal/oauth/oauth_test.go
+++ b/backend/plugin/vcs/internal/oauth/oauth_test.go
@@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
func TestPost(t *testing.T) {
diff --git a/plugin/vcs/util.go b/backend/plugin/vcs/util.go
similarity index 98%
rename from plugin/vcs/util.go
rename to backend/plugin/vcs/util.go
index b8cc08625e..99805d1b17 100644
--- a/plugin/vcs/util.go
+++ b/backend/plugin/vcs/util.go
@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// Branch is the helper function returns the branch name from reference name.
diff --git a/plugin/vcs/util_test.go b/backend/plugin/vcs/util_test.go
similarity index 100%
rename from plugin/vcs/util_test.go
rename to backend/plugin/vcs/util_test.go
diff --git a/plugin/vcs/vcs.go b/backend/plugin/vcs/vcs.go
similarity index 99%
rename from plugin/vcs/vcs.go
rename to backend/plugin/vcs/vcs.go
index 6640ac0d83..2df497514d 100644
--- a/plugin/vcs/vcs.go
+++ b/backend/plugin/vcs/vcs.go
@@ -10,7 +10,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
// Type is the type of a VCS.
diff --git a/plugin/vcs/vcs_test.go b/backend/plugin/vcs/vcs_test.go
similarity index 100%
rename from plugin/vcs/vcs_test.go
rename to backend/plugin/vcs/vcs_test.go
diff --git a/plugin/webhook/custom.go b/backend/plugin/webhook/custom.go
similarity index 100%
rename from plugin/webhook/custom.go
rename to backend/plugin/webhook/custom.go
diff --git a/plugin/webhook/dingtalk.go b/backend/plugin/webhook/dingtalk.go
similarity index 100%
rename from plugin/webhook/dingtalk.go
rename to backend/plugin/webhook/dingtalk.go
diff --git a/plugin/webhook/discord.go b/backend/plugin/webhook/discord.go
similarity index 100%
rename from plugin/webhook/discord.go
rename to backend/plugin/webhook/discord.go
diff --git a/plugin/webhook/feishu.go b/backend/plugin/webhook/feishu.go
similarity index 100%
rename from plugin/webhook/feishu.go
rename to backend/plugin/webhook/feishu.go
diff --git a/plugin/webhook/slack.go b/backend/plugin/webhook/slack.go
similarity index 100%
rename from plugin/webhook/slack.go
rename to backend/plugin/webhook/slack.go
diff --git a/plugin/webhook/teams.go b/backend/plugin/webhook/teams.go
similarity index 100%
rename from plugin/webhook/teams.go
rename to backend/plugin/webhook/teams.go
diff --git a/plugin/webhook/webhook.go b/backend/plugin/webhook/webhook.go
similarity index 98%
rename from plugin/webhook/webhook.go
rename to backend/plugin/webhook/webhook.go
index 069c9ac76a..2bb6321b32 100644
--- a/plugin/webhook/webhook.go
+++ b/backend/plugin/webhook/webhook.go
@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
var (
diff --git a/plugin/webhook/webhook_test.go b/backend/plugin/webhook/webhook_test.go
similarity index 97%
rename from plugin/webhook/webhook_test.go
rename to backend/plugin/webhook/webhook_test.go
index 04cc3ee0c6..fd5cc2ca00 100644
--- a/plugin/webhook/webhook_test.go
+++ b/backend/plugin/webhook/webhook_test.go
@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
func TestContext_getMetaList(t *testing.T) {
diff --git a/plugin/webhook/wecom.go b/backend/plugin/webhook/wecom.go
similarity index 100%
rename from plugin/webhook/wecom.go
rename to backend/plugin/webhook/wecom.go
diff --git a/resources/README.md b/backend/resources/README.md
similarity index 100%
rename from resources/README.md
rename to backend/resources/README.md
diff --git a/resources/mongoutil/mongoutil.go b/backend/resources/mongoutil/mongoutil.go
similarity index 95%
rename from resources/mongoutil/mongoutil.go
rename to backend/resources/mongoutil/mongoutil.go
index a3f19da447..74ec8fe543 100644
--- a/resources/mongoutil/mongoutil.go
+++ b/backend/resources/mongoutil/mongoutil.go
@@ -10,8 +10,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/resources/utils"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/resources/utils"
)
// nolint
diff --git a/resources/mongoutil/resources_darwin_amd64.go b/backend/resources/mongoutil/resources_darwin_amd64.go
similarity index 100%
rename from resources/mongoutil/resources_darwin_amd64.go
rename to backend/resources/mongoutil/resources_darwin_amd64.go
diff --git a/resources/mongoutil/resources_darwin_arm64.go b/backend/resources/mongoutil/resources_darwin_arm64.go
similarity index 100%
rename from resources/mongoutil/resources_darwin_arm64.go
rename to backend/resources/mongoutil/resources_darwin_arm64.go
diff --git a/resources/mongoutil/resources_linux_amd64.go b/backend/resources/mongoutil/resources_linux_amd64.go
similarity index 100%
rename from resources/mongoutil/resources_linux_amd64.go
rename to backend/resources/mongoutil/resources_linux_amd64.go
diff --git a/resources/mysql/fetch_mysql.sh b/backend/resources/mysql/fetch_mysql.sh
similarity index 100%
rename from resources/mysql/fetch_mysql.sh
rename to backend/resources/mysql/fetch_mysql.sh
diff --git a/resources/mysql/mysql.go b/backend/resources/mysql/mysql.go
similarity index 99%
rename from resources/mysql/mysql.go
rename to backend/resources/mysql/mysql.go
index 53ed8f12a1..9f482f072a 100644
--- a/resources/mysql/mysql.go
+++ b/backend/resources/mysql/mysql.go
@@ -18,7 +18,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/resources/utils"
+ "github.com/bytebase/bytebase/backend/resources/utils"
// install mysql driver.
_ "github.com/go-sql-driver/mysql"
diff --git a/resources/mysql/resources_darwin.go b/backend/resources/mysql/resources_darwin.go
similarity index 100%
rename from resources/mysql/resources_darwin.go
rename to backend/resources/mysql/resources_darwin.go
diff --git a/resources/mysql/resources_linux.go b/backend/resources/mysql/resources_linux.go
similarity index 100%
rename from resources/mysql/resources_linux.go
rename to backend/resources/mysql/resources_linux.go
diff --git a/resources/mysqlutil/mysqlutil.go b/backend/resources/mysqlutil/mysqlutil.go
similarity index 97%
rename from resources/mysqlutil/mysqlutil.go
rename to backend/resources/mysqlutil/mysqlutil.go
index e167eb79cd..e34180c203 100644
--- a/resources/mysqlutil/mysqlutil.go
+++ b/backend/resources/mysqlutil/mysqlutil.go
@@ -13,8 +13,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/resources/utils"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/resources/utils"
)
type binaryName string
diff --git a/resources/mysqlutil/mysqlutil_test.go b/backend/resources/mysqlutil/mysqlutil_test.go
similarity index 100%
rename from resources/mysqlutil/mysqlutil_test.go
rename to backend/resources/mysqlutil/mysqlutil_test.go
diff --git a/resources/mysqlutil/resources_darwin_amd64.go b/backend/resources/mysqlutil/resources_darwin_amd64.go
similarity index 100%
rename from resources/mysqlutil/resources_darwin_amd64.go
rename to backend/resources/mysqlutil/resources_darwin_amd64.go
diff --git a/resources/mysqlutil/resources_darwin_arm64.go b/backend/resources/mysqlutil/resources_darwin_arm64.go
similarity index 100%
rename from resources/mysqlutil/resources_darwin_arm64.go
rename to backend/resources/mysqlutil/resources_darwin_arm64.go
diff --git a/resources/mysqlutil/resources_linux_amd64.go b/backend/resources/mysqlutil/resources_linux_amd64.go
similarity index 100%
rename from resources/mysqlutil/resources_linux_amd64.go
rename to backend/resources/mysqlutil/resources_linux_amd64.go
diff --git a/resources/mysqlutil/resources_linux_arm64.go b/backend/resources/mysqlutil/resources_linux_arm64.go
similarity index 100%
rename from resources/mysqlutil/resources_linux_arm64.go
rename to backend/resources/mysqlutil/resources_linux_arm64.go
diff --git a/resources/postgres/postgres.go b/backend/resources/postgres/postgres.go
similarity index 98%
rename from resources/postgres/postgres.go
rename to backend/resources/postgres/postgres.go
index 9e0d3af1a7..319471d463 100644
--- a/resources/postgres/postgres.go
+++ b/backend/resources/postgres/postgres.go
@@ -17,9 +17,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/resources/utils"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/resources/utils"
)
// isPgDump15 returns true if the pg_dump binary is version 15.
diff --git a/resources/postgres/resources_darwin.go b/backend/resources/postgres/resources_darwin.go
similarity index 100%
rename from resources/postgres/resources_darwin.go
rename to backend/resources/postgres/resources_darwin.go
diff --git a/resources/postgres/resources_linux_amd64.go b/backend/resources/postgres/resources_linux_amd64.go
similarity index 100%
rename from resources/postgres/resources_linux_amd64.go
rename to backend/resources/postgres/resources_linux_amd64.go
diff --git a/resources/postgres/resources_linux_arm64.go b/backend/resources/postgres/resources_linux_arm64.go
similarity index 100%
rename from resources/postgres/resources_linux_arm64.go
rename to backend/resources/postgres/resources_linux_arm64.go
diff --git a/resources/utils/extract.go b/backend/resources/utils/extract.go
similarity index 100%
rename from resources/utils/extract.go
rename to backend/resources/utils/extract.go
diff --git a/server/CODENOTIFY b/backend/server/CODENOTIFY
similarity index 100%
rename from server/CODENOTIFY
rename to backend/server/CODENOTIFY
diff --git a/server/acl.go b/backend/server/acl.go
similarity index 99%
rename from server/acl.go
rename to backend/server/acl.go
index 0e174901a4..105b5346c3 100644
--- a/server/acl.go
+++ b/backend/server/acl.go
@@ -14,9 +14,9 @@ import (
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/acl_casbin_model.conf b/backend/server/acl_casbin_model.conf
similarity index 100%
rename from server/acl_casbin_model.conf
rename to backend/server/acl_casbin_model.conf
diff --git a/server/acl_casbin_policy_dba.csv b/backend/server/acl_casbin_policy_dba.csv
similarity index 100%
rename from server/acl_casbin_policy_dba.csv
rename to backend/server/acl_casbin_policy_dba.csv
diff --git a/server/acl_casbin_policy_developer.csv b/backend/server/acl_casbin_policy_developer.csv
similarity index 100%
rename from server/acl_casbin_policy_developer.csv
rename to backend/server/acl_casbin_policy_developer.csv
diff --git a/server/acl_casbin_policy_owner.csv b/backend/server/acl_casbin_policy_owner.csv
similarity index 100%
rename from server/acl_casbin_policy_owner.csv
rename to backend/server/acl_casbin_policy_owner.csv
diff --git a/server/acl_project_test.go b/backend/server/acl_project_test.go
similarity index 99%
rename from server/acl_project_test.go
rename to backend/server/acl_project_test.go
index 43b8ec6e5e..1e7646a414 100644
--- a/server/acl_project_test.go
+++ b/backend/server/acl_project_test.go
@@ -4,8 +4,8 @@ import (
"net/url"
"testing"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
func TestEnforceWorkspaceDeveloperProjectRouteACL(t *testing.T) {
diff --git a/server/acl_sheet_test.go b/backend/server/acl_sheet_test.go
similarity index 99%
rename from server/acl_sheet_test.go
rename to backend/server/acl_sheet_test.go
index ddcc304d22..0ea9e6a130 100644
--- a/server/acl_sheet_test.go
+++ b/backend/server/acl_sheet_test.go
@@ -3,7 +3,7 @@ package server
import (
"testing"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func TestEnforceWorkspaceDeveloperSheetRouteACL(t *testing.T) {
diff --git a/server/acl_test_helper.go b/backend/server/acl_test_helper.go
similarity index 95%
rename from server/acl_test_helper.go
rename to backend/server/acl_test_helper.go
index fe2e1bd4ba..11b164d6e3 100644
--- a/server/acl_test_helper.go
+++ b/backend/server/acl_test_helper.go
@@ -1,8 +1,8 @@
package server
import (
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// map from project ID to the map of <role, principal ID>.
diff --git a/server/activity.go b/backend/server/activity.go
similarity index 97%
rename from server/activity.go
rename to backend/server/activity.go
index bac83446e4..3341509ca5 100644
--- a/server/activity.go
+++ b/backend/server/activity.go
@@ -9,9 +9,9 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/component/activity"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
)
func (s *Server) registerActivityRoutes(g *echo.Group) {
diff --git a/server/actuator.go b/backend/server/actuator.go
similarity index 92%
rename from server/actuator.go
rename to backend/server/actuator.go
index 7262464e49..3de12e21e5 100644
--- a/server/actuator.go
+++ b/backend/server/actuator.go
@@ -6,8 +6,8 @@ import (
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/store"
)
// demoDataPath is the path prefix for demo data.
diff --git a/server/anomaly.go b/backend/server/anomaly.go
similarity index 97%
rename from server/anomaly.go
rename to backend/server/anomaly.go
index a81bb18211..7c3017fb89 100644
--- a/server/anomaly.go
+++ b/backend/server/anomaly.go
@@ -8,7 +8,7 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func (s *Server) registerAnomalyRoutes(g *echo.Group) {
diff --git a/server/api/auth/auth.go b/backend/server/api/auth/auth.go
similarity index 98%
rename from server/api/auth/auth.go
rename to backend/server/api/auth/auth.go
index 71449296cc..b1be514ec1 100644
--- a/server/api/auth/auth.go
+++ b/backend/server/api/auth/auth.go
@@ -18,9 +18,9 @@ import (
"github.com/golang-jwt/jwt/v4"
errs "github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/api/auth/config.go b/backend/server/api/auth/config.go
similarity index 100%
rename from server/api/auth/config.go
rename to backend/server/api/auth/config.go
diff --git a/server/api/auth/header.go b/backend/server/api/auth/header.go
similarity index 100%
rename from server/api/auth/header.go
rename to backend/server/api/auth/header.go
diff --git a/server/api/v1/acl.go b/backend/server/api/v1/acl.go
similarity index 96%
rename from server/api/v1/acl.go
rename to backend/server/api/v1/acl.go
index f1bd2cc1e3..a7f0eef426 100644
--- a/server/api/v1/acl.go
+++ b/backend/server/api/v1/acl.go
@@ -10,12 +10,12 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/server/api/auth"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/server/api/auth"
- "github.com/bytebase/bytebase/store"
)
// ACLInterceptor is the v1 ACL interceptor for gRPC server.
diff --git a/server/api/v1/acl_config.go b/backend/server/api/v1/acl_config.go
similarity index 97%
rename from server/api/v1/acl_config.go
rename to backend/server/api/v1/acl_config.go
index 9f597879fd..b69540e949 100644
--- a/server/api/v1/acl_config.go
+++ b/backend/server/api/v1/acl_config.go
@@ -3,7 +3,7 @@ package v1
import (
"strings"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
const (
diff --git a/server/api/v1/auth_service.go b/backend/server/api/v1/auth_service.go
similarity index 96%
rename from server/api/v1/auth_service.go
rename to backend/server/api/v1/auth_service.go
index 67a00a381d..b9884bcb3b 100644
--- a/server/api/v1/auth_service.go
+++ b/backend/server/api/v1/auth_service.go
@@ -13,15 +13,15 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/server/api/auth"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/runner/metricreport"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/server/api/auth"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/runner/metricreport"
- "github.com/bytebase/bytebase/store"
)
// AuthService implements the auth service.
diff --git a/server/api/v1/common.go b/backend/server/api/v1/common.go
similarity index 100%
rename from server/api/v1/common.go
rename to backend/server/api/v1/common.go
diff --git a/server/api/v1/common_test.go b/backend/server/api/v1/common_test.go
similarity index 100%
rename from server/api/v1/common_test.go
rename to backend/server/api/v1/common_test.go
diff --git a/server/api/v1/database_service.go b/backend/server/api/v1/database_service.go
similarity index 98%
rename from server/api/v1/database_service.go
rename to backend/server/api/v1/database_service.go
index e8aeb12b72..f5aeec155e 100644
--- a/server/api/v1/database_service.go
+++ b/backend/server/api/v1/database_service.go
@@ -9,10 +9,10 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/store"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/store"
)
// DatabaseService implements the database service.
diff --git a/server/api/v1/docs.go b/backend/server/api/v1/docs.go
similarity index 100%
rename from server/api/v1/docs.go
rename to backend/server/api/v1/docs.go
diff --git a/server/api/v1/environment_service.go b/backend/server/api/v1/environment_service.go
similarity index 97%
rename from server/api/v1/environment_service.go
rename to backend/server/api/v1/environment_service.go
index df273f6693..bcbe8eb93a 100644
--- a/server/api/v1/environment_service.go
+++ b/backend/server/api/v1/environment_service.go
@@ -8,11 +8,11 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/store"
)
// EnvironmentService implements the environment service.
diff --git a/server/api/v1/idp_service.go b/backend/server/api/v1/idp_service.go
similarity index 98%
rename from server/api/v1/idp_service.go
rename to backend/server/api/v1/idp_service.go
index a2d51613d3..136f8c9d49 100644
--- a/server/api/v1/idp_service.go
+++ b/backend/server/api/v1/idp_service.go
@@ -10,11 +10,11 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/store"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/store"
)
// IdentityProviderService implements the identity provider service.
diff --git a/server/api/v1/instance_role_service.go b/backend/server/api/v1/instance_role_service.go
similarity index 97%
rename from server/api/v1/instance_role_service.go
rename to backend/server/api/v1/instance_role_service.go
index e81c24b6aa..5899a96c4b 100644
--- a/server/api/v1/instance_role_service.go
+++ b/backend/server/api/v1/instance_role_service.go
@@ -9,11 +9,11 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/store"
)
// InstanceRoleService implements the database role service.
diff --git a/server/api/v1/instance_service.go b/backend/server/api/v1/instance_service.go
similarity index 98%
rename from server/api/v1/instance_service.go
rename to backend/server/api/v1/instance_service.go
index e24bf00387..3bc30e35aa 100644
--- a/server/api/v1/instance_service.go
+++ b/backend/server/api/v1/instance_service.go
@@ -10,12 +10,12 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/store"
)
// InstanceService implements the instance service.
diff --git a/server/api/v1/org_policy_service.go b/backend/server/api/v1/org_policy_service.go
similarity index 98%
rename from server/api/v1/org_policy_service.go
rename to backend/server/api/v1/org_policy_service.go
index 4d4efdc632..495cc0f6bd 100644
--- a/server/api/v1/org_policy_service.go
+++ b/backend/server/api/v1/org_policy_service.go
@@ -12,12 +12,12 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/store"
)
// OrgPolicyService implements the workspace policy service.
diff --git a/server/api/v1/project_service.go b/backend/server/api/v1/project_service.go
similarity index 99%
rename from server/api/v1/project_service.go
rename to backend/server/api/v1/project_service.go
index fe545727c0..25fb4256f2 100644
--- a/server/api/v1/project_service.go
+++ b/backend/server/api/v1/project_service.go
@@ -10,10 +10,10 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/store"
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/store"
)
// ProjectService implements the project service.
diff --git a/server/api/v1/project_service_test.go b/backend/server/api/v1/project_service_test.go
similarity index 100%
rename from server/api/v1/project_service_test.go
rename to backend/server/api/v1/project_service_test.go
diff --git a/server/auth.go b/backend/server/auth.go
similarity index 97%
rename from server/auth.go
rename to backend/server/auth.go
index 86f3b9365f..d07ce2f09b 100644
--- a/server/auth.go
+++ b/backend/server/auth.go
@@ -10,11 +10,11 @@ import (
"github.com/labstack/echo/v4"
"golang.org/x/crypto/bcrypt"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerAuthRoutes(g *echo.Group) {
diff --git a/server/bookmark.go b/backend/server/bookmark.go
similarity index 97%
rename from server/bookmark.go
rename to backend/server/bookmark.go
index 2d423d38f1..d88596cb11 100644
--- a/server/bookmark.go
+++ b/backend/server/bookmark.go
@@ -8,8 +8,8 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
func (s *Server) registerBookmarkRoutes(g *echo.Group) {
diff --git a/server/component/activity/manager.go b/backend/server/component/activity/manager.go
similarity index 98%
rename from server/component/activity/manager.go
rename to backend/server/component/activity/manager.go
index 90eeaa4c73..19960010ce 100644
--- a/server/component/activity/manager.go
+++ b/backend/server/component/activity/manager.go
@@ -9,12 +9,12 @@ import (
"strconv"
"time"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/webhook"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/webhook"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
"github.com/pkg/errors"
"go.uber.org/zap"
diff --git a/server/component/config/profile.go b/backend/server/component/config/profile.go
similarity index 96%
rename from server/component/config/profile.go
rename to backend/server/component/config/profile.go
index 910190c007..3727106959 100644
--- a/server/component/config/profile.go
+++ b/backend/server/component/config/profile.go
@@ -4,8 +4,8 @@ package config
import (
"time"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// Profile is the configuration to start main server.
diff --git a/server/component/dbfactory/dbfactory.go b/backend/server/component/dbfactory/dbfactory.go
similarity index 94%
rename from server/component/dbfactory/dbfactory.go
rename to backend/server/component/dbfactory/dbfactory.go
index 2e3ec6ba70..14f39b1803 100644
--- a/server/component/dbfactory/dbfactory.go
+++ b/backend/server/component/dbfactory/dbfactory.go
@@ -4,11 +4,11 @@ package dbfactory
import (
"context"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// DBFactory is the factory for building database driver.
diff --git a/server/component/state/state.go b/backend/server/component/state/state.go
similarity index 97%
rename from server/component/state/state.go
rename to backend/server/component/state/state.go
index fa18300188..28837b0e93 100644
--- a/server/component/state/state.go
+++ b/backend/server/component/state/state.go
@@ -4,7 +4,7 @@ package state
import (
"sync"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// InstanceMaximumConnectionNumber is the maximum number of connections outstanding per instance.
diff --git a/server/database.go b/backend/server/database.go
similarity index 99%
rename from server/database.go
rename to backend/server/database.go
index 5daa341f1c..8d529cb74d 100644
--- a/server/database.go
+++ b/backend/server/database.go
@@ -13,13 +13,13 @@ import (
"go.uber.org/zap"
"google.golang.org/protobuf/encoding/protojson"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/edit"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/edit"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerDatabaseRoutes(g *echo.Group) {
diff --git a/server/debug.go b/backend/server/debug.go
similarity index 95%
rename from server/debug.go
rename to backend/server/debug.go
index 317495db83..a71ff04568 100644
--- a/server/debug.go
+++ b/backend/server/debug.go
@@ -7,8 +7,8 @@ import (
"github.com/labstack/echo/v4"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
)
func (s *Server) registerDebugRoutes(g *echo.Group) {
diff --git a/server/deploy.go b/backend/server/deploy.go
similarity index 100%
rename from server/deploy.go
rename to backend/server/deploy.go
diff --git a/server/environment.go b/backend/server/environment.go
similarity index 98%
rename from server/environment.go
rename to backend/server/environment.go
index e86769740a..74d5600043 100644
--- a/server/environment.go
+++ b/backend/server/environment.go
@@ -11,9 +11,9 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerEnvironmentRoutes(g *echo.Group) {
diff --git a/server/error_recorder.go b/backend/server/error_recorder.go
similarity index 96%
rename from server/error_recorder.go
rename to backend/server/error_recorder.go
index 18a1b1682d..e90f454592 100644
--- a/server/error_recorder.go
+++ b/backend/server/error_recorder.go
@@ -5,7 +5,7 @@ import (
"runtime/debug"
"time"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
"github.com/labstack/echo/v4"
)
diff --git a/server/inbox.go b/backend/server/inbox.go
similarity index 97%
rename from server/inbox.go
rename to backend/server/inbox.go
index 1d27c264c5..c9262e11a1 100644
--- a/server/inbox.go
+++ b/backend/server/inbox.go
@@ -8,8 +8,8 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
func (s *Server) registerInboxRoutes(g *echo.Group) {
diff --git a/server/instance.go b/backend/server/instance.go
similarity index 98%
rename from server/instance.go
rename to backend/server/instance.go
index 633a11b65e..833f482a08 100644
--- a/server/instance.go
+++ b/backend/server/instance.go
@@ -14,12 +14,12 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/store"
)
// pgConnectionInfo represents the embedded postgres instance connection info.
diff --git a/server/issue.go b/backend/server/issue.go
similarity index 99%
rename from server/issue.go
rename to backend/server/issue.go
index fa39539ef3..5d1d45c974 100644
--- a/server/issue.go
+++ b/backend/server/issue.go
@@ -16,15 +16,15 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerIssueRoutes(g *echo.Group) {
diff --git a/server/issue_subscriber.go b/backend/server/issue_subscriber.go
similarity index 97%
rename from server/issue_subscriber.go
rename to backend/server/issue_subscriber.go
index ebb12a9237..e9a0506476 100644
--- a/server/issue_subscriber.go
+++ b/backend/server/issue_subscriber.go
@@ -8,8 +8,8 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
func (s *Server) registerIssueSubscriberRoutes(g *echo.Group) {
diff --git a/server/issue_test.go b/backend/server/issue_test.go
similarity index 97%
rename from server/issue_test.go
rename to backend/server/issue_test.go
index 8ac7d61a72..c5a72b1cf7 100644
--- a/server/issue_test.go
+++ b/backend/server/issue_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
func TestCheckCharacterSetCollationOwner(t *testing.T) {
diff --git a/server/jwt.go b/backend/server/jwt.go
similarity index 98%
rename from server/jwt.go
rename to backend/server/jwt.go
index d43af59f26..c3bf2559ba 100644
--- a/server/jwt.go
+++ b/backend/server/jwt.go
@@ -12,9 +12,9 @@ import (
"github.com/labstack/echo/v4"
pkgerrors "github.com/pkg/errors"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/api/auth"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/api/auth"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/member.go b/backend/server/member.go
similarity index 98%
rename from server/member.go
rename to backend/server/member.go
index 6d34f8f4fc..9546751405 100644
--- a/server/member.go
+++ b/backend/server/member.go
@@ -9,9 +9,9 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerMemberRoutes(g *echo.Group) {
diff --git a/server/oauth.go b/backend/server/oauth.go
similarity index 92%
rename from server/oauth.go
rename to backend/server/oauth.go
index ea14f1cbad..24ee443e8d 100644
--- a/server/oauth.go
+++ b/backend/server/oauth.go
@@ -7,10 +7,10 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- vcsPlugin "github.com/bytebase/bytebase/plugin/vcs"
- _ "github.com/bytebase/bytebase/plugin/vcs/github" // Import to call the init until it is imported from somewhere else
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ vcsPlugin "github.com/bytebase/bytebase/backend/plugin/vcs"
+ _ "github.com/bytebase/bytebase/backend/plugin/vcs/github" // Import to call the init until it is imported from somewhere else
)
func (s *Server) registerOAuthRoutes(g *echo.Group) {
diff --git a/server/openapi_instance.go b/backend/server/openapi_instance.go
similarity index 95%
rename from server/openapi_instance.go
rename to backend/server/openapi_instance.go
index df49ecfed3..925aad9eec 100644
--- a/server/openapi_instance.go
+++ b/backend/server/openapi_instance.go
@@ -7,8 +7,8 @@ import (
"github.com/labstack/echo/v4"
- openAPIV1 "github.com/bytebase/bytebase/api/v1"
- "github.com/bytebase/bytebase/store"
+ openAPIV1 "github.com/bytebase/bytebase/backend/api/v1"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) updateInstanceDatabase(c echo.Context) error {
diff --git a/server/openapi_issue.go b/backend/server/openapi_issue.go
similarity index 92%
rename from server/openapi_issue.go
rename to backend/server/openapi_issue.go
index 058b8359d0..100c4375cb 100644
--- a/server/openapi_issue.go
+++ b/backend/server/openapi_issue.go
@@ -8,10 +8,10 @@ import (
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- openAPIV1 "github.com/bytebase/bytebase/api/v1"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ openAPIV1 "github.com/bytebase/bytebase/backend/api/v1"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) createIssueByOpenAPI(c echo.Context) error {
diff --git a/server/openapi_metric.go b/backend/server/openapi_metric.go
similarity index 88%
rename from server/openapi_metric.go
rename to backend/server/openapi_metric.go
index d6abee691d..0a5235c4ee 100644
--- a/server/openapi_metric.go
+++ b/backend/server/openapi_metric.go
@@ -6,8 +6,8 @@ import (
"github.com/labstack/echo/v4"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
)
func openAPIMetricMiddleware(s *Server, next echo.HandlerFunc) echo.HandlerFunc {
diff --git a/server/openapi_sql.go b/backend/server/openapi_sql.go
similarity index 94%
rename from server/openapi_sql.go
rename to backend/server/openapi_sql.go
index bb7726646e..6ad043e9c2 100644
--- a/server/openapi_sql.go
+++ b/backend/server/openapi_sql.go
@@ -9,14 +9,14 @@ import (
"github.com/labstack/echo/v4"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/differ"
- "github.com/bytebase/bytebase/store"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/differ"
+ "github.com/bytebase/bytebase/backend/store"
)
var (
diff --git a/server/policy.go b/backend/server/policy.go
similarity index 98%
rename from server/policy.go
rename to backend/server/policy.go
index 2333322c19..1c27de1092 100644
--- a/server/policy.go
+++ b/backend/server/policy.go
@@ -9,8 +9,8 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// hasAccessToUpdatePolicy checks if user can access to policy control feature.
diff --git a/server/principal.go b/backend/server/principal.go
similarity index 98%
rename from server/principal.go
rename to backend/server/principal.go
index 4ed272af7a..f9ba17ee8d 100644
--- a/server/principal.go
+++ b/backend/server/principal.go
@@ -10,9 +10,9 @@ import (
"github.com/labstack/echo/v4"
"golang.org/x/crypto/bcrypt"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/store"
)
// serviceAccountAccessKeyPrefix is the prefix for service account access key.
diff --git a/server/project.go b/backend/server/project.go
similarity index 99%
rename from server/project.go
rename to backend/server/project.go
index 7f1c47bd96..d43dcbd828 100644
--- a/server/project.go
+++ b/backend/server/project.go
@@ -18,14 +18,14 @@ import (
"go.uber.org/zap"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- vcsPlugin "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/github"
- "github.com/bytebase/bytebase/plugin/vcs/gitlab"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ vcsPlugin "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/github"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/project_member.go b/backend/server/project_member.go
similarity index 98%
rename from server/project_member.go
rename to backend/server/project_member.go
index fdfec30446..22c44aab4e 100644
--- a/server/project_member.go
+++ b/backend/server/project_member.go
@@ -9,9 +9,9 @@ import (
"github.com/labstack/echo/v4"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerProjectMemberRoutes(g *echo.Group) {
diff --git a/server/project_webhook.go b/backend/server/project_webhook.go
similarity index 97%
rename from server/project_webhook.go
rename to backend/server/project_webhook.go
index 8cb4a6ea55..6ece76fe18 100644
--- a/server/project_webhook.go
+++ b/backend/server/project_webhook.go
@@ -10,10 +10,10 @@ import (
"github.com/gosimple/slug"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- webhookPlugin "github.com/bytebase/bytebase/plugin/webhook"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ webhookPlugin "github.com/bytebase/bytebase/backend/plugin/webhook"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerProjectWebhookRoutes(g *echo.Group) {
diff --git a/server/recover.go b/backend/server/recover.go
similarity index 90%
rename from server/recover.go
rename to backend/server/recover.go
index ec4539babe..5b02bc588f 100644
--- a/server/recover.go
+++ b/backend/server/recover.go
@@ -5,7 +5,7 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
)
func recoverMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
diff --git a/server/runner/anomaly/scanner.go b/backend/server/runner/anomaly/scanner.go
similarity index 97%
rename from server/runner/anomaly/scanner.go
rename to backend/server/runner/anomaly/scanner.go
index 23fe9d04e1..3d27995ce7 100644
--- a/server/runner/anomaly/scanner.go
+++ b/backend/server/runner/anomaly/scanner.go
@@ -12,13 +12,13 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/runner/apprun/runner.go b/backend/server/runner/apprun/runner.go
similarity index 97%
rename from server/runner/apprun/runner.go
rename to backend/server/runner/apprun/runner.go
index 38434dc1a8..8b00491e4a 100644
--- a/server/runner/apprun/runner.go
+++ b/backend/server/runner/apprun/runner.go
@@ -11,13 +11,13 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/app/feishu"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/app/feishu"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewRunner returns a runner.
diff --git a/server/runner/backuprun/runner.go b/backend/server/runner/backuprun/runner.go
similarity index 96%
rename from server/runner/backuprun/runner.go
rename to backend/server/runner/backuprun/runner.go
index e57c64f8a1..ea4d8fa592 100644
--- a/server/runner/backuprun/runner.go
+++ b/backend/server/runner/backuprun/runner.go
@@ -17,17 +17,17 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- "github.com/bytebase/bytebase/plugin/storage/s3"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/plugin/storage/s3"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewRunner creates a new backup runner.
diff --git a/server/runner/metricreport/reporter.go b/backend/server/runner/metricreport/reporter.go
similarity index 91%
rename from server/runner/metricreport/reporter.go
rename to backend/server/runner/metricreport/reporter.go
index cd3aa15040..e1e303b6a9 100644
--- a/server/runner/metricreport/reporter.go
+++ b/backend/server/runner/metricreport/reporter.go
@@ -9,13 +9,13 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/plugin/metric"
- "github.com/bytebase/bytebase/plugin/metric/segment"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric/segment"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/store"
"go.uber.org/zap"
)
diff --git a/server/runner/rollbackrun/runner.go b/backend/server/runner/rollbackrun/runner.go
similarity index 93%
rename from server/runner/rollbackrun/runner.go
rename to backend/server/runner/rollbackrun/runner.go
index 7eb26f08f2..9370a17772 100644
--- a/server/runner/rollbackrun/runner.go
+++ b/backend/server/runner/rollbackrun/runner.go
@@ -11,13 +11,13 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewRunner creates a new rollback runner.
diff --git a/server/runner/schemasync/syncer.go b/backend/server/runner/schemasync/syncer.go
similarity index 95%
rename from server/runner/schemasync/syncer.go
rename to backend/server/runner/schemasync/syncer.go
index b0fa833a2c..3b13256f32 100644
--- a/server/runner/schemasync/syncer.go
+++ b/backend/server/runner/schemasync/syncer.go
@@ -13,15 +13,15 @@ import (
"go.uber.org/zap"
"google.golang.org/protobuf/testing/protocmp"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
)
const (
diff --git a/server/runner/schemasync/syncer_test.go b/backend/server/runner/schemasync/syncer_test.go
similarity index 100%
rename from server/runner/schemasync/syncer_test.go
rename to backend/server/runner/schemasync/syncer_test.go
diff --git a/server/runner/taskcheck/database_connect_executor.go b/backend/server/runner/taskcheck/database_connect_executor.go
similarity index 90%
rename from server/runner/taskcheck/database_connect_executor.go
rename to backend/server/runner/taskcheck/database_connect_executor.go
index ab8a958c59..3a0c306616 100644
--- a/server/runner/taskcheck/database_connect_executor.go
+++ b/backend/server/runner/taskcheck/database_connect_executor.go
@@ -4,10 +4,10 @@ import (
"context"
"fmt"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewDatabaseConnectExecutor creates a task check database connect executor.
diff --git a/server/runner/taskcheck/executor.go b/backend/server/runner/taskcheck/executor.go
similarity index 86%
rename from server/runner/taskcheck/executor.go
rename to backend/server/runner/taskcheck/executor.go
index 6fb46e8a67..74d0a27dfd 100644
--- a/server/runner/taskcheck/executor.go
+++ b/backend/server/runner/taskcheck/executor.go
@@ -3,7 +3,7 @@ package taskcheck
import (
"context"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// Executor is the task check executor.
diff --git a/server/runner/taskcheck/ghost_sync_executor.go b/backend/server/runner/taskcheck/ghost_sync_executor.go
similarity index 94%
rename from server/runner/taskcheck/ghost_sync_executor.go
rename to backend/server/runner/taskcheck/ghost_sync_executor.go
index b6467d22e1..29ba5efc29 100644
--- a/server/runner/taskcheck/ghost_sync_executor.go
+++ b/backend/server/runner/taskcheck/ghost_sync_executor.go
@@ -7,10 +7,10 @@ import (
"github.com/github/gh-ost/go/logic"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewGhostSyncExecutor creates a task check gh-ost sync executor.
diff --git a/server/runner/taskcheck/lgtm_executor.go b/backend/server/runner/taskcheck/lgtm_executor.go
similarity index 96%
rename from server/runner/taskcheck/lgtm_executor.go
rename to backend/server/runner/taskcheck/lgtm_executor.go
index 9e31744240..fb45259e35 100644
--- a/server/runner/taskcheck/lgtm_executor.go
+++ b/backend/server/runner/taskcheck/lgtm_executor.go
@@ -6,9 +6,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewLGTMExecutor creates a task check LGTM executor.
diff --git a/server/runner/taskcheck/migration_schema_executor.go b/backend/server/runner/taskcheck/migration_schema_executor.go
similarity index 89%
rename from server/runner/taskcheck/migration_schema_executor.go
rename to backend/server/runner/taskcheck/migration_schema_executor.go
index 2b26d63f97..258368743d 100644
--- a/server/runner/taskcheck/migration_schema_executor.go
+++ b/backend/server/runner/taskcheck/migration_schema_executor.go
@@ -4,10 +4,10 @@ import (
"context"
"fmt"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewMigrationSchemaExecutor creates a task check migration schema executor.
diff --git a/server/runner/taskcheck/pitr_mysql_executor.go b/backend/server/runner/taskcheck/pitr_mysql_executor.go
similarity index 90%
rename from server/runner/taskcheck/pitr_mysql_executor.go
rename to backend/server/runner/taskcheck/pitr_mysql_executor.go
index c2e5f1e49b..0c8d4bad6e 100644
--- a/server/runner/taskcheck/pitr_mysql_executor.go
+++ b/backend/server/runner/taskcheck/pitr_mysql_executor.go
@@ -6,11 +6,11 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewPITRMySQLExecutor creates a task check migration schema executor.
diff --git a/server/runner/taskcheck/scheduler.go b/backend/server/runner/taskcheck/scheduler.go
similarity index 97%
rename from server/runner/taskcheck/scheduler.go
rename to backend/server/runner/taskcheck/scheduler.go
index 56b31bb536..ba39a87c99 100644
--- a/server/runner/taskcheck/scheduler.go
+++ b/backend/server/runner/taskcheck/scheduler.go
@@ -11,13 +11,13 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/runner/taskcheck/statement_advisor_composite_executor.go b/backend/server/runner/taskcheck/statement_advisor_composite_executor.go
similarity index 92%
rename from server/runner/taskcheck/statement_advisor_composite_executor.go
rename to backend/server/runner/taskcheck/statement_advisor_composite_executor.go
index f147f210e6..77246b8779 100644
--- a/server/runner/taskcheck/statement_advisor_composite_executor.go
+++ b/backend/server/runner/taskcheck/statement_advisor_composite_executor.go
@@ -4,12 +4,12 @@ import (
"context"
"encoding/json"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/advisor"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/store"
)
// SQL review policy consists of a list of SQL review rules.
diff --git a/server/runner/taskcheck/statement_advisor_simple_executor.go b/backend/server/runner/taskcheck/statement_advisor_simple_executor.go
similarity index 89%
rename from server/runner/taskcheck/statement_advisor_simple_executor.go
rename to backend/server/runner/taskcheck/statement_advisor_simple_executor.go
index adb521efb9..753caadb5e 100644
--- a/server/runner/taskcheck/statement_advisor_simple_executor.go
+++ b/backend/server/runner/taskcheck/statement_advisor_simple_executor.go
@@ -4,11 +4,11 @@ import (
"context"
"encoding/json"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/advisor"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// NewStatementAdvisorSimpleExecutor creates a task check statement simple advisor executor.
diff --git a/server/runner/taskcheck/statement_type_executor.go b/backend/server/runner/taskcheck/statement_type_executor.go
similarity index 95%
rename from server/runner/taskcheck/statement_type_executor.go
rename to backend/server/runner/taskcheck/statement_type_executor.go
index 57ad04e230..4b951fab97 100644
--- a/server/runner/taskcheck/statement_type_executor.go
+++ b/backend/server/runner/taskcheck/statement_type_executor.go
@@ -8,13 +8,13 @@ import (
tidbparser "github.com/pingcap/tidb/parser"
tidbast "github.com/pingcap/tidb/parser/ast"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewStatementTypeExecutor creates a task check DML executor.
diff --git a/server/runner/taskcheck/statement_type_executor_test.go b/backend/server/runner/taskcheck/statement_type_executor_test.go
similarity index 96%
rename from server/runner/taskcheck/statement_type_executor_test.go
rename to backend/server/runner/taskcheck/statement_type_executor_test.go
index 99616a4d53..fc539ed110 100644
--- a/server/runner/taskcheck/statement_type_executor_test.go
+++ b/backend/server/runner/taskcheck/statement_type_executor_test.go
@@ -5,13 +5,13 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
// Register postgres parser driver.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
)
type testData struct {
diff --git a/server/runner/taskrun/data_update_executor.go b/backend/server/runner/taskrun/data_update_executor.go
similarity index 80%
rename from server/runner/taskrun/data_update_executor.go
rename to backend/server/runner/taskrun/data_update_executor.go
index 16a6c0ac03..2898ea06c6 100644
--- a/server/runner/taskrun/data_update_executor.go
+++ b/backend/server/runner/taskrun/data_update_executor.go
@@ -6,13 +6,13 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewDataUpdateExecutor creates a data update (DML) task executor.
diff --git a/server/runner/taskrun/database_backup_executor.go b/backend/server/runner/taskrun/database_backup_executor.go
similarity index 93%
rename from server/runner/taskrun/database_backup_executor.go
rename to backend/server/runner/taskrun/database_backup_executor.go
index 920a0380b9..a7cd6b675e 100644
--- a/server/runner/taskrun/database_backup_executor.go
+++ b/backend/server/runner/taskrun/database_backup_executor.go
@@ -11,14 +11,14 @@ import (
"go.uber.org/zap"
"golang.org/x/sys/unix"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- bbs3 "github.com/bytebase/bytebase/plugin/storage/s3"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/runner/backuprun"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/runner/backuprun"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/runner/taskrun/database_create_executor.go b/backend/server/runner/taskrun/database_create_executor.go
similarity index 95%
rename from server/runner/taskrun/database_create_executor.go
rename to backend/server/runner/taskrun/database_create_executor.go
index 2b41e93236..de5e93d6fc 100644
--- a/server/runner/taskrun/database_create_executor.go
+++ b/backend/server/runner/taskrun/database_create_executor.go
@@ -12,15 +12,15 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewDatabaseCreateExecutor creates a database create task executor.
diff --git a/server/runner/taskrun/database_create_executor_test.go b/backend/server/runner/taskrun/database_create_executor_test.go
similarity index 95%
rename from server/runner/taskrun/database_create_executor_test.go
rename to backend/server/runner/taskrun/database_create_executor_test.go
index f147a52f7d..56272ec6ec 100644
--- a/server/runner/taskrun/database_create_executor_test.go
+++ b/backend/server/runner/taskrun/database_create_executor_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/store"
)
func TestGetPeerTenantDatabase(t *testing.T) {
diff --git a/server/runner/taskrun/default_executor.go b/backend/server/runner/taskrun/default_executor.go
similarity index 86%
rename from server/runner/taskrun/default_executor.go
rename to backend/server/runner/taskrun/default_executor.go
index a87ed4cfef..55f46ebd70 100644
--- a/server/runner/taskrun/default_executor.go
+++ b/backend/server/runner/taskrun/default_executor.go
@@ -6,8 +6,8 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// NewDefaultExecutor creates a default task executor.
diff --git a/server/runner/taskrun/executor.go b/backend/server/runner/taskrun/executor.go
similarity index 96%
rename from server/runner/taskrun/executor.go
rename to backend/server/runner/taskrun/executor.go
index 3263c0e19d..a043d84ffe 100644
--- a/server/runner/taskrun/executor.go
+++ b/backend/server/runner/taskrun/executor.go
@@ -11,20 +11,20 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/transform"
- vcsPlugin "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/transform"
+ vcsPlugin "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// Executor is the task executor.
diff --git a/server/runner/taskrun/pitr_cutover_executor.go b/backend/server/runner/taskrun/pitr_cutover_executor.go
similarity index 94%
rename from server/runner/taskrun/pitr_cutover_executor.go
rename to backend/server/runner/taskrun/pitr_cutover_executor.go
index 6e298c7528..ed922d03af 100644
--- a/server/runner/taskrun/pitr_cutover_executor.go
+++ b/backend/server/runner/taskrun/pitr_cutover_executor.go
@@ -11,18 +11,18 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- "github.com/bytebase/bytebase/plugin/db/util"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/runner/backuprun"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/runner/backuprun"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewPITRCutoverExecutor creates a PITR cutover task executor.
diff --git a/server/runner/taskrun/pitr_restore_executor.go b/backend/server/runner/taskrun/pitr_restore_executor.go
similarity index 96%
rename from server/runner/taskrun/pitr_restore_executor.go
rename to backend/server/runner/taskrun/pitr_restore_executor.go
index cc24a5ca88..991a317536 100644
--- a/server/runner/taskrun/pitr_restore_executor.go
+++ b/backend/server/runner/taskrun/pitr_restore_executor.go
@@ -13,20 +13,20 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- "github.com/bytebase/bytebase/plugin/db/pg"
- "github.com/bytebase/bytebase/plugin/db/util"
- bbs3 "github.com/bytebase/bytebase/plugin/storage/s3"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/backuprun"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/plugin/db/pg"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/backuprun"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewPITRRestoreExecutor creates a PITR restore task executor.
diff --git a/server/runner/taskrun/scheduler.go b/backend/server/runner/taskrun/scheduler.go
similarity index 98%
rename from server/runner/taskrun/scheduler.go
rename to backend/server/runner/taskrun/scheduler.go
index d0de925456..2cf7f60997 100644
--- a/server/runner/taskrun/scheduler.go
+++ b/backend/server/runner/taskrun/scheduler.go
@@ -16,18 +16,18 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/apprun"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/apprun"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/runner/taskrun/scheduler_test.go b/backend/server/runner/taskrun/scheduler_test.go
similarity index 96%
rename from server/runner/taskrun/scheduler_test.go
rename to backend/server/runner/taskrun/scheduler_test.go
index d195a404c6..6f3616e147 100644
--- a/server/runner/taskrun/scheduler_test.go
+++ b/backend/server/runner/taskrun/scheduler_test.go
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func TestAreAllTasksDone(t *testing.T) {
diff --git a/server/runner/taskrun/schema_baseline_executor.go b/backend/server/runner/taskrun/schema_baseline_executor.go
similarity index 80%
rename from server/runner/taskrun/schema_baseline_executor.go
rename to backend/server/runner/taskrun/schema_baseline_executor.go
index 509be39068..ba0c5f0342 100644
--- a/server/runner/taskrun/schema_baseline_executor.go
+++ b/backend/server/runner/taskrun/schema_baseline_executor.go
@@ -7,15 +7,15 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewSchemaBaselineExecutor creates a schema baseline task executor.
diff --git a/server/runner/taskrun/schema_update_executor.go b/backend/server/runner/taskrun/schema_update_executor.go
similarity index 82%
rename from server/runner/taskrun/schema_update_executor.go
rename to backend/server/runner/taskrun/schema_update_executor.go
index 0df3fdd4b1..ed632619c9 100644
--- a/server/runner/taskrun/schema_update_executor.go
+++ b/backend/server/runner/taskrun/schema_update_executor.go
@@ -7,15 +7,15 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewSchemaUpdateExecutor creates a schema update (DDL) task executor.
diff --git a/server/runner/taskrun/schema_update_ghost_cutover_executor.go b/backend/server/runner/taskrun/schema_update_ghost_cutover_executor.go
similarity index 90%
rename from server/runner/taskrun/schema_update_ghost_cutover_executor.go
rename to backend/server/runner/taskrun/schema_update_ghost_cutover_executor.go
index 2516bb8084..6e67490144 100644
--- a/server/runner/taskrun/schema_update_ghost_cutover_executor.go
+++ b/backend/server/runner/taskrun/schema_update_ghost_cutover_executor.go
@@ -13,19 +13,19 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
- vcsPlugin "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ vcsPlugin "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewSchemaUpdateGhostCutoverExecutor creates a schema update (gh-ost) cutover task executor.
diff --git a/server/runner/taskrun/schema_update_ghost_sync_executor.go b/backend/server/runner/taskrun/schema_update_ghost_sync_executor.go
similarity index 93%
rename from server/runner/taskrun/schema_update_ghost_sync_executor.go
rename to backend/server/runner/taskrun/schema_update_ghost_sync_executor.go
index 69412fa15f..090a2b91a1 100644
--- a/server/runner/taskrun/schema_update_ghost_sync_executor.go
+++ b/backend/server/runner/taskrun/schema_update_ghost_sync_executor.go
@@ -12,12 +12,12 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewSchemaUpdateGhostSyncExecutor creates a schema update (gh-ost) sync task executor.
diff --git a/server/runner/taskrun/schema_update_sdl_executor.go b/backend/server/runner/taskrun/schema_update_sdl_executor.go
similarity index 84%
rename from server/runner/taskrun/schema_update_sdl_executor.go
rename to backend/server/runner/taskrun/schema_update_sdl_executor.go
index e5b5a77da6..b1b69babbe 100644
--- a/server/runner/taskrun/schema_update_sdl_executor.go
+++ b/backend/server/runner/taskrun/schema_update_sdl_executor.go
@@ -8,17 +8,17 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/differ"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/differ"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/store"
)
// NewSchemaUpdateSDLExecutor creates a schema update (SDL) task executor.
diff --git a/server/server.go b/backend/server/server.go
similarity index 89%
rename from server/server.go
rename to backend/server/server.go
index 89bb223da6..86f1e7b57f 100644
--- a/server/server.go
+++ b/backend/server/server.go
@@ -32,71 +32,71 @@ import (
v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ enterpriseService "github.com/bytebase/bytebase/backend/enterprise/service"
+ "github.com/bytebase/bytebase/backend/metric"
+ metricCollector "github.com/bytebase/bytebase/backend/metric/collector"
+ "github.com/bytebase/bytebase/backend/plugin/app/feishu"
+ bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3"
+ "github.com/bytebase/bytebase/backend/resources/mongoutil"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/server/api/auth"
+ v1 "github.com/bytebase/bytebase/backend/server/api/v1"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/server/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/server/component/state"
+ "github.com/bytebase/bytebase/backend/server/runner/anomaly"
+ "github.com/bytebase/bytebase/backend/server/runner/apprun"
+ "github.com/bytebase/bytebase/backend/server/runner/backuprun"
+ "github.com/bytebase/bytebase/backend/server/runner/metricreport"
+ "github.com/bytebase/bytebase/backend/server/runner/rollbackrun"
+ "github.com/bytebase/bytebase/backend/server/runner/schemasync"
+ "github.com/bytebase/bytebase/backend/server/runner/taskcheck"
+ "github.com/bytebase/bytebase/backend/server/runner/taskrun"
+ "github.com/bytebase/bytebase/backend/store"
_ "github.com/bytebase/bytebase/docs/openapi" // initial the swagger doc
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- enterpriseService "github.com/bytebase/bytebase/enterprise/service"
- "github.com/bytebase/bytebase/metric"
- metricCollector "github.com/bytebase/bytebase/metric/collector"
- "github.com/bytebase/bytebase/plugin/app/feishu"
- bbs3 "github.com/bytebase/bytebase/plugin/storage/s3"
- "github.com/bytebase/bytebase/resources/mongoutil"
- "github.com/bytebase/bytebase/resources/mysqlutil"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/server/api/auth"
- v1 "github.com/bytebase/bytebase/server/api/v1"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/server/component/dbfactory"
- "github.com/bytebase/bytebase/server/component/state"
- "github.com/bytebase/bytebase/server/runner/anomaly"
- "github.com/bytebase/bytebase/server/runner/apprun"
- "github.com/bytebase/bytebase/server/runner/backuprun"
- "github.com/bytebase/bytebase/server/runner/metricreport"
- "github.com/bytebase/bytebase/server/runner/rollbackrun"
- "github.com/bytebase/bytebase/server/runner/schemasync"
- "github.com/bytebase/bytebase/server/runner/taskcheck"
- "github.com/bytebase/bytebase/server/runner/taskrun"
- "github.com/bytebase/bytebase/store"
// Register clickhouse driver.
- _ "github.com/bytebase/bytebase/plugin/db/clickhouse"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/clickhouse"
// Register mysql driver.
- _ "github.com/bytebase/bytebase/plugin/db/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
// Register postgres driver.
- _ "github.com/bytebase/bytebase/plugin/db/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/pg"
// Register snowflake driver.
- _ "github.com/bytebase/bytebase/plugin/db/snowflake"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/snowflake"
// Register sqlite driver.
- _ "github.com/bytebase/bytebase/plugin/db/sqlite"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/sqlite"
// Register mongodb driver.
- _ "github.com/bytebase/bytebase/plugin/db/mongodb"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/mongodb"
// Register spanner driver.
- _ "github.com/bytebase/bytebase/plugin/db/spanner"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/spanner"
// Register pingcap parser driver.
_ "github.com/pingcap/tidb/types/parser_driver"
// Register fake advisor.
- _ "github.com/bytebase/bytebase/plugin/advisor/fake"
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor/fake"
// Register mysql advisor.
- _ "github.com/bytebase/bytebase/plugin/advisor/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor/mysql"
// Register postgresql advisor.
- _ "github.com/bytebase/bytebase/plugin/advisor/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/advisor/pg"
// Register mysql differ driver.
- _ "github.com/bytebase/bytebase/plugin/parser/differ/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/differ/mysql"
// Register postgres differ driver.
- _ "github.com/bytebase/bytebase/plugin/parser/differ/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/differ/pg"
// Register mysql edit driver.
- _ "github.com/bytebase/bytebase/plugin/parser/edit/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/edit/mysql"
// Register postgres edit driver.
- _ "github.com/bytebase/bytebase/plugin/parser/edit/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/edit/pg"
// Register postgres parser driver.
- _ "github.com/bytebase/bytebase/plugin/parser/engine/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/engine/pg"
// Register mysql transform driver.
- _ "github.com/bytebase/bytebase/plugin/parser/transform/mysql"
+ _ "github.com/bytebase/bytebase/backend/plugin/parser/transform/mysql"
)
const (
@@ -169,7 +169,7 @@ var casbinDBAPolicy string
var casbinDeveloperPolicy string
// Use following cmd to generate swagger doc
-// swag init -g ./server.go -d ./server --output docs/openapi --parseDependency
+// swag init -g ./backend/server.go -d ./backend/server --output docs/openapi --parseDependency
// @title Bytebase OpenAPI
// @version 1.0
diff --git a/server/server_frontend_embed.go b/backend/server/server_frontend_embed.go
similarity index 97%
rename from server/server_frontend_embed.go
rename to backend/server/server_frontend_embed.go
index d694826e1a..491c7f4f10 100644
--- a/server/server_frontend_embed.go
+++ b/backend/server/server_frontend_embed.go
@@ -12,7 +12,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
//go:embed dist/assets/*
diff --git a/server/server_frontend_not_embed.go b/backend/server/server_frontend_not_embed.go
similarity index 95%
rename from server/server_frontend_not_embed.go
rename to backend/server/server_frontend_not_embed.go
index 168a1b8342..88108b3b1e 100644
--- a/server/server_frontend_not_embed.go
+++ b/backend/server/server_frontend_not_embed.go
@@ -10,7 +10,7 @@ import (
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
)
func embedFrontend(e *echo.Echo) {
diff --git a/server/setting.go b/backend/server/setting.go
similarity index 96%
rename from server/setting.go
rename to backend/server/setting.go
index 02a8b7f47b..7bbe8598eb 100644
--- a/server/setting.go
+++ b/backend/server/setting.go
@@ -8,9 +8,9 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/app/feishu"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/app/feishu"
)
// Some settings contain secret info so we only return settings that are needed by the client.
diff --git a/server/sheet.go b/backend/server/sheet.go
similarity index 98%
rename from server/sheet.go
rename to backend/server/sheet.go
index 4c51ba3300..e83d515098 100644
--- a/server/sheet.go
+++ b/backend/server/sheet.go
@@ -11,9 +11,9 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerSheetRoutes(g *echo.Group) {
diff --git a/server/sheet_organizer.go b/backend/server/sheet_organizer.go
similarity index 96%
rename from server/sheet_organizer.go
rename to backend/server/sheet_organizer.go
index 5e6a0112da..dab16cc2fe 100644
--- a/server/sheet_organizer.go
+++ b/backend/server/sheet_organizer.go
@@ -8,7 +8,7 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func (s *Server) registerSheetOrganizerRoutes(g *echo.Group) {
diff --git a/server/sheet_test.go b/backend/server/sheet_test.go
similarity index 100%
rename from server/sheet_test.go
rename to backend/server/sheet_test.go
diff --git a/server/sql.go b/backend/server/sql.go
similarity index 97%
rename from server/sql.go
rename to backend/server/sql.go
index f59cc7828f..3776b96a56 100644
--- a/server/sql.go
+++ b/backend/server/sql.go
@@ -15,18 +15,18 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/util"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/plugin/parser/ast"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/util"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/plugin/parser/ast"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/store"
)
func (s *Server) registerSQLRoutes(g *echo.Group) {
diff --git a/server/sql_test.go b/backend/server/sql_test.go
similarity index 100%
rename from server/sql_test.go
rename to backend/server/sql_test.go
diff --git a/server/stage.go b/backend/server/stage.go
similarity index 98%
rename from server/stage.go
rename to backend/server/stage.go
index bf496dca70..fa34c04958 100644
--- a/server/stage.go
+++ b/backend/server/stage.go
@@ -8,7 +8,7 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func (s *Server) registerStageRoutes(g *echo.Group) {
diff --git a/server/subscription.go b/backend/server/subscription.go
similarity index 95%
rename from server/subscription.go
rename to backend/server/subscription.go
index a208b3fb53..a87fb4ec82 100644
--- a/server/subscription.go
+++ b/backend/server/subscription.go
@@ -9,11 +9,11 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
)
func (s *Server) registerSubscriptionRoutes(g *echo.Group) {
diff --git a/server/task.go b/backend/server/task.go
similarity index 98%
rename from server/task.go
rename to backend/server/task.go
index 44c232b190..23e0a754c5 100644
--- a/server/task.go
+++ b/backend/server/task.go
@@ -8,8 +8,8 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
func (s *Server) registerTaskRoutes(g *echo.Group) {
diff --git a/server/utils/utils.go b/backend/server/utils/utils.go
similarity index 98%
rename from server/utils/utils.go
rename to backend/server/utils/utils.go
index c41728b039..9d90f646f7 100644
--- a/server/utils/utils.go
+++ b/backend/server/utils/utils.go
@@ -13,10 +13,10 @@ import (
ghostsql "github.com/github/gh-ost/go/sql"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/store"
)
// GetLatestSchemaVersion gets the latest schema version for a database.
diff --git a/server/utils/utils_test.go b/backend/server/utils/utils_test.go
similarity index 98%
rename from server/utils/utils_test.go
rename to backend/server/utils/utils_test.go
index fef4e33dfe..1cef5a5567 100644
--- a/server/utils/utils_test.go
+++ b/backend/server/utils/utils_test.go
@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/store"
)
func TestGetDatabaseMatrixFromDeploymentSchedule(t *testing.T) {
diff --git a/server/vcs.go b/backend/server/vcs.go
similarity index 98%
rename from server/vcs.go
rename to backend/server/vcs.go
index 905a3a5ab2..cbe2c75e31 100644
--- a/server/vcs.go
+++ b/backend/server/vcs.go
@@ -9,9 +9,9 @@ import (
"github.com/google/jsonapi"
"github.com/labstack/echo/v4"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
func (s *Server) registerVCSRoutes(g *echo.Group) {
diff --git a/server/webhook.go b/backend/server/webhook.go
similarity index 98%
rename from server/webhook.go
rename to backend/server/webhook.go
index 370ae06997..6e907319de 100644
--- a/server/webhook.go
+++ b/backend/server/webhook.go
@@ -21,18 +21,18 @@ import (
"go.uber.org/zap"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/advisor"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/github"
- "github.com/bytebase/bytebase/plugin/vcs/gitlab"
- "github.com/bytebase/bytebase/server/component/activity"
- "github.com/bytebase/bytebase/server/utils"
- "github.com/bytebase/bytebase/store"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/github"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
+ "github.com/bytebase/bytebase/backend/server/component/activity"
+ "github.com/bytebase/bytebase/backend/server/utils"
+ "github.com/bytebase/bytebase/backend/store"
)
const (
diff --git a/server/webhook_test.go b/backend/server/webhook_test.go
similarity index 98%
rename from server/webhook_test.go
rename to backend/server/webhook_test.go
index c3e7f233e7..db785962f5 100644
--- a/server/webhook_test.go
+++ b/backend/server/webhook_test.go
@@ -6,10 +6,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// TODO(d): fix the double underscore "__".
diff --git a/sql-server/advise.go b/backend/sql-server/advise.go
similarity index 94%
rename from sql-server/advise.go
rename to backend/sql-server/advise.go
index 90135d5399..e8ca817645 100644
--- a/sql-server/advise.go
+++ b/backend/sql-server/advise.go
@@ -7,15 +7,15 @@ import (
"io"
"net/http"
- metricAPI "github.com/bytebase/bytebase/metric"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
"github.com/labstack/echo/v4"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/metric"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
)
var (
diff --git a/sql-server/metric.go b/backend/sql-server/metric.go
similarity index 87%
rename from sql-server/metric.go
rename to backend/sql-server/metric.go
index 331e841663..24b32ce42f 100644
--- a/sql-server/metric.go
+++ b/backend/sql-server/metric.go
@@ -7,9 +7,9 @@ import (
"github.com/labstack/echo/v4"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- metricAPI "github.com/bytebase/bytebase/metric"
- "github.com/bytebase/bytebase/plugin/metric"
+ "github.com/bytebase/bytebase/backend/common/log"
+ metricAPI "github.com/bytebase/bytebase/backend/metric"
+ "github.com/bytebase/bytebase/backend/plugin/metric"
)
type metricReporter struct {
diff --git a/sql-server/profile.go b/backend/sql-server/profile.go
similarity index 92%
rename from sql-server/profile.go
rename to backend/sql-server/profile.go
index 4e9c8f9e30..0e13a08438 100644
--- a/sql-server/profile.go
+++ b/backend/sql-server/profile.go
@@ -1,6 +1,6 @@
package sqlserver
-import "github.com/bytebase/bytebase/common"
+import "github.com/bytebase/bytebase/backend/common"
// Profile is the configuration to start main server.
type Profile struct {
diff --git a/sql-server/server.go b/backend/sql-server/server.go
similarity index 93%
rename from sql-server/server.go
rename to backend/sql-server/server.go
index b29c76050d..1f71813225 100644
--- a/sql-server/server.go
+++ b/backend/sql-server/server.go
@@ -9,16 +9,16 @@ import (
echoSwagger "github.com/swaggo/echo-swagger"
+ "github.com/bytebase/bytebase/backend/plugin/metric/segment"
_ "github.com/bytebase/bytebase/docs/sqlservice" // initial the swagger doc
- "github.com/bytebase/bytebase/plugin/metric/segment"
"github.com/labstack/echo-contrib/pprof"
"github.com/labstack/echo-contrib/prometheus"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// Server is the Bytebase server.
@@ -30,7 +30,7 @@ type Server struct {
}
// Use following cmd to generate swagger doc
-// swag init -g ./server.go -d ./sql-server --output docs/sqlservice --parseDependency
+// swag init -g ./backend/server.go -d ./backend/sql-server --output docs/sqlservice --parseDependency
// @title Bytebase SQL Service
// @version 1.0
diff --git a/store/CODENOTIFY b/backend/store/CODENOTIFY
similarity index 100%
rename from store/CODENOTIFY
rename to backend/store/CODENOTIFY
diff --git a/store/README.md b/backend/store/README.md
similarity index 100%
rename from store/README.md
rename to backend/store/README.md
diff --git a/store/activity.go b/backend/store/activity.go
similarity index 99%
rename from store/activity.go
rename to backend/store/activity.go
index e65b0d9f7f..a352669f00 100644
--- a/store/activity.go
+++ b/backend/store/activity.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// activityRaw is the store model for an Activity.
diff --git a/store/anomaly.go b/backend/store/anomaly.go
similarity index 99%
rename from store/anomaly.go
rename to backend/store/anomaly.go
index 0e48cc66b4..96b8ba72b0 100644
--- a/store/anomaly.go
+++ b/backend/store/anomaly.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// anomalyRaw is the store model for an Anomaly.
diff --git a/store/backup.go b/backend/store/backup.go
similarity index 99%
rename from store/backup.go
rename to backend/store/backup.go
index 427800912d..ab17f56b63 100644
--- a/store/backup.go
+++ b/backend/store/backup.go
@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// backupRaw is the store model for an Backup.
diff --git a/store/bookmark.go b/backend/store/bookmark.go
similarity index 98%
rename from store/bookmark.go
rename to backend/store/bookmark.go
index ed53677946..8817c981c4 100644
--- a/store/bookmark.go
+++ b/backend/store/bookmark.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// bookmarkRaw is the store model for an Bookmark.
diff --git a/store/cache.go b/backend/store/cache.go
similarity index 100%
rename from store/cache.go
rename to backend/store/cache.go
diff --git a/store/catalog.go b/backend/store/catalog.go
similarity index 82%
rename from store/catalog.go
rename to backend/store/catalog.go
index f08e57e604..df97b49754 100644
--- a/store/catalog.go
+++ b/backend/store/catalog.go
@@ -3,9 +3,9 @@ package store
import (
"context"
- "github.com/bytebase/bytebase/plugin/advisor/catalog"
- advisorDB "github.com/bytebase/bytebase/plugin/advisor/db"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/advisor/catalog"
+ advisorDB "github.com/bytebase/bytebase/backend/plugin/advisor/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
var (
diff --git a/store/data_source.go b/backend/store/data_source.go
similarity index 99%
rename from store/data_source.go
rename to backend/store/data_source.go
index c3022b5475..1f17458516 100644
--- a/store/data_source.go
+++ b/backend/store/data_source.go
@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// DataSourceMessage is the message for data source.
diff --git a/store/database.go b/backend/store/database.go
similarity index 99%
rename from store/database.go
rename to backend/store/database.go
index 83f5c83a4a..383b51c198 100644
--- a/store/database.go
+++ b/backend/store/database.go
@@ -10,8 +10,8 @@ import (
"github.com/lib/pq"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// FindDatabase finds a list of Database instances.
diff --git a/store/db_schema.go b/backend/store/db_schema.go
similarity index 100%
rename from store/db_schema.go
rename to backend/store/db_schema.go
diff --git a/store/demo/dev/10000##reset.sql b/backend/store/demo/dev/10000##reset.sql
similarity index 100%
rename from store/demo/dev/10000##reset.sql
rename to backend/store/demo/dev/10000##reset.sql
diff --git a/store/demo/dev/10001##principal.sql b/backend/store/demo/dev/10001##principal.sql
similarity index 100%
rename from store/demo/dev/10001##principal.sql
rename to backend/store/demo/dev/10001##principal.sql
diff --git a/store/demo/dev/10010##workspace.sql b/backend/store/demo/dev/10010##workspace.sql
similarity index 100%
rename from store/demo/dev/10010##workspace.sql
rename to backend/store/demo/dev/10010##workspace.sql
diff --git a/store/demo/dev/10020##member.sql b/backend/store/demo/dev/10020##member.sql
similarity index 100%
rename from store/demo/dev/10020##member.sql
rename to backend/store/demo/dev/10020##member.sql
diff --git a/store/demo/dev/10030##project.sql b/backend/store/demo/dev/10030##project.sql
similarity index 100%
rename from store/demo/dev/10030##project.sql
rename to backend/store/demo/dev/10030##project.sql
diff --git a/store/demo/dev/10040##project_member.sql b/backend/store/demo/dev/10040##project_member.sql
similarity index 100%
rename from store/demo/dev/10040##project_member.sql
rename to backend/store/demo/dev/10040##project_member.sql
diff --git a/store/demo/dev/10041##project_webhook.sql b/backend/store/demo/dev/10041##project_webhook.sql
similarity index 100%
rename from store/demo/dev/10041##project_webhook.sql
rename to backend/store/demo/dev/10041##project_webhook.sql
diff --git a/store/demo/dev/10050##environment.sql b/backend/store/demo/dev/10050##environment.sql
similarity index 100%
rename from store/demo/dev/10050##environment.sql
rename to backend/store/demo/dev/10050##environment.sql
diff --git a/store/demo/dev/10051##policy.sql b/backend/store/demo/dev/10051##policy.sql
similarity index 100%
rename from store/demo/dev/10051##policy.sql
rename to backend/store/demo/dev/10051##policy.sql
diff --git a/store/demo/dev/10060##instance.sql b/backend/store/demo/dev/10060##instance.sql
similarity index 100%
rename from store/demo/dev/10060##instance.sql
rename to backend/store/demo/dev/10060##instance.sql
diff --git a/store/demo/dev/10061##instance_user.sql b/backend/store/demo/dev/10061##instance_user.sql
similarity index 100%
rename from store/demo/dev/10061##instance_user.sql
rename to backend/store/demo/dev/10061##instance_user.sql
diff --git a/store/demo/dev/10070##db.sql b/backend/store/demo/dev/10070##db.sql
similarity index 100%
rename from store/demo/dev/10070##db.sql
rename to backend/store/demo/dev/10070##db.sql
diff --git a/store/demo/dev/10071##db_schema.sql b/backend/store/demo/dev/10071##db_schema.sql
similarity index 100%
rename from store/demo/dev/10071##db_schema.sql
rename to backend/store/demo/dev/10071##db_schema.sql
diff --git a/store/demo/dev/10074##backup.sql b/backend/store/demo/dev/10074##backup.sql
similarity index 100%
rename from store/demo/dev/10074##backup.sql
rename to backend/store/demo/dev/10074##backup.sql
diff --git a/store/demo/dev/10080##data_source.sql b/backend/store/demo/dev/10080##data_source.sql
similarity index 100%
rename from store/demo/dev/10080##data_source.sql
rename to backend/store/demo/dev/10080##data_source.sql
diff --git a/store/demo/dev/10090##pipeline.sql b/backend/store/demo/dev/10090##pipeline.sql
similarity index 100%
rename from store/demo/dev/10090##pipeline.sql
rename to backend/store/demo/dev/10090##pipeline.sql
diff --git a/store/demo/dev/10100##stage.sql b/backend/store/demo/dev/10100##stage.sql
similarity index 100%
rename from store/demo/dev/10100##stage.sql
rename to backend/store/demo/dev/10100##stage.sql
diff --git a/store/demo/dev/10110##task.sql b/backend/store/demo/dev/10110##task.sql
similarity index 100%
rename from store/demo/dev/10110##task.sql
rename to backend/store/demo/dev/10110##task.sql
diff --git a/store/demo/dev/10111##task_dag.sql b/backend/store/demo/dev/10111##task_dag.sql
similarity index 100%
rename from store/demo/dev/10111##task_dag.sql
rename to backend/store/demo/dev/10111##task_dag.sql
diff --git a/store/demo/dev/10120##task_run.sql b/backend/store/demo/dev/10120##task_run.sql
similarity index 100%
rename from store/demo/dev/10120##task_run.sql
rename to backend/store/demo/dev/10120##task_run.sql
diff --git a/store/demo/dev/10121##task_check_run.sql b/backend/store/demo/dev/10121##task_check_run.sql
similarity index 100%
rename from store/demo/dev/10121##task_check_run.sql
rename to backend/store/demo/dev/10121##task_check_run.sql
diff --git a/store/demo/dev/10130##issue.sql b/backend/store/demo/dev/10130##issue.sql
similarity index 100%
rename from store/demo/dev/10130##issue.sql
rename to backend/store/demo/dev/10130##issue.sql
diff --git a/store/demo/dev/10131##issue_subscriber.sql b/backend/store/demo/dev/10131##issue_subscriber.sql
similarity index 100%
rename from store/demo/dev/10131##issue_subscriber.sql
rename to backend/store/demo/dev/10131##issue_subscriber.sql
diff --git a/store/demo/dev/10140##activity.sql b/backend/store/demo/dev/10140##activity.sql
similarity index 100%
rename from store/demo/dev/10140##activity.sql
rename to backend/store/demo/dev/10140##activity.sql
diff --git a/store/demo/dev/10150##inbox.sql b/backend/store/demo/dev/10150##inbox.sql
similarity index 100%
rename from store/demo/dev/10150##inbox.sql
rename to backend/store/demo/dev/10150##inbox.sql
diff --git a/store/demo/dev/10160##bookmark.sql b/backend/store/demo/dev/10160##bookmark.sql
similarity index 100%
rename from store/demo/dev/10160##bookmark.sql
rename to backend/store/demo/dev/10160##bookmark.sql
diff --git a/store/demo/dev/10170##vcs.sql b/backend/store/demo/dev/10170##vcs.sql
similarity index 100%
rename from store/demo/dev/10170##vcs.sql
rename to backend/store/demo/dev/10170##vcs.sql
diff --git a/store/demo/dev/10180##repository.sql b/backend/store/demo/dev/10180##repository.sql
similarity index 100%
rename from store/demo/dev/10180##repository.sql
rename to backend/store/demo/dev/10180##repository.sql
diff --git a/store/demo/dev/10190##anomaly.sql b/backend/store/demo/dev/10190##anomaly.sql
similarity index 100%
rename from store/demo/dev/10190##anomaly.sql
rename to backend/store/demo/dev/10190##anomaly.sql
diff --git a/store/demo/dev/README.md b/backend/store/demo/dev/README.md
similarity index 100%
rename from store/demo/dev/README.md
rename to backend/store/demo/dev/README.md
diff --git a/store/demo/prod/10000##reset.sql b/backend/store/demo/prod/10000##reset.sql
similarity index 100%
rename from store/demo/prod/10000##reset.sql
rename to backend/store/demo/prod/10000##reset.sql
diff --git a/store/demo/prod/10001##principal.sql b/backend/store/demo/prod/10001##principal.sql
similarity index 100%
rename from store/demo/prod/10001##principal.sql
rename to backend/store/demo/prod/10001##principal.sql
diff --git a/store/demo/prod/10010##workspace.sql b/backend/store/demo/prod/10010##workspace.sql
similarity index 100%
rename from store/demo/prod/10010##workspace.sql
rename to backend/store/demo/prod/10010##workspace.sql
diff --git a/store/demo/prod/10020##member.sql b/backend/store/demo/prod/10020##member.sql
similarity index 100%
rename from store/demo/prod/10020##member.sql
rename to backend/store/demo/prod/10020##member.sql
diff --git a/store/demo/prod/10030##project.sql b/backend/store/demo/prod/10030##project.sql
similarity index 100%
rename from store/demo/prod/10030##project.sql
rename to backend/store/demo/prod/10030##project.sql
diff --git a/store/demo/prod/10040##project_member.sql b/backend/store/demo/prod/10040##project_member.sql
similarity index 100%
rename from store/demo/prod/10040##project_member.sql
rename to backend/store/demo/prod/10040##project_member.sql
diff --git a/store/demo/prod/10041##project_webhook.sql b/backend/store/demo/prod/10041##project_webhook.sql
similarity index 100%
rename from store/demo/prod/10041##project_webhook.sql
rename to backend/store/demo/prod/10041##project_webhook.sql
diff --git a/store/demo/prod/10050##environment.sql b/backend/store/demo/prod/10050##environment.sql
similarity index 100%
rename from store/demo/prod/10050##environment.sql
rename to backend/store/demo/prod/10050##environment.sql
diff --git a/store/demo/prod/10051##policy.sql b/backend/store/demo/prod/10051##policy.sql
similarity index 100%
rename from store/demo/prod/10051##policy.sql
rename to backend/store/demo/prod/10051##policy.sql
diff --git a/store/demo/prod/10060##instance.sql b/backend/store/demo/prod/10060##instance.sql
similarity index 100%
rename from store/demo/prod/10060##instance.sql
rename to backend/store/demo/prod/10060##instance.sql
diff --git a/store/demo/prod/10061##instance_user.sql b/backend/store/demo/prod/10061##instance_user.sql
similarity index 100%
rename from store/demo/prod/10061##instance_user.sql
rename to backend/store/demo/prod/10061##instance_user.sql
diff --git a/store/demo/prod/10070##db.sql b/backend/store/demo/prod/10070##db.sql
similarity index 100%
rename from store/demo/prod/10070##db.sql
rename to backend/store/demo/prod/10070##db.sql
diff --git a/store/demo/prod/10071##db_schema.sql b/backend/store/demo/prod/10071##db_schema.sql
similarity index 100%
rename from store/demo/prod/10071##db_schema.sql
rename to backend/store/demo/prod/10071##db_schema.sql
diff --git a/store/demo/prod/10074##backup.sql b/backend/store/demo/prod/10074##backup.sql
similarity index 100%
rename from store/demo/prod/10074##backup.sql
rename to backend/store/demo/prod/10074##backup.sql
diff --git a/store/demo/prod/10080##data_source.sql b/backend/store/demo/prod/10080##data_source.sql
similarity index 100%
rename from store/demo/prod/10080##data_source.sql
rename to backend/store/demo/prod/10080##data_source.sql
diff --git a/store/demo/prod/10090##pipeline.sql b/backend/store/demo/prod/10090##pipeline.sql
similarity index 100%
rename from store/demo/prod/10090##pipeline.sql
rename to backend/store/demo/prod/10090##pipeline.sql
diff --git a/store/demo/prod/10100##stage.sql b/backend/store/demo/prod/10100##stage.sql
similarity index 100%
rename from store/demo/prod/10100##stage.sql
rename to backend/store/demo/prod/10100##stage.sql
diff --git a/store/demo/prod/10110##task.sql b/backend/store/demo/prod/10110##task.sql
similarity index 100%
rename from store/demo/prod/10110##task.sql
rename to backend/store/demo/prod/10110##task.sql
diff --git a/store/demo/prod/10111##task_dag.sql b/backend/store/demo/prod/10111##task_dag.sql
similarity index 100%
rename from store/demo/prod/10111##task_dag.sql
rename to backend/store/demo/prod/10111##task_dag.sql
diff --git a/store/demo/prod/10120##task_run.sql b/backend/store/demo/prod/10120##task_run.sql
similarity index 100%
rename from store/demo/prod/10120##task_run.sql
rename to backend/store/demo/prod/10120##task_run.sql
diff --git a/store/demo/prod/10121##task_check_run.sql b/backend/store/demo/prod/10121##task_check_run.sql
similarity index 100%
rename from store/demo/prod/10121##task_check_run.sql
rename to backend/store/demo/prod/10121##task_check_run.sql
diff --git a/store/demo/prod/10130##issue.sql b/backend/store/demo/prod/10130##issue.sql
similarity index 100%
rename from store/demo/prod/10130##issue.sql
rename to backend/store/demo/prod/10130##issue.sql
diff --git a/store/demo/prod/10131##issue_subscriber.sql b/backend/store/demo/prod/10131##issue_subscriber.sql
similarity index 100%
rename from store/demo/prod/10131##issue_subscriber.sql
rename to backend/store/demo/prod/10131##issue_subscriber.sql
diff --git a/store/demo/prod/10140##activity.sql b/backend/store/demo/prod/10140##activity.sql
similarity index 100%
rename from store/demo/prod/10140##activity.sql
rename to backend/store/demo/prod/10140##activity.sql
diff --git a/store/demo/prod/10150##inbox.sql b/backend/store/demo/prod/10150##inbox.sql
similarity index 100%
rename from store/demo/prod/10150##inbox.sql
rename to backend/store/demo/prod/10150##inbox.sql
diff --git a/store/demo/prod/10160##bookmark.sql b/backend/store/demo/prod/10160##bookmark.sql
similarity index 100%
rename from store/demo/prod/10160##bookmark.sql
rename to backend/store/demo/prod/10160##bookmark.sql
diff --git a/store/demo/prod/10170##vcs.sql b/backend/store/demo/prod/10170##vcs.sql
similarity index 100%
rename from store/demo/prod/10170##vcs.sql
rename to backend/store/demo/prod/10170##vcs.sql
diff --git a/store/demo/prod/10180##repository.sql b/backend/store/demo/prod/10180##repository.sql
similarity index 100%
rename from store/demo/prod/10180##repository.sql
rename to backend/store/demo/prod/10180##repository.sql
diff --git a/store/demo/prod/10190##anomaly.sql b/backend/store/demo/prod/10190##anomaly.sql
similarity index 100%
rename from store/demo/prod/10190##anomaly.sql
rename to backend/store/demo/prod/10190##anomaly.sql
diff --git a/store/demo/prod/README.md b/backend/store/demo/prod/README.md
similarity index 100%
rename from store/demo/prod/README.md
rename to backend/store/demo/prod/README.md
diff --git a/store/demo/schema-migration-history/10000##reset.sql b/backend/store/demo/schema-migration-history/10000##reset.sql
similarity index 100%
rename from store/demo/schema-migration-history/10000##reset.sql
rename to backend/store/demo/schema-migration-history/10000##reset.sql
diff --git a/store/demo/schema-migration-history/10001##data.sql b/backend/store/demo/schema-migration-history/10001##data.sql
similarity index 100%
rename from store/demo/schema-migration-history/10001##data.sql
rename to backend/store/demo/schema-migration-history/10001##data.sql
diff --git a/store/deploy.go b/backend/store/deploy.go
similarity index 98%
rename from store/deploy.go
rename to backend/store/deploy.go
index 8ca434810d..b6cb3c011f 100644
--- a/store/deploy.go
+++ b/backend/store/deploy.go
@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// deploymentConfigRaw is the store model for an DeploymentConfig.
diff --git a/store/environment.go b/backend/store/environment.go
similarity index 99%
rename from store/environment.go
rename to backend/store/environment.go
index 43dc31af6c..052577a327 100644
--- a/store/environment.go
+++ b/backend/store/environment.go
@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// EnvironmentCreate is the API message for creating an environment.
diff --git a/store/external_approval.go b/backend/store/external_approval.go
similarity index 98%
rename from store/external_approval.go
rename to backend/store/external_approval.go
index d32a9234b1..00ec906871 100644
--- a/store/external_approval.go
+++ b/backend/store/external_approval.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
type externalApprovalRaw struct {
diff --git a/store/idp.go b/backend/store/idp.go
similarity index 99%
rename from store/idp.go
rename to backend/store/idp.go
index 528795f0f0..47ce6b66cd 100644
--- a/store/idp.go
+++ b/backend/store/idp.go
@@ -9,8 +9,8 @@ import (
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
diff --git a/store/inbox.go b/backend/store/inbox.go
similarity index 99%
rename from store/inbox.go
rename to backend/store/inbox.go
index 339134db4e..d79433ec31 100644
--- a/store/inbox.go
+++ b/backend/store/inbox.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// inboxRaw is the store model for an Inbox.
diff --git a/store/instance.go b/backend/store/instance.go
similarity index 99%
rename from store/instance.go
rename to backend/store/instance.go
index 21551c8362..ef97adc12f 100644
--- a/store/instance.go
+++ b/backend/store/instance.go
@@ -10,9 +10,9 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// GetInstanceByID gets an instance of Instance.
diff --git a/store/instance_user.go b/backend/store/instance_user.go
similarity index 98%
rename from store/instance_user.go
rename to backend/store/instance_user.go
index f978cff1f5..d2f40d1ad1 100644
--- a/store/instance_user.go
+++ b/backend/store/instance_user.go
@@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// InstanceUserMessage is the mssage for instance user.
diff --git a/store/instance_user_test.go b/backend/store/instance_user_test.go
similarity index 100%
rename from store/instance_user_test.go
rename to backend/store/instance_user_test.go
diff --git a/store/issue.go b/backend/store/issue.go
similarity index 99%
rename from store/issue.go
rename to backend/store/issue.go
index d9303b8f4a..5f07fd005a 100644
--- a/store/issue.go
+++ b/backend/store/issue.go
@@ -11,8 +11,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// issueRaw is the store model for an Issue.
diff --git a/store/issue_subscriber.go b/backend/store/issue_subscriber.go
similarity index 98%
rename from store/issue_subscriber.go
rename to backend/store/issue_subscriber.go
index d216036300..6fca1bb943 100644
--- a/store/issue_subscriber.go
+++ b/backend/store/issue_subscriber.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// issueSubscriberRaw is the store model for an IssueSubscriber.
diff --git a/store/metadb.go b/backend/store/metadb.go
similarity index 96%
rename from store/metadb.go
rename to backend/store/metadb.go
index acfde27f1f..30025a4505 100644
--- a/store/metadb.go
+++ b/backend/store/metadb.go
@@ -8,10 +8,10 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- dbdriver "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/postgres"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ dbdriver "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
)
// MetadataDB abstracts the underlying Postgres instance.
diff --git a/store/migration/dev/20220408000000##schema_version_type.sql b/backend/store/migration/dev/20220408000000##schema_version_type.sql
similarity index 100%
rename from store/migration/dev/20220408000000##schema_version_type.sql
rename to backend/store/migration/dev/20220408000000##schema_version_type.sql
diff --git a/store/migration/dev/20230117000000##idp.sql b/backend/store/migration/dev/20230117000000##idp.sql
similarity index 100%
rename from store/migration/dev/20230117000000##idp.sql
rename to backend/store/migration/dev/20230117000000##idp.sql
diff --git a/store/migration/dev/LATEST.sql b/backend/store/migration/dev/LATEST.sql
similarity index 100%
rename from store/migration/dev/LATEST.sql
rename to backend/store/migration/dev/LATEST.sql
diff --git a/store/migration/dev/LATEST_DATA.sql b/backend/store/migration/dev/LATEST_DATA.sql
similarity index 100%
rename from store/migration/dev/LATEST_DATA.sql
rename to backend/store/migration/dev/LATEST_DATA.sql
diff --git a/store/migration/prod/1.0/0000##initial_schema.sql b/backend/store/migration/prod/1.0/0000##initial_schema.sql
similarity index 100%
rename from store/migration/prod/1.0/0000##initial_schema.sql
rename to backend/store/migration/prod/1.0/0000##initial_schema.sql
diff --git a/store/migration/prod/1.0/0001##initial_data.sql b/backend/store/migration/prod/1.0/0001##initial_data.sql
similarity index 100%
rename from store/migration/prod/1.0/0001##initial_data.sql
rename to backend/store/migration/prod/1.0/0001##initial_data.sql
diff --git a/store/migration/prod/1.1/0000##db_extension.sql b/backend/store/migration/prod/1.1/0000##db_extension.sql
similarity index 100%
rename from store/migration/prod/1.1/0000##db_extension.sql
rename to backend/store/migration/prod/1.1/0000##db_extension.sql
diff --git a/store/migration/prod/1.1/0001##sheet_vcs.sql b/backend/store/migration/prod/1.1/0001##sheet_vcs.sql
similarity index 100%
rename from store/migration/prod/1.1/0001##sheet_vcs.sql
rename to backend/store/migration/prod/1.1/0001##sheet_vcs.sql
diff --git a/store/migration/prod/1.1/0002##sheet_organizer.sql b/backend/store/migration/prod/1.1/0002##sheet_organizer.sql
similarity index 100%
rename from store/migration/prod/1.1/0002##sheet_organizer.sql
rename to backend/store/migration/prod/1.1/0002##sheet_organizer.sql
diff --git a/store/migration/prod/1.10/0000##db_schema.sql b/backend/store/migration/prod/1.10/0000##db_schema.sql
similarity index 100%
rename from store/migration/prod/1.10/0000##db_schema.sql
rename to backend/store/migration/prod/1.10/0000##db_schema.sql
diff --git a/store/migration/prod/1.10/0001##add_idx_db_project_id.sql b/backend/store/migration/prod/1.10/0001##add_idx_db_project_id.sql
similarity index 100%
rename from store/migration/prod/1.10/0001##add_idx_db_project_id.sql
rename to backend/store/migration/prod/1.10/0001##add_idx_db_project_id.sql
diff --git a/store/migration/prod/1.10/0002##resource_id.sql b/backend/store/migration/prod/1.10/0002##resource_id.sql
similarity index 100%
rename from store/migration/prod/1.10/0002##resource_id.sql
rename to backend/store/migration/prod/1.10/0002##resource_id.sql
diff --git a/store/migration/prod/1.10/0003##mongo_instance_type.sql b/backend/store/migration/prod/1.10/0003##mongo_instance_type.sql
similarity index 100%
rename from store/migration/prod/1.10/0003##mongo_instance_type.sql
rename to backend/store/migration/prod/1.10/0003##mongo_instance_type.sql
diff --git a/store/migration/prod/1.10/0004##add_datasource_option.sql b/backend/store/migration/prod/1.10/0004##add_datasource_option.sql
similarity index 100%
rename from store/migration/prod/1.10/0004##add_datasource_option.sql
rename to backend/store/migration/prod/1.10/0004##add_datasource_option.sql
diff --git a/store/migration/prod/1.10/0005##data_source.sql b/backend/store/migration/prod/1.10/0005##data_source.sql
similarity index 100%
rename from store/migration/prod/1.10/0005##data_source.sql
rename to backend/store/migration/prod/1.10/0005##data_source.sql
diff --git a/store/migration/prod/1.11/0000##add_instance_engine_spanner.sql b/backend/store/migration/prod/1.11/0000##add_instance_engine_spanner.sql
similarity index 100%
rename from store/migration/prod/1.11/0000##add_instance_engine_spanner.sql
rename to backend/store/migration/prod/1.11/0000##add_instance_engine_spanner.sql
diff --git a/store/migration/prod/1.11/0001##change_migration_history_id_type_to_string.sql b/backend/store/migration/prod/1.11/0001##change_migration_history_id_type_to_string.sql
similarity index 100%
rename from store/migration/prod/1.11/0001##change_migration_history_id_type_to_string.sql
rename to backend/store/migration/prod/1.11/0001##change_migration_history_id_type_to_string.sql
diff --git a/store/migration/prod/1.2/0000##backup.sql b/backend/store/migration/prod/1.2/0000##backup.sql
similarity index 100%
rename from store/migration/prod/1.2/0000##backup.sql
rename to backend/store/migration/prod/1.2/0000##backup.sql
diff --git a/store/migration/prod/1.2/0001##task_dag.sql b/backend/store/migration/prod/1.2/0001##task_dag.sql
similarity index 100%
rename from store/migration/prod/1.2/0001##task_dag.sql
rename to backend/store/migration/prod/1.2/0001##task_dag.sql
diff --git a/store/migration/prod/1.3/0000##idx_primary_key_column.sql b/backend/store/migration/prod/1.3/0000##idx_primary_key_column.sql
similarity index 100%
rename from store/migration/prod/1.3/0000##idx_primary_key_column.sql
rename to backend/store/migration/prod/1.3/0000##idx_primary_key_column.sql
diff --git a/store/migration/prod/1.3/0001##github_com.sql b/backend/store/migration/prod/1.3/0001##github_com.sql
similarity index 100%
rename from store/migration/prod/1.3/0001##github_com.sql
rename to backend/store/migration/prod/1.3/0001##github_com.sql
diff --git a/store/migration/prod/1.3/0002##backup_type_pitr.sql b/backend/store/migration/prod/1.3/0002##backup_type_pitr.sql
similarity index 100%
rename from store/migration/prod/1.3/0002##backup_type_pitr.sql
rename to backend/store/migration/prod/1.3/0002##backup_type_pitr.sql
diff --git a/store/migration/prod/1.3/0003##backup_retention.sql b/backend/store/migration/prod/1.3/0003##backup_retention.sql
similarity index 100%
rename from store/migration/prod/1.3/0003##backup_retention.sql
rename to backend/store/migration/prod/1.3/0003##backup_retention.sql
diff --git a/store/migration/prod/1.3/0004##fix_container_id.sql b/backend/store/migration/prod/1.3/0004##fix_container_id.sql
similarity index 100%
rename from store/migration/prod/1.3/0004##fix_container_id.sql
rename to backend/store/migration/prod/1.3/0004##fix_container_id.sql
diff --git a/store/migration/prod/1.4/0000##add_project_schema_change_type.sql b/backend/store/migration/prod/1.4/0000##add_project_schema_change_type.sql
similarity index 100%
rename from store/migration/prod/1.4/0000##add_project_schema_change_type.sql
rename to backend/store/migration/prod/1.4/0000##add_project_schema_change_type.sql
diff --git a/store/migration/prod/1.4/0001##drop_repository_webhook_index.sql b/backend/store/migration/prod/1.4/0001##drop_repository_webhook_index.sql
similarity index 100%
rename from store/migration/prod/1.4/0001##drop_repository_webhook_index.sql
rename to backend/store/migration/prod/1.4/0001##drop_repository_webhook_index.sql
diff --git a/store/migration/prod/1.4/0002##delete_wildcard_database_backup_settings.sql b/backend/store/migration/prod/1.4/0002##delete_wildcard_database_backup_settings.sql
similarity index 100%
rename from store/migration/prod/1.4/0002##delete_wildcard_database_backup_settings.sql
rename to backend/store/migration/prod/1.4/0002##delete_wildcard_database_backup_settings.sql
diff --git a/store/migration/prod/1.5/0000##lgtm_check.sql b/backend/store/migration/prod/1.5/0000##lgtm_check.sql
similarity index 100%
rename from store/migration/prod/1.5/0000##lgtm_check.sql
rename to backend/store/migration/prod/1.5/0000##lgtm_check.sql
diff --git a/store/migration/prod/1.6/0000##datasource_address_override.sql b/backend/store/migration/prod/1.6/0000##datasource_address_override.sql
similarity index 100%
rename from store/migration/prod/1.6/0000##datasource_address_override.sql
rename to backend/store/migration/prod/1.6/0000##datasource_address_override.sql
diff --git a/store/migration/prod/1.6/0001##remove_timing_task_check_run.sql b/backend/store/migration/prod/1.6/0001##remove_timing_task_check_run.sql
similarity index 100%
rename from store/migration/prod/1.6/0001##remove_timing_task_check_run.sql
rename to backend/store/migration/prod/1.6/0001##remove_timing_task_check_run.sql
diff --git a/store/migration/prod/1.7/0000##add_repository_enable_sql_review_ci.sql b/backend/store/migration/prod/1.7/0000##add_repository_enable_sql_review_ci.sql
similarity index 100%
rename from store/migration/prod/1.7/0000##add_repository_enable_sql_review_ci.sql
rename to backend/store/migration/prod/1.7/0000##add_repository_enable_sql_review_ci.sql
diff --git a/store/migration/prod/1.8/0000##external_approval.sql b/backend/store/migration/prod/1.8/0000##external_approval.sql
similarity index 100%
rename from store/migration/prod/1.8/0000##external_approval.sql
rename to backend/store/migration/prod/1.8/0000##external_approval.sql
diff --git a/store/migration/prod/1.8/0001##drop_db_label_key_value_fkey.sql b/backend/store/migration/prod/1.8/0001##drop_db_label_key_value_fkey.sql
similarity index 100%
rename from store/migration/prod/1.8/0001##drop_db_label_key_value_fkey.sql
rename to backend/store/migration/prod/1.8/0001##drop_db_label_key_value_fkey.sql
diff --git a/store/migration/prod/1.9/0000##flexible_policy.sql b/backend/store/migration/prod/1.9/0000##flexible_policy.sql
similarity index 100%
rename from store/migration/prod/1.9/0000##flexible_policy.sql
rename to backend/store/migration/prod/1.9/0000##flexible_policy.sql
diff --git a/store/migration/prod/1.9/0001##database_in_instance.sql b/backend/store/migration/prod/1.9/0001##database_in_instance.sql
similarity index 100%
rename from store/migration/prod/1.9/0001##database_in_instance.sql
rename to backend/store/migration/prod/1.9/0001##database_in_instance.sql
diff --git a/store/migration/prod/1.9/0002##principal_type.sql b/backend/store/migration/prod/1.9/0002##principal_type.sql
similarity index 100%
rename from store/migration/prod/1.9/0002##principal_type.sql
rename to backend/store/migration/prod/1.9/0002##principal_type.sql
diff --git a/store/migration/prod/1.9/0003##assignee_attetion.sql b/backend/store/migration/prod/1.9/0003##assignee_attetion.sql
similarity index 100%
rename from store/migration/prod/1.9/0003##assignee_attetion.sql
rename to backend/store/migration/prod/1.9/0003##assignee_attetion.sql
diff --git a/store/migration/prod/LATEST.sql b/backend/store/migration/prod/LATEST.sql
similarity index 100%
rename from store/migration/prod/LATEST.sql
rename to backend/store/migration/prod/LATEST.sql
diff --git a/store/migration/prod/LATEST_DATA.sql b/backend/store/migration/prod/LATEST_DATA.sql
similarity index 100%
rename from store/migration/prod/LATEST_DATA.sql
rename to backend/store/migration/prod/LATEST_DATA.sql
diff --git a/store/pg_engine.go b/backend/store/pg_engine.go
similarity index 99%
rename from store/pg_engine.go
rename to backend/store/pg_engine.go
index b8e493b68a..2fda5d6179 100644
--- a/store/pg_engine.go
+++ b/backend/store/pg_engine.go
@@ -16,13 +16,13 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
- dbdriver "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/common/log"
+ dbdriver "github.com/bytebase/bytebase/backend/plugin/db"
// Register postgres driver.
- _ "github.com/bytebase/bytebase/plugin/db/pg"
+ _ "github.com/bytebase/bytebase/backend/plugin/db/pg"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/common"
)
const (
diff --git a/store/pg_engine_log.go b/backend/store/pg_engine_log.go
similarity index 96%
rename from store/pg_engine_log.go
rename to backend/store/pg_engine_log.go
index e6a3256731..35e6ff83ff 100644
--- a/store/pg_engine_log.go
+++ b/backend/store/pg_engine_log.go
@@ -11,7 +11,7 @@ import (
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// Replace mutiple whitespace characters including /t/n with a single space.
diff --git a/store/pg_engine_test.go b/backend/store/pg_engine_test.go
similarity index 96%
rename from store/pg_engine_test.go
rename to backend/store/pg_engine_test.go
index 75fd8f8da4..7bd6782b43 100644
--- a/store/pg_engine_test.go
+++ b/backend/store/pg_engine_test.go
@@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- dbdriver "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/postgres"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ dbdriver "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
)
func TestGetMinorMigrationVersions(t *testing.T) {
diff --git a/store/pipeline.go b/backend/store/pipeline.go
similarity index 98%
rename from store/pipeline.go
rename to backend/store/pipeline.go
index e6b812ea85..56b13f780c 100644
--- a/store/pipeline.go
+++ b/backend/store/pipeline.go
@@ -9,9 +9,9 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// pipelineRaw is the store model for an Pipeline.
diff --git a/store/policy.go b/backend/store/policy.go
similarity index 99%
rename from store/policy.go
rename to backend/store/policy.go
index e796e038cc..a63a2460dc 100644
--- a/store/policy.go
+++ b/backend/store/policy.go
@@ -8,9 +8,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
)
// policyRaw is the store model for an Policy.
diff --git a/store/principal.go b/backend/store/principal.go
similarity index 99%
rename from store/principal.go
rename to backend/store/principal.go
index 323eaeb73a..6d7ac890e3 100644
--- a/store/principal.go
+++ b/backend/store/principal.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// GetPrincipalList gets a list of Principal instances.
diff --git a/store/project.go b/backend/store/project.go
similarity index 99%
rename from store/project.go
rename to backend/store/project.go
index bcbdd4a7ad..5572142c81 100644
--- a/store/project.go
+++ b/backend/store/project.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// GetProjectByID gets an instance of Project.
diff --git a/store/project_member.go b/backend/store/project_member.go
similarity index 99%
rename from store/project_member.go
rename to backend/store/project_member.go
index b2efec2fad..ef12683193 100644
--- a/store/project_member.go
+++ b/backend/store/project_member.go
@@ -8,7 +8,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// IAMPolicyMessage is the IAM policy of a project.
diff --git a/store/project_member_test.go b/backend/store/project_member_test.go
similarity index 98%
rename from store/project_member_test.go
rename to backend/store/project_member_test.go
index 5f6933e025..47561982b6 100644
--- a/store/project_member_test.go
+++ b/backend/store/project_member_test.go
@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func TestGetIAMPolicyDiff(t *testing.T) {
diff --git a/store/project_webhook.go b/backend/store/project_webhook.go
similarity index 99%
rename from store/project_webhook.go
rename to backend/store/project_webhook.go
index 497e2a93c7..b177b28a1d 100644
--- a/store/project_webhook.go
+++ b/backend/store/project_webhook.go
@@ -9,8 +9,8 @@ import (
"github.com/jackc/pgtype"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// projectWebhookRaw is the store model for an ProjectWebhook.
diff --git a/store/repository.go b/backend/store/repository.go
similarity index 99%
rename from store/repository.go
rename to backend/store/repository.go
index 04ac0d8e1e..70d355b405 100644
--- a/store/repository.go
+++ b/backend/store/repository.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// repositoryRaw is the store model for a Repository.
diff --git a/store/setting.go b/backend/store/setting.go
similarity index 98%
rename from store/setting.go
rename to backend/store/setting.go
index cd1d6ee455..db76691cde 100644
--- a/store/setting.go
+++ b/backend/store/setting.go
@@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// settingRaw is the store model for an Setting.
diff --git a/store/sheet.go b/backend/store/sheet.go
similarity index 99%
rename from store/sheet.go
rename to backend/store/sheet.go
index d7c8c3e1cc..2d05cfcff4 100644
--- a/store/sheet.go
+++ b/backend/store/sheet.go
@@ -8,9 +8,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/metric"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/metric"
)
// sheetRaw is the store model for an Sheet.
diff --git a/store/sheet_organizer.go b/backend/store/sheet_organizer.go
similarity index 97%
rename from store/sheet_organizer.go
rename to backend/store/sheet_organizer.go
index 8cf6a5322f..4e9892915b 100644
--- a/store/sheet_organizer.go
+++ b/backend/store/sheet_organizer.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// sheetOrganizerRaw is the store model for SheetOrganizer.
diff --git a/store/stage.go b/backend/store/stage.go
similarity index 99%
rename from store/stage.go
rename to backend/store/stage.go
index 551ea9bca5..9ff918d765 100644
--- a/store/stage.go
+++ b/backend/store/stage.go
@@ -8,7 +8,7 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// stageRaw is the store model for an Stage.
diff --git a/store/stats.go b/backend/store/stats.go
similarity index 98%
rename from store/stats.go
rename to backend/store/stats.go
index aecdc9a2f4..660365b7da 100644
--- a/store/stats.go
+++ b/backend/store/stats.go
@@ -6,9 +6,9 @@ import (
"fmt"
"strings"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/metric"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/metric"
)
// CountInstanceMessage is the message for counting instances.
diff --git a/store/store.go b/backend/store/store.go
similarity index 97%
rename from store/store.go
rename to backend/store/store.go
index 38016dee77..da9fcff430 100644
--- a/store/store.go
+++ b/backend/store/store.go
@@ -5,7 +5,7 @@ import (
"fmt"
"sync"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// Store provides database access to all raw objects.
diff --git a/store/task.go b/backend/store/task.go
similarity index 99%
rename from store/task.go
rename to backend/store/task.go
index f2061f082e..8af55c104e 100644
--- a/store/task.go
+++ b/backend/store/task.go
@@ -11,10 +11,10 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/metric"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/metric"
)
// taskRaw is the store model for an Task.
diff --git a/store/task_check_run.go b/backend/store/task_check_run.go
similarity index 98%
rename from store/task_check_run.go
rename to backend/store/task_check_run.go
index e154b84304..1b4f62ca8e 100644
--- a/store/task_check_run.go
+++ b/backend/store/task_check_run.go
@@ -9,9 +9,9 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// taskCheckRunRaw is the store model for a TaskCheckRun.
diff --git a/store/task_dag.go b/backend/store/task_dag.go
similarity index 97%
rename from store/task_dag.go
rename to backend/store/task_dag.go
index 01a70062ac..74102435b2 100644
--- a/store/task_dag.go
+++ b/backend/store/task_dag.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
type taskDAGRaw struct {
diff --git a/store/task_run.go b/backend/store/task_run.go
similarity index 98%
rename from store/task_run.go
rename to backend/store/task_run.go
index 4cea84a26f..c171a4ed08 100644
--- a/store/task_run.go
+++ b/backend/store/task_run.go
@@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
)
// taskRunRaw is the store model for an TaskRun.
diff --git a/store/vcs.go b/backend/store/vcs.go
similarity index 98%
rename from store/vcs.go
rename to backend/store/vcs.go
index f843c80cfb..8554d66138 100644
--- a/store/vcs.go
+++ b/backend/store/vcs.go
@@ -8,9 +8,9 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// vcsRaw is the store model for a VCS (Version Control System).
diff --git a/tests/backup_restore_test.go b/backend/tests/backup_restore_test.go
similarity index 98%
rename from tests/backup_restore_test.go
rename to backend/tests/backup_restore_test.go
index ea15773e55..8001d261ea 100644
--- a/tests/backup_restore_test.go
+++ b/backend/tests/backup_restore_test.go
@@ -16,11 +16,11 @@ import (
"testing"
"time"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- resourcemysql "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ resourcemysql "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/tests/fake"
"go.uber.org/zap"
diff --git a/tests/data_source_test.go b/backend/tests/data_source_test.go
similarity index 93%
rename from tests/data_source_test.go
rename to backend/tests/data_source_test.go
index 820422c52b..a3ddf0eb9f 100644
--- a/tests/data_source_test.go
+++ b/backend/tests/data_source_test.go
@@ -7,10 +7,10 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestDataSource(t *testing.T) {
diff --git a/tests/database.go b/backend/tests/database.go
similarity index 98%
rename from tests/database.go
rename to backend/tests/database.go
index 8ab5583f26..5a87c4b060 100644
--- a/tests/database.go
+++ b/backend/tests/database.go
@@ -13,9 +13,9 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
func (ctl *controller) createDatabase(project *api.Project, instance *api.Instance, databaseName string, owner string, labelMap map[string]string) error {
diff --git a/tests/database_edit_test.go b/backend/tests/database_edit_test.go
similarity index 93%
rename from tests/database_edit_test.go
rename to backend/tests/database_edit_test.go
index 2ace20e9bb..01e31b7a9a 100644
--- a/tests/database_edit_test.go
+++ b/backend/tests/database_edit_test.go
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestDatabaseEdit(t *testing.T) {
diff --git a/tests/environment.go b/backend/tests/environment.go
similarity index 97%
rename from tests/environment.go
rename to backend/tests/environment.go
index 103a8bec02..1cce2995a2 100644
--- a/tests/environment.go
+++ b/backend/tests/environment.go
@@ -7,7 +7,7 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func (ctl *controller) createEnvironment(environmentCreate api.EnvironmentCreate) (*api.Environment, error) {
diff --git a/tests/external_approval_test.go b/backend/tests/external_approval_test.go
similarity index 98%
rename from tests/external_approval_test.go
rename to backend/tests/external_approval_test.go
index a702823e3b..256bcce661 100644
--- a/tests/external_approval_test.go
+++ b/backend/tests/external_approval_test.go
@@ -9,9 +9,9 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestExternalApprovalFeishu_AllUserCanBeFound(t *testing.T) {
diff --git a/tests/fake/fake.go b/backend/tests/fake/fake.go
similarity index 100%
rename from tests/fake/fake.go
rename to backend/tests/fake/fake.go
diff --git a/tests/fake/feishu.go b/backend/tests/fake/feishu.go
similarity index 99%
rename from tests/fake/feishu.go
rename to backend/tests/fake/feishu.go
index 2e332230a9..e1d176faa3 100644
--- a/tests/fake/feishu.go
+++ b/backend/tests/fake/feishu.go
@@ -12,7 +12,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/app/feishu"
+ "github.com/bytebase/bytebase/backend/plugin/app/feishu"
)
// Feishu is a fake feishu API server implementation for testing.
diff --git a/tests/fake/github.go b/backend/tests/fake/github.go
similarity index 99%
rename from tests/fake/github.go
rename to backend/tests/fake/github.go
index d6b178d2c2..4d103e69fd 100644
--- a/tests/fake/github.go
+++ b/backend/tests/fake/github.go
@@ -19,8 +19,8 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/github"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/github"
)
// GitHub is a fake implementation of GitHub VCS provider.
diff --git a/tests/fake/gitlab.go b/backend/tests/fake/gitlab.go
similarity index 99%
rename from tests/fake/gitlab.go
rename to backend/tests/fake/gitlab.go
index f83a9d8e46..dc5f2aabaf 100644
--- a/tests/fake/gitlab.go
+++ b/backend/tests/fake/gitlab.go
@@ -16,8 +16,8 @@ import (
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/gitlab"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
)
// GitLab is a fake implementation of GitLab VCS provider.
diff --git a/tests/fake/license b/backend/tests/fake/license
similarity index 100%
rename from tests/fake/license
rename to backend/tests/fake/license
diff --git a/tests/fake/provider.go b/backend/tests/fake/provider.go
similarity index 96%
rename from tests/fake/provider.go
rename to backend/tests/fake/provider.go
index fe023d7fc3..ac2b098a3b 100644
--- a/tests/fake/provider.go
+++ b/backend/tests/fake/provider.go
@@ -3,7 +3,7 @@ package fake
import (
"net"
- "github.com/bytebase/bytebase/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
)
// VCSProvider is a fake implementation of a VCS provider.
diff --git a/tests/ghost_test.go b/backend/tests/ghost_test.go
similarity index 98%
rename from tests/ghost_test.go
rename to backend/tests/ghost_test.go
index b36c6d0328..ca7f2635b7 100644
--- a/tests/ghost_test.go
+++ b/backend/tests/ghost_test.go
@@ -11,10 +11,10 @@ import (
"strings"
"testing"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/tests/fake"
ghostsql "github.com/github/gh-ost/go/sql"
_ "github.com/go-sql-driver/mysql"
diff --git a/tests/instance.go b/backend/tests/instance.go
similarity index 95%
rename from tests/instance.go
rename to backend/tests/instance.go
index a437961c02..91586ab402 100644
--- a/tests/instance.go
+++ b/backend/tests/instance.go
@@ -8,8 +8,8 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
// addInstance adds an instance.
diff --git a/tests/issue.go b/backend/tests/issue.go
similarity index 98%
rename from tests/issue.go
rename to backend/tests/issue.go
index 05a23efd47..d6ae7b53a4 100644
--- a/tests/issue.go
+++ b/backend/tests/issue.go
@@ -9,8 +9,8 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
)
// createIssue creates an issue.
diff --git a/tests/member.go b/backend/tests/member.go
similarity index 96%
rename from tests/member.go
rename to backend/tests/member.go
index fbe909bdd3..61fa6c4232 100644
--- a/tests/member.go
+++ b/backend/tests/member.go
@@ -6,7 +6,7 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func (ctl *controller) createPrincipal(principalCreate api.PrincipalCreate) (*api.Principal, error) {
diff --git a/tests/mysql.go b/backend/tests/mysql.go
similarity index 95%
rename from tests/mysql.go
rename to backend/tests/mysql.go
index fde59b9a20..edde0278da 100644
--- a/tests/mysql.go
+++ b/backend/tests/mysql.go
@@ -9,7 +9,7 @@ import (
"fmt"
"testing"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db"
)
func getMySQLConnectionConfig(port string, database string) db.ConnectionConfig {
diff --git a/tests/mysql_test.go b/backend/tests/mysql_test.go
similarity index 96%
rename from tests/mysql_test.go
rename to backend/tests/mysql_test.go
index ba700d96af..e4c8abff9a 100644
--- a/tests/mysql_test.go
+++ b/backend/tests/mysql_test.go
@@ -13,10 +13,10 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
- "github.com/bytebase/bytebase/common/log"
- pluginmysql "github.com/bytebase/bytebase/plugin/db/mysql"
- resourcemysql "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/common/log"
+ pluginmysql "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ resourcemysql "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
)
func TestCheckEngineInnoDB(t *testing.T) {
diff --git a/tests/policy.go b/backend/tests/policy.go
similarity index 96%
rename from tests/policy.go
rename to backend/tests/policy.go
index ddf66c2bff..be8d93683c 100644
--- a/tests/policy.go
+++ b/backend/tests/policy.go
@@ -8,7 +8,7 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// upsertPolicy upserts the policy.
diff --git a/tests/project.go b/backend/tests/project.go
similarity index 98%
rename from tests/project.go
rename to backend/tests/project.go
index 066bfc97ad..28f0f3d7c5 100644
--- a/tests/project.go
+++ b/backend/tests/project.go
@@ -9,7 +9,7 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// createProject creates an project.
diff --git a/tests/project_test.go b/backend/tests/project_test.go
similarity index 92%
rename from tests/project_test.go
rename to backend/tests/project_test.go
index 71217be726..d97ba1d12c 100644
--- a/tests/project_test.go
+++ b/backend/tests/project_test.go
@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestArchiveProject(t *testing.T) {
diff --git a/tests/rollback_test.go b/backend/tests/rollback_test.go
similarity index 95%
rename from tests/rollback_test.go
rename to backend/tests/rollback_test.go
index e51820f78f..b5b72fc9cd 100644
--- a/tests/rollback_test.go
+++ b/backend/tests/rollback_test.go
@@ -11,13 +11,13 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/db/mysql"
- resourcemysql "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/resources/mysqlutil"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ resourcemysql "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestRollback(t *testing.T) {
diff --git a/tests/schema_update_test.go b/backend/tests/schema_update_test.go
similarity index 99%
rename from tests/schema_update_test.go
rename to backend/tests/schema_update_test.go
index 8d693f39cd..7567bfc7be 100644
--- a/tests/schema_update_test.go
+++ b/backend/tests/schema_update_test.go
@@ -21,15 +21,15 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/testing/protocmp"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/github"
- "github.com/bytebase/bytebase/plugin/vcs/gitlab"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/github"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/tests/fake"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/tests/fake"
)
func TestSchemaAndDataUpdate(t *testing.T) {
diff --git a/tests/sensitive_data_test.go b/backend/tests/sensitive_data_test.go
similarity index 96%
rename from tests/sensitive_data_test.go
rename to backend/tests/sensitive_data_test.go
index 6df20a4ea0..1ce35d7b48 100644
--- a/tests/sensitive_data_test.go
+++ b/backend/tests/sensitive_data_test.go
@@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestSensitiveData(t *testing.T) {
diff --git a/tests/sheet.go b/backend/tests/sheet.go
similarity index 96%
rename from tests/sheet.go
rename to backend/tests/sheet.go
index fe0f7a0be8..f90b085b38 100644
--- a/tests/sheet.go
+++ b/backend/tests/sheet.go
@@ -8,7 +8,7 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// createSheet creates a sheet.
diff --git a/tests/sheet_vcs_test.go b/backend/tests/sheet_vcs_test.go
similarity index 95%
rename from tests/sheet_vcs_test.go
rename to backend/tests/sheet_vcs_test.go
index 101ebbbed9..022111ce3b 100644
--- a/tests/sheet_vcs_test.go
+++ b/backend/tests/sheet_vcs_test.go
@@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestSheetVCS(t *testing.T) {
diff --git a/tests/sql.go b/backend/tests/sql.go
similarity index 99%
rename from tests/sql.go
rename to backend/tests/sql.go
index 7c6dfd90c6..1b797a41a0 100644
--- a/tests/sql.go
+++ b/backend/tests/sql.go
@@ -10,9 +10,9 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/advisor"
- "github.com/bytebase/bytebase/plugin/parser"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/advisor"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
)
// executeSQL executes a SQL query on the database.
diff --git a/tests/sql_editor_test.go b/backend/tests/sql_editor_test.go
similarity index 94%
rename from tests/sql_editor_test.go
rename to backend/tests/sql_editor_test.go
index f77cb650af..b2ba82263a 100644
--- a/tests/sql_editor_test.go
+++ b/backend/tests/sql_editor_test.go
@@ -9,11 +9,11 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- resourcemysql "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ resourcemysql "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestAdminQueryAffectedRows(t *testing.T) {
diff --git a/tests/sql_review_test.go b/backend/tests/sql_review_test.go
similarity index 97%
rename from tests/sql_review_test.go
rename to backend/tests/sql_review_test.go
index a65ff8ad19..e4040f7b2f 100644
--- a/tests/sql_review_test.go
+++ b/backend/tests/sql_review_test.go
@@ -20,12 +20,12 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
var noSQLReviewPolicy = []api.TaskCheckResult{
diff --git a/tests/start_test.go b/backend/tests/start_test.go
similarity index 88%
rename from tests/start_test.go
rename to backend/tests/start_test.go
index 48a5c651a3..263e7928e5 100644
--- a/tests/start_test.go
+++ b/backend/tests/start_test.go
@@ -8,12 +8,12 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/resources/mongoutil"
- resourcemysql "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/resources/mysqlutil"
+ "github.com/bytebase/bytebase/backend/resources/mongoutil"
+ resourcemysql "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/resources/mysqlutil"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func startStopServer(ctx context.Context, a *require.Assertions, ctl *controller, dataDir string, readOnly bool) {
diff --git a/tests/subscription.go b/backend/tests/subscription.go
similarity index 92%
rename from tests/subscription.go
rename to backend/tests/subscription.go
index 176f63d4b4..ebfa5440fd 100644
--- a/tests/subscription.go
+++ b/backend/tests/subscription.go
@@ -6,9 +6,9 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- enterpriseAPI "github.com/bytebase/bytebase/enterprise/api"
+ enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
func (ctl *controller) setLicense() error {
diff --git a/tests/subscription_test.go b/backend/tests/subscription_test.go
similarity index 92%
rename from tests/subscription_test.go
rename to backend/tests/subscription_test.go
index ab3f00db90..bfb278a49b 100644
--- a/tests/subscription_test.go
+++ b/backend/tests/subscription_test.go
@@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
type trial struct {
diff --git a/tests/sync_schema_test.go b/backend/tests/sync_schema_test.go
similarity index 94%
rename from tests/sync_schema_test.go
rename to backend/tests/sync_schema_test.go
index 089c0295cb..1afc61f700 100644
--- a/tests/sync_schema_test.go
+++ b/backend/tests/sync_schema_test.go
@@ -10,11 +10,11 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/parser"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/parser"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
func TestSyncSchema(t *testing.T) {
diff --git a/tests/syncer_test.go b/backend/tests/syncer_test.go
similarity index 97%
rename from tests/syncer_test.go
rename to backend/tests/syncer_test.go
index b3564ec1e1..b064c1c653 100644
--- a/tests/syncer_test.go
+++ b/backend/tests/syncer_test.go
@@ -13,12 +13,12 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/testing/protocmp"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/resources/mysql"
+ "github.com/bytebase/bytebase/backend/resources/postgres"
+ "github.com/bytebase/bytebase/backend/tests/fake"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- "github.com/bytebase/bytebase/resources/mysql"
- "github.com/bytebase/bytebase/resources/postgres"
- "github.com/bytebase/bytebase/tests/fake"
)
func TestSyncerForPostgreSQL(t *testing.T) {
diff --git a/tests/tags_dev.go b/backend/tests/tags_dev.go
similarity index 65%
rename from tests/tags_dev.go
rename to backend/tests/tags_dev.go
index bee174be20..778e03c662 100644
--- a/tests/tags_dev.go
+++ b/backend/tests/tags_dev.go
@@ -3,6 +3,6 @@
package tests
-import "github.com/bytebase/bytebase/common"
+import "github.com/bytebase/bytebase/backend/common"
const testReleaseMode = common.ReleaseModeDev
diff --git a/tests/tags_prod.go b/backend/tests/tags_prod.go
similarity index 65%
rename from tests/tags_prod.go
rename to backend/tests/tags_prod.go
index d02bcdf3e0..be8b989f69 100644
--- a/tests/tags_prod.go
+++ b/backend/tests/tags_prod.go
@@ -3,6 +3,6 @@
package tests
-import "github.com/bytebase/bytebase/common"
+import "github.com/bytebase/bytebase/backend/common"
const testReleaseMode = common.ReleaseModeProd
diff --git a/tests/tenant_test.go b/backend/tests/tenant_test.go
similarity index 99%
rename from tests/tenant_test.go
rename to backend/tests/tenant_test.go
index ea51ee7e68..ac36444f01 100644
--- a/tests/tenant_test.go
+++ b/backend/tests/tenant_test.go
@@ -9,12 +9,12 @@ import (
"github.com/stretchr/testify/require"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/plugin/db"
- "github.com/bytebase/bytebase/plugin/vcs"
- "github.com/bytebase/bytebase/plugin/vcs/github"
- "github.com/bytebase/bytebase/plugin/vcs/gitlab"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/plugin/vcs"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/github"
+ "github.com/bytebase/bytebase/backend/plugin/vcs/gitlab"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
var (
diff --git a/tests/test-data/sql_review_mysql.yaml b/backend/tests/test-data/sql_review_mysql.yaml
similarity index 100%
rename from tests/test-data/sql_review_mysql.yaml
rename to backend/tests/test-data/sql_review_mysql.yaml
diff --git a/tests/test-data/sql_review_pg.yaml b/backend/tests/test-data/sql_review_pg.yaml
similarity index 100%
rename from tests/test-data/sql_review_pg.yaml
rename to backend/tests/test-data/sql_review_pg.yaml
diff --git a/tests/tests.go b/backend/tests/tests.go
similarity index 98%
rename from tests/tests.go
rename to backend/tests/tests.go
index 3256a55ec7..942cbbc81f 100644
--- a/tests/tests.go
+++ b/backend/tests/tests.go
@@ -23,12 +23,12 @@ import (
// init() in pgx/v5/stdlib will register it's pgx driver.
_ "github.com/jackc/pgx/v5/stdlib"
- "github.com/bytebase/bytebase/api"
- "github.com/bytebase/bytebase/common"
- "github.com/bytebase/bytebase/common/log"
- "github.com/bytebase/bytebase/server"
- componentConfig "github.com/bytebase/bytebase/server/component/config"
- "github.com/bytebase/bytebase/tests/fake"
+ "github.com/bytebase/bytebase/backend/api"
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/log"
+ "github.com/bytebase/bytebase/backend/server"
+ componentConfig "github.com/bytebase/bytebase/backend/server/component/config"
+ "github.com/bytebase/bytebase/backend/tests/fake"
)
var (
diff --git a/tests/vcs.go b/backend/tests/vcs.go
similarity index 98%
rename from tests/vcs.go
rename to backend/tests/vcs.go
index 125c1ad240..4e3d4ddcad 100644
--- a/tests/vcs.go
+++ b/backend/tests/vcs.go
@@ -8,7 +8,7 @@ import (
"github.com/google/jsonapi"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/api"
+ "github.com/bytebase/bytebase/backend/api"
)
// createVCS creates a VCS.
diff --git a/docs/design/db-plugin-development-guide.md b/docs/design/db-plugin-development-guide.md
index aaeefba504..e65c904bfd 100644
--- a/docs/design/db-plugin-development-guide.md
+++ b/docs/design/db-plugin-development-guide.md
@@ -8,8 +8,8 @@ Internally, Bytebase creates a table in database to record migration history.
## Develop a plugin
1. Under `plugin/db`, create a go package named driver's name.
-1. Implement `github.com/bytebase/bytebase/plugin/db#Driver` interface.
-1. \[Optional\] There are some common implementations in package `github.com/bytebase/bytebase/plugin/db/util`. To use these utils, additional adapters are needed usually.
+1. Implement `github.com/bytebase/bytebase/backend/plugin/db#Driver` interface.
+1. \[Optional\] There are some common implementations in package `github.com/bytebase/bytebase/backend/plugin/db/util`. To use these utils, additional adapters are needed usually.
For instance, `util#ExecuteMigration` is a helper function to implement `db.Driver#ExecuteMigration`. And this function needs a `util.MigrationExecutor` adapter.
-1. Register plugin. In `init()` function, call `github.com/bytebase/bytebase/plugin/db#Register` to register plugin factory with specific db type.
+1. Register plugin. In `init()` function, call `github.com/bytebase/bytebase/backend/plugin/db#Register` to register plugin factory with specific db type.
diff --git a/docs/openapi.md b/docs/openapi.md
index 89bb82e364..a07e3c0fa4 100644
--- a/docs/openapi.md
+++ b/docs/openapi.md
@@ -11,7 +11,7 @@ Bytebase OpenAPI implements the OpenAPI specification with Swagger.
### Comment for OpenAPIs
-1. Add general API annotations in `./server/server.go`.
+1. Add general API annotations in `./backend/server/server.go`.
2. Add API operation annotations in your controller code.
> **Note**
@@ -52,7 +52,7 @@ Every time you changed the comments, you need to re-run the following command to
```bash
cd bytebase
# generate swagger doc
-swag init -g ./server.go -d ./server --output docs/openapi --parseDependency
+swag init -g ./backend/server.go -d ./backend/server --output docs/openapi --parseDependency
```
This should generate new docs under `./docs/openapi` folder based on your comments.
diff --git a/frontend/package.json b/frontend/package.json
index 267dbfd7f9..fad851656f 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -3,7 +3,7 @@
"license": "SEE LICENSE IN LICENSE",
"scripts": {
"dev": "npm run copy-sql-review-file && vite --mode dev",
- "release": "export NODE_OPTIONS=--max_old_space_size=4096 && npm run copy-sql-review-file && vite build --mode release --outDir=../server/dist --emptyOutDir",
+ "release": "export NODE_OPTIONS=--max_old_space_size=4096 && npm run copy-sql-review-file && vite build --mode release --outDir=../backend/server/dist --emptyOutDir",
"dev-docker": "export NODE_OPTIONS=--max_old_space_size=4096 && vite build --mode dev",
"release-docker": "export NODE_OPTIONS=--max_old_space_size=4096 && vite build --mode release",
"lint": "eslint --cache --ext .js,.ts,.tsx,.vue src",
diff --git a/frontend/scripts/copy_sql_review_files.sh b/frontend/scripts/copy_sql_review_files.sh
index 40d22e344d..5eb3b2fd70 100644
--- a/frontend/scripts/copy_sql_review_files.sh
+++ b/frontend/scripts/copy_sql_review_files.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-cp ../plugin/advisor/config/* ./src/types/
\ No newline at end of file
+cp ../backend/plugin/advisor/config/* ./src/types/
\ No newline at end of file
diff --git a/scripts/.air.toml b/scripts/.air.toml
index 1eb85131db..4ba5240e51 100644
--- a/scripts/.air.toml
+++ b/scripts/.air.toml
@@ -9,13 +9,13 @@ tmp_dir = ".air"
--tags "" \
-gcflags=all=\"-N -l\" \
-ldflags " \
- -X 'github.com/bytebase/bytebase/bin/server/cmd.version=development' \
- -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=$(go version)' \
- -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=$(git rev-parse HEAD)' \
- -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' \
- -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=$(id -u -n)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.version=development' \
+ -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.goversion=$(go version)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=$(git rev-parse HEAD)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' \
+ -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=$(id -u -n)' \
" \
- -o ./.air/bytebase ./bin/server/main.go"""
+ -o ./.air/bytebase ./backend/bin/server/main.go"""
delay = 1000
exclude_dir = [".air", "vendor", "frontend", "docs"]
exclude_file = []
diff --git a/scripts/.air_bb.toml b/scripts/.air_bb.toml
index 0b97184250..21c903fa32 100644
--- a/scripts/.air_bb.toml
+++ b/scripts/.air_bb.toml
@@ -6,13 +6,13 @@ tmp_dir = ".air"
cmd = """
go build \
-ldflags " \
- -X 'github.com/bytebase/bytebase/bin/bb/cmd.version=development' \
- -X 'github.com/bytebase/bytebase/bin/bb/cmd.goversion=$(go version)' \
- -X 'github.com/bytebase/bytebase/bin/bb/cmd.gitcommit=$(git rev-parse HEAD)' \
- -X 'github.com/bytebase/bytebase/bin/bb/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' \
- -X 'github.com/bytebase/bytebase/bin/bb/cmd.builduser=$(id -u -n)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.version=development' \
+ -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=$(go version)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit=$(git rev-parse HEAD)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' \
+ -X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=$(id -u -n)' \
" \
- -o ./.air/bb ./bin/bb/main.go"""
+ -o ./.air/bb ./backend/bin/bb/main.go"""
delay = 1000
exclude_dir = [".air", "vendor", "frontend", "docs"]
exclude_file = []
diff --git a/scripts/.air_sql_service.toml b/scripts/.air_sql_service.toml
index 4fec81936a..30dd227bbf 100644
--- a/scripts/.air_sql_service.toml
+++ b/scripts/.air_sql_service.toml
@@ -6,13 +6,13 @@ tmp_dir = ".air"
cmd = """
go build -gcflags=all=\"-N -l\" \
-ldflags " \
- -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.version=development' \
- -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.goversion=$(go version)' \
- -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.gitcommit=$(git rev-parse HEAD)' \
- -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' \
- -X 'github.com/bytebase/bytebase/bin/sql-service/cmd.builduser=$(id -u -n)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.version=development' \
+ -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.goversion=$(go version)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.gitcommit=$(git rev-parse HEAD)' \
+ -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")' \
+ -X 'github.com/bytebase/bytebase/backend/bin/sql-service/cmd.builduser=$(id -u -n)' \
" \
- -o ./.air/sql-service ./bin/sql-service/main.go"""
+ -o ./.air/sql-service ./backend/bin/sql-service/main.go"""
delay = 1000
exclude_dir = [".air", "vendor", "frontend", "docs"]
exclude_file = []
diff --git a/scripts/.goreleaser-for-darwin.yaml b/scripts/.goreleaser-for-darwin.yaml
index 0b84d317c2..8041e15380 100644
--- a/scripts/.goreleaser-for-darwin.yaml
+++ b/scripts/.goreleaser-for-darwin.yaml
@@ -3,15 +3,15 @@ before:
- go mod tidy
builds:
- id: server
- main: ./bin/server
+ main: ./backend/bin/server
binary: bytebase
ldflags:
- -w -s
- - -X github.com/bytebase/bytebase/bin/server/cmd.version={{.Version}}
- - -X github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}
- - -X github.com/bytebase/bytebase/bin/server/cmd.gitcommit={{.Commit}}
- - -X github.com/bytebase/bytebase/bin/server/cmd.buildtime={{.Timestamp}}
- - -X github.com/bytebase/bytebase/bin/server/cmd.builduser=goreleaser
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.version={{.Version}}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.goversion=${GO_VERSION}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit={{.Commit}}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime={{.Timestamp}}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=goreleaser
tags:
- release
- embed_frontend
@@ -28,15 +28,15 @@ builds:
- amd64
- arm64
- id: cli
- main: ./bin/bb
+ main: ./backend/bin/bb
binary: bb
ldflags:
- -w -s
- - -X github.com/bytebase/bytebase/bin/bb/cmd.version={{.Version}}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.goversion=${GO_VERSION}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.gitcommit={{.Commit}}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.buildtime={{.Timestamp}}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.builduser=goreleaser
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.version={{.Version}}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=${GO_VERSION}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit={{.Commit}}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime={{.Timestamp}}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=goreleaser
tags:
- release
env:
diff --git a/scripts/.goreleaser-for-linux.yaml b/scripts/.goreleaser-for-linux.yaml
index 830d3a8dc1..1348141ed7 100644
--- a/scripts/.goreleaser-for-linux.yaml
+++ b/scripts/.goreleaser-for-linux.yaml
@@ -3,15 +3,15 @@ before:
- go mod tidy
builds:
- id: server
- main: ./bin/server
+ main: ./backend/bin/server
binary: bytebase
ldflags:
- -w -s
- - -X github.com/bytebase/bytebase/bin/server/cmd.version={{.Version}}
- - -X github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}
- - -X github.com/bytebase/bytebase/bin/server/cmd.gitcommit={{.Commit}}
- - -X github.com/bytebase/bytebase/bin/server/cmd.buildtime={{.Timestamp}}
- - -X github.com/bytebase/bytebase/bin/server/cmd.builduser=goreleaser
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.version={{.Version}}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.goversion=${GO_VERSION}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit={{.Commit}}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime={{.Timestamp}}
+ - -X github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=goreleaser
tags:
- release
- embed_frontend
@@ -33,15 +33,15 @@ builds:
env:
- CC=gcc
- id: cli
- main: ./bin/bb
+ main: ./backend/bin/bb
binary: bb
ldflags:
- -w -s
- - -X github.com/bytebase/bytebase/bin/bb/cmd.version={{.Version}}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.goversion=${GO_VERSION}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.gitcommit={{.Commit}}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.buildtime={{.Timestamp}}
- - -X github.com/bytebase/bytebase/bin/bb/cmd.builduser=goreleaser
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.version={{.Version}}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=${GO_VERSION}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit={{.Commit}}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime={{.Timestamp}}
+ - -X github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=goreleaser
tags:
- release
env:
diff --git a/scripts/build_bb.sh b/scripts/build_bb.sh
index c521453fbe..f96614dabb 100755
--- a/scripts/build_bb.sh
+++ b/scripts/build_bb.sh
@@ -15,14 +15,14 @@ OUTPUT_BINARY=$OUTPUT_DIR/bb
echo "Start building bb ${VERSION}..."
-flags="-X 'github.com/bytebase/bytebase/bin/bb/cmd.version=${VERSION}'
--X 'github.com/bytebase/bytebase/bin/bb/cmd.goversion=$(go version)'
--X 'github.com/bytebase/bytebase/bin/bb/cmd.gitcommit=$(git rev-parse HEAD)'
--X 'github.com/bytebase/bytebase/bin/bb/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
--X 'github.com/bytebase/bytebase/bin/bb/cmd.builduser=$(id -u -n)'"
+flags="-X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.version=${VERSION}'
+-X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.goversion=$(go version)'
+-X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.gitcommit=$(git rev-parse HEAD)'
+-X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
+-X 'github.com/bytebase/bytebase/backend/bin/bb/cmd.builduser=$(id -u -n)'"
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-go build --tags "release" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./bin/bb/main.go
+go build --tags "release" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./backend/bin/bb/main.go
echo "Completed building bb."
diff --git a/scripts/build_bytebase.sh b/scripts/build_bytebase.sh
index 550094a6e8..b181484a72 100755
--- a/scripts/build_bytebase.sh
+++ b/scripts/build_bytebase.sh
@@ -49,14 +49,14 @@ echo "Completed building Bytebase frontend."
echo ""
echo "Step 2 - building Bytebase backend..."
-flags="-X 'github.com/bytebase/bytebase/bin/server/cmd.version=${VERSION}'
--X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=$(go version)'
--X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=$(git rev-parse HEAD)'
--X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
--X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=$(id -u -n)'"
+flags="-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.version=${VERSION}'
+-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.goversion=$(go version)'
+-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=$(git rev-parse HEAD)'
+-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.buildtime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
+-X 'github.com/bytebase/bytebase/backend/bin/server/cmd.builduser=$(id -u -n)'"
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-go build --tags "release,embed_frontend" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./bin/server/main.go
+go build --tags "release,embed_frontend" -ldflags "-w -s $flags" -o ${OUTPUT_BINARY} ./backend/bin/server/main.go
echo "Completed building Bytebase backend."