Skip to content

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

chore: disable subscription banner in demo mode and fix demo data (#6896)

Tianzhou (天舟)d285a64dfe32
diff --git a/backend/bin/server/cmd/root.go b/backend/bin/server/cmd/root.go
index 41e0ded369..2499dcd7c7 100644
--- a/backend/bin/server/cmd/root.go
+++ b/backend/bin/server/cmd/root.go
@@ -69,7 +69,7 @@ var (
readonly bool
// saas means the Bytebase is running in SaaS mode, several features is only controlled by us instead of users under this mode.
saas bool
- // demoName is the name of the demo and should be one of the subpath name in the ./store/demo/ directory.
+ // demoName is the name of the demo and should be one of the subpath name in the ../migrator/demo directory.
// empty means no demo.
demoName string
debug bool
@@ -117,7 +117,7 @@ func init() {
rootCmd.PersistentFlags().StringVar(&flags.dataDir, "data", ".", "directory where Bytebase stores data. If relative path is supplied, then the path is relative to the directory where Bytebase is under")
rootCmd.PersistentFlags().BoolVar(&flags.readonly, "readonly", false, "whether to run in read-only mode")
rootCmd.PersistentFlags().BoolVar(&flags.saas, "saas", false, "whether to run in SaaS mode")
- // Must be one of the subpath name in the ./store/demo/ directory
+ // Must be one of the subpath name in the ../migrator/demo directory
rootCmd.PersistentFlags().StringVar(&flags.demoName, "demo", "", "name of the demo to use. Empty means not running in demo mode.")
rootCmd.PersistentFlags().BoolVar(&flags.debug, "debug", false, "whether to enable debug level logging")
// Support environment variable for deploying to render.com using its blueprint file.
diff --git a/backend/migrator/demo/default/10110##task.sql b/backend/migrator/demo/default/10110##task.sql
index 9f8ff54696..1e3822bb9b 100644
--- a/backend/migrator/demo/default/10110##task.sql
+++ b/backend/migrator/demo/default/10110##task.sql
@@ -23,9 +23,9 @@ VALUES
6004,
7014,
'Welcome',
- 'bb.task.general',
+ 'bb.task.database.schema.update',
'PENDING_APPROVAL',
- '{"statement":"SELECT ''Welcome Tech Lead, DBA, Developer'';"}'
+ '{"migrationType":"MIGRATE","statement":"CREATE TABLE t1 (name TEXT, age INT);"}'
);
-- Task for Pipeline 9002
diff --git a/backend/migrator/demo/default/10130##issue.sql b/backend/migrator/demo/default/10130##issue.sql
index e05fb1e987..f8350cb2c9 100644
--- a/backend/migrator/demo/default/10130##issue.sql
+++ b/backend/migrator/demo/default/10130##issue.sql
@@ -21,8 +21,8 @@ VALUES
9001,
'Hello world!',
'OPEN',
- 'bb.issue.general',
- 'Welcome to Bytebase, this is the issue interface where developers and DBAs collaborate on database schema management issues such as: '||chr(10)||' - Creating a new database'||chr(10)||' - Creating a table'||chr(10)||' - Creating an index'||chr(10)||' - Adding/Altering a column'||chr(10)||' - Troubleshooting performance issue'||chr(10)||'Let''s try some simple tasks:'||chr(10)||'1. Bookmark this issue by clicking the star icon on the top of this page'||chr(10)||'2. Leave a comment below to greet future customers.',
+ 'bb.issue.database.schema.update',
+ 'Welcome to Bytebase, this is the issue interface where developers and DBAs collaborate on database schema management issues such as: '||chr(10)||chr(10)||' - Creating a new database'||chr(10)||' - Creating a table'||chr(10)||' - Creating an index'||chr(10)||' - Adding/Altering a column'||chr(10)||' - Troubleshooting performance issue'||chr(10)||chr(10)||'Let''s try some simple tasks:'||chr(10)||chr(10)||'1. Bookmark this issue by clicking the star icon on the top of this page.'||chr(10)||'2. Leave a comment below to greet future customers.',
101
);
diff --git a/docs/schema-update-guide.md b/docs/schema-update-guide.md
index 81269dbe54..dbd46e19b1 100644
--- a/docs/schema-update-guide.md
+++ b/docs/schema-update-guide.md
@@ -18,9 +18,7 @@ Dev
Demo Data
-- When the binary starts in Demo mode, we will seed demo data to provide a better onboarding experience.
-- [Dev demo data](https://github.com/bytebase/bytebase/tree/main/store/demo/dev).
-- [Prod demo data](https://github.com/bytebase/bytebase/tree/main/store/demo/prod).
+- When the binary starts in Demo mode, we will seed [demo data](https://github.com/bytebase/bytebase/tree/main/backend/migrator/demo) to provide a better onboarding experience.
## Development
diff --git a/frontend/src/views/BannerUpgradeSubscription.vue b/frontend/src/views/BannerUpgradeSubscription.vue
index 0b5d8675cf..c86accb578 100644
--- a/frontend/src/views/BannerUpgradeSubscription.vue
+++ b/frontend/src/views/BannerUpgradeSubscription.vue
@@ -87,6 +87,7 @@ import {
useDBGroupStore,
useDatabaseV1Store,
useDatabaseSecretStore,
+ useActuatorV1Store,
} from "@/store";
import { onMounted } from "vue";
import { computed } from "vue";
@@ -111,6 +112,7 @@ const state = reactive<LocalState>({
ready: false,
});
+const actuatorStore = useActuatorV1Store();
const idpStore = useIdentityProviderStore();
const settingV1Store = useSettingV1Store();
const instanceStore = useInstanceV1Store();
@@ -240,6 +242,8 @@ const neededPlan = computed(() => {
const showBanner = computed(() => {
return (
+ // Do not show banner in demo mode
+ actuatorStore.serverInfo?.demoName == "" &&
overUsedFeatureList.value.length > 0 &&
neededPlan.value > subscriptionStore.currentPlan
);