Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

feat: follow up

mertmite413e1aabe41
diff --git a/packages/nocodb/src/meta/migrations/v0/nc_019_sandboxes.ts b/packages/nocodb/src/meta/migrations/v0/nc_019_sandboxes.ts
index 0e2748b825..077f5c44a3 100644
--- a/packages/nocodb/src/meta/migrations/v0/nc_019_sandboxes.ts
+++ b/packages/nocodb/src/meta/migrations/v0/nc_019_sandboxes.ts
@@ -31,8 +31,8 @@ const up = async (knex: Knex) => {
// Add sandbox-related columns to bases table (nc_bases_v2)
await knex.schema.alterTable(MetaTable.PROJECT, (table) => {
- // Points to SANDBOXES.id if this base has an active sandbox
- table.string('fk_sandbox_id', 20);
+ // Is this base a master base that has sandbox(es)?
+ table.boolean('is_sandbox_master').defaultTo(false);
// Is this base a sandbox base?
table.boolean('is_sandbox').defaultTo(false);
@@ -41,7 +41,7 @@ const up = async (knex: Knex) => {
// Add indexes for sandbox relationship columns
await knex.schema.alterTable(MetaTable.PROJECT, (table) => {
table.index(['is_sandbox'], 'nc_bases_is_sandbox_idx');
- table.index(['fk_sandbox_id'], 'nc_bases_fk_sandbox_id_idx');
+ table.index(['is_sandbox_master'], 'nc_bases_is_sandbox_master_idx');
});
};
@@ -49,13 +49,13 @@ const down = async (knex: Knex) => {
// Drop indexes from bases table
await knex.schema.alterTable(MetaTable.PROJECT, (table) => {
table.dropIndex(['is_sandbox'], 'nc_bases_is_sandbox_idx');
- table.dropIndex(['fk_sandbox_id'], 'nc_bases_fk_sandbox_id_idx');
+ table.dropIndex(['is_sandbox_master'], 'nc_bases_is_sandbox_master_idx');
});
// Drop sandbox columns from bases table
await knex.schema.alterTable(MetaTable.PROJECT, (table) => {
table.dropColumn('is_sandbox');
- table.dropColumn('fk_sandbox_id');
+ table.dropColumn('is_sandbox_master');
});
// Drop sandboxes table
diff --git a/packages/nocodb/src/models/Base.ts b/packages/nocodb/src/models/Base.ts
index 0adae2a68c..7737a84837 100644
--- a/packages/nocodb/src/models/Base.ts
+++ b/packages/nocodb/src/models/Base.ts
@@ -65,9 +65,8 @@ export default class Base implements BaseType {
managed_app_schema_locked?: boolean; // Computed: whether schema modifications are allowed
// sandbox props
- fk_sandbox_id?: string; // Points to SANDBOXES.id if this base has an active sandbox
+ is_sandbox_master?: boolean; // Is this base a master base that has sandbox(es)?
is_sandbox?: boolean; // Is this base a sandbox base?
- sandbox_schema_locked?: boolean; // Computed: whether schema is locked due to active sandbox
constructor(base: Partial<Base>) {
Object.assign(this, base);
@@ -81,10 +80,6 @@ export default class Base implements BaseType {
return;
}
- public static async populateSandboxInfo(_base: Base): Promise<void> {
- return;
- }
-
public static async createProject(
base: Partial<BaseType>,
ncMeta = Noco.ncMeta,
@@ -104,7 +99,7 @@ export default class Base implements BaseType {
'managed_app_id',
'managed_app_version_id',
'auto_update',
- 'fk_sandbox_id',
+ 'is_sandbox_master',
'is_sandbox',
]);
@@ -487,7 +482,7 @@ export default class Base implements BaseType {
'managed_app_id',
'managed_app_version_id',
'auto_update',
- 'fk_sandbox_id',
+ 'is_sandbox_master',
'is_sandbox',
]);
diff --git a/packages/nocodb/src/schema/swagger-v2.json b/packages/nocodb/src/schema/swagger-v2.json
index 73765ecb53..1d9f3097ec 100644
--- a/packages/nocodb/src/schema/swagger-v2.json
+++ b/packages/nocodb/src/schema/swagger-v2.json
@@ -18840,9 +18840,9 @@
"$ref": "#/components/schemas/Bool",
"description": "Indicates if the base is a sandbox"
},
- "fk_sandbox_id": {
- "$ref": "#/components/schemas/StringOrNull",
- "description": "If the base has a sandbox, this is the sandbox ID"
+ "is_sandbox_master": {
+ "$ref": "#/components/schemas/Bool",
+ "description": "Indicates if the base is a sandbox master"
}
},
"x-stoplight": {
diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json
index fa7e369879..195335ddf3 100644
--- a/packages/nocodb/src/schema/swagger.json
+++ b/packages/nocodb/src/schema/swagger.json
@@ -26816,9 +26816,9 @@
"$ref": "#/components/schemas/Bool",
"description": "Indicates if the base is a sandbox"
},
- "fk_sandbox_id": {
- "$ref": "#/components/schemas/StringOrNull",
- "description": "If the base has a sandbox, this is the sandbox ID"
+ "is_sandbox_master": {
+ "$ref": "#/components/schemas/Bool",
+ "description": "Indicates if the base is a sandbox master"
}
},
"x-stoplight": {